From 31a14bea384a14c9d4f1278d7df6de81406801b9 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Wed, 1 Feb 2023 07:24:03 -0600 Subject: [PATCH] Bootstrap by default in prep script (#15378) --- README.md | 2 - eng/pipelines/templates/jobs/vmr-build.yml | 10 +---- eng/pipelines/templates/stages/vmr-build.yml | 7 ---- src/SourceBuild/content/prep.sh | 43 ++++++++------------ 4 files changed, 19 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 9aec54e89..0c48dca6a 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,6 @@ Further instructions on how to build inside of the Codespace will be available u cd /path/to/complete/dotnet/sources ./prep.sh ``` - - On arm64, please use `./prep.sh --bootstrap` instead. 3. Build the .NET SDK diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml index 3d32c9faf..0a2177d3f 100644 --- a/eng/pipelines/templates/jobs/vmr-build.yml +++ b/eng/pipelines/templates/jobs/vmr-build.yml @@ -45,9 +45,6 @@ parameters: - name: excludeOmniSharpTests type: boolean -- name: bootstrapPrep - type: boolean - - name: enablePoison type: boolean @@ -154,12 +151,7 @@ jobs: set -x if [[ -z '${{ parameters.reuseBuildArtifactsFrom }}' ]]; then - customPrepArgs= - if [[ '${{ parameters.bootstrapPrep }}' == 'True' ]]; then - customPrepArgs='--bootstrap' - fi - - docker run --rm -v "$(sourcesPath):/vmr" -w /vmr ${{ parameters.container }} ./prep.sh ${customPrepArgs} + docker run --rm -v "$(sourcesPath):/vmr" -w /vmr ${{ parameters.container }} ./prep.sh else mkdir $(sourcesPath)/.dotnet previousSdkPath="$(sourcesPath)/packages/archive/dotnet-sdk-*.tar.gz" diff --git a/eng/pipelines/templates/stages/vmr-build.yml b/eng/pipelines/templates/stages/vmr-build.yml index a30f03635..515ab8dac 100644 --- a/eng/pipelines/templates/stages/vmr-build.yml +++ b/eng/pipelines/templates/stages/vmr-build.yml @@ -75,7 +75,6 @@ stages: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} container: ${{ parameters.centOSStream8Container }} - bootstrapPrep: true # ✅ buildFromArchive: false # 🚫 enablePoison: false # 🚫 excludeOmniSharpTests: true # ✅ @@ -94,7 +93,6 @@ stages: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} container: ${{ parameters.centOSStream8Container }} - bootstrapPrep: true # ✅ buildFromArchive: true # ✅ enablePoison: false # 🚫 excludeOmniSharpTests: true # ✅ @@ -112,7 +110,6 @@ stages: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} container: ${{ parameters.centOSStream9Container }} - bootstrapPrep: true # ✅ buildFromArchive: true # ✅ enablePoison: false # 🚫 excludeOmniSharpTests: false # 🚫 @@ -130,7 +127,6 @@ stages: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} container: ${{ parameters.fedora36Container }} - bootstrapPrep: true # 🚫 buildFromArchive: true # ✅ enablePoison: true # ✅ excludeOmniSharpTests: false # 🚫 @@ -148,7 +144,6 @@ stages: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} container: ${{ parameters.ubuntu2004Container }} - bootstrapPrep: true # ✅ buildFromArchive: false # 🚫 enablePoison: false # 🚫 excludeOmniSharpTests: false # 🚫 @@ -164,7 +159,6 @@ stages: architecture: arm64 pool: ${{ parameters.poolInternalArm64 }} container: ${{ parameters.debian11Arm64Container }} - bootstrapPrep: true # ✅ buildFromArchive: false # 🚫 enablePoison: false # 🚫 excludeOmniSharpTests: false # 🚫 @@ -182,7 +176,6 @@ stages: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} container: ${{ parameters.fedora36Container }} - bootstrapPrep: true # 🚫 buildFromArchive: false # 🚫 enablePoison: false # 🚫 excludeOmniSharpTests: false # 🚫 diff --git a/src/SourceBuild/content/prep.sh b/src/SourceBuild/content/prep.sh index 646d60f50..8c03cadc0 100755 --- a/src/SourceBuild/content/prep.sh +++ b/src/SourceBuild/content/prep.sh @@ -5,14 +5,10 @@ IFS=$'\n\t' SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)" usage() { - echo "usage: $0 [options]" + echo "usage: $0" echo "" echo " Prepares the environment to be built by downloading Private.SourceBuilt.Artifacts.*.tar.gz and" echo " installing the version of dotnet referenced in global.json" - echo "options:" - echo " --bootstrap Build a bootstrap version of previously source-built packages archive." - echo " This modifies the downloaded version, replacing portable packages" - echo " with official ms-built packages restored from package feeds." echo "" } @@ -28,9 +24,6 @@ while :; do usage exit 0 ;; - --bootstrap) - buildBootstrap=true - ;; *) positional_args+=("$1") ;; @@ -95,23 +88,7 @@ function DownloadArchive { fi } -# Read the eng/Versions.props to get the archives to download and download them -if [ "$downloadArtifacts" == "true" ]; then - DownloadArchive "Artifacts" $artifactsBaseFileName "true" -fi - -if [ "$downloadPrebuilts" == "true" ]; then - DownloadArchive "Prebuilts" $prebuiltsBaseFileName "false" -fi - -# Check for the version of dotnet to install -if [ "$installDotnet" == "true" ]; then - echo " Installing dotnet..." - (source ./eng/common/tools.sh && InitializeDotNetCli true) -fi - -# Build bootstrap, if specified -if [ "$buildBootstrap" == "true" ]; then +function BootstrapArtifacts { DOTNET_SDK_PATH="$SCRIPT_ROOT/.dotnet" # Create working directory for running bootstrap project @@ -136,4 +113,20 @@ if [ "$buildBootstrap" == "true" ]; then # Remove working directory rm -rf $workingDir +} + +# Check for the version of dotnet to install +if [ "$installDotnet" == "true" ]; then + echo " Installing dotnet..." + (source ./eng/common/tools.sh && InitializeDotNetCli true) +fi + +# Read the eng/Versions.props to get the archives to download and download them +if [ "$downloadArtifacts" == "true" ]; then + DownloadArchive "Artifacts" $artifactsBaseFileName "true" + BootstrapArtifacts +fi + +if [ "$downloadPrebuilts" == "true" ]; then + DownloadArchive "Prebuilts" $prebuiltsBaseFileName "false" fi