Merge branch 'main' into add-emsdk-manifest-to-sb

This commit is contained in:
Jo Shields 2023-02-01 08:25:03 -05:00 committed by GitHub
commit 173d7b5a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 51 additions and 65 deletions

View file

@ -21,7 +21,7 @@ parameters:
- name: vmrBranch - name: vmrBranch
displayName: dotnet/dotnet branch to push to displayName: dotnet/dotnet branch to push to
type: string type: string
default: $(Build.SourceBranch) default: ''
- name: disableVmrBuild - name: disableVmrBuild
displayName: Skip source-building the VMR displayName: Skip source-building the VMR
@ -48,6 +48,13 @@ variables:
- name: _InternalRuntimeDownloadArgs - name: _InternalRuntimeDownloadArgs
value: '' value: ''
- ${{ if ne(parameters.vmrBranch, '') }}:
- name: VmrBranch
value: ${{ parameters.vmrBranch }}
- ${{ else }}:
- name: VmrBranch
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
- ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNetBuilds storage account read tokens - group: DotNetBuilds storage account read tokens
- name: _InternalRuntimeDownloadArgs - name: _InternalRuntimeDownloadArgs
@ -369,7 +376,7 @@ stages:
- ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), not(parameters.disableVmrBuild)) }}: - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), not(parameters.disableVmrBuild)) }}:
- template: eng/pipelines/templates/stages/vmr-build.yml - template: eng/pipelines/templates/stages/vmr-build.yml
parameters: parameters:
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
isBuiltFromVmr: false isBuiltFromVmr: false
# In case the VMR Build stage is temporarily disabled, the VMR synchronization step is run to validate # In case the VMR Build stage is temporarily disabled, the VMR synchronization step is run to validate
@ -381,7 +388,7 @@ stages:
jobs: jobs:
- template: eng/pipelines/templates/jobs/vmr-synchronization.yml - template: eng/pipelines/templates/jobs/vmr-synchronization.yml
parameters: parameters:
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- stage: Publish - stage: Publish

View file

@ -94,8 +94,6 @@ Further instructions on how to build inside of the Codespace will be available u
./prep.sh ./prep.sh
``` ```
On arm64, please use `./prep.sh --bootstrap` instead.
3. Build the .NET SDK 3. Build the .NET SDK
```bash ```bash

View file

@ -45,9 +45,6 @@ parameters:
- name: excludeOmniSharpTests - name: excludeOmniSharpTests
type: boolean type: boolean
- name: bootstrapPrep
type: boolean
- name: enablePoison - name: enablePoison
type: boolean type: boolean
@ -154,12 +151,7 @@ jobs:
set -x set -x
if [[ -z '${{ parameters.reuseBuildArtifactsFrom }}' ]]; then if [[ -z '${{ parameters.reuseBuildArtifactsFrom }}' ]]; then
customPrepArgs= docker run --rm -v "$(sourcesPath):/vmr" -w /vmr ${{ parameters.container }} ./prep.sh
if [[ '${{ parameters.bootstrapPrep }}' == 'True' ]]; then
customPrepArgs='--bootstrap'
fi
docker run --rm -v "$(sourcesPath):/vmr" -w /vmr ${{ parameters.container }} ./prep.sh ${customPrepArgs}
else else
mkdir $(sourcesPath)/.dotnet mkdir $(sourcesPath)/.dotnet
previousSdkPath="$(sourcesPath)/packages/archive/dotnet-sdk-*.tar.gz" previousSdkPath="$(sourcesPath)/packages/archive/dotnet-sdk-*.tar.gz"

View file

@ -25,8 +25,6 @@ jobs:
- template: /eng/common/templates/variables/pool-providers.yml - template: /eng/common/templates/variables/pool-providers.yml
- name: vmrPath - name: vmrPath
value: $(Agent.BuildDirectory)/vmr value: $(Agent.BuildDirectory)/vmr
- name: vmrBranchName
value: ${{ replace(parameters.vmrBranch, 'refs/heads/', '') }}
- ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNetBot-GitHub - group: DotNetBot-GitHub
- ${{ else }}: - ${{ else }}:
@ -61,9 +59,9 @@ jobs:
git config --global user.email 'dotnet-maestro[bot]@users.noreply.github.com' && git config --global user.name 'dotnet-maestro[bot]' git config --global user.email 'dotnet-maestro[bot]@users.noreply.github.com' && git config --global user.name 'dotnet-maestro[bot]'
git remote add dotnet 'https://$(BotAccount-dotnet-bot-repo-PAT)@github.com/dotnet/dotnet.git' git remote add dotnet 'https://$(BotAccount-dotnet-bot-repo-PAT)@github.com/dotnet/dotnet.git'
git fetch dotnet git fetch dotnet
git branch $(vmrBranchName) git branch ${{ parameters.vmrBranch }}
git branch --set-upstream-to=dotnet/$(vmrBranchName) $(vmrBranchName) || echo 'Branch $(vmrBranchName) not found in remote' git branch --set-upstream-to=dotnet/${{ parameters.vmrBranch }} ${{ parameters.vmrBranch }} || echo 'Branch ${{ parameters.vmrBranch }} not found in remote'
git push dotnet $(vmrBranchName) git push dotnet ${{ parameters.vmrBranch }}
displayName: Push changes to dotnet/dotnet displayName: Push changes to dotnet/dotnet
workingDirectory: $(vmrPath) workingDirectory: $(vmrPath)
condition: and(succeeded(), or(eq(variables['vmrBranchName'], 'main'), startsWith(variables['vmrBranchName'], 'release/'))) condition: and(succeeded(), or(eq(variables['vmrBranch'], 'main'), startsWith(variables['vmrBranch'], 'release/')))

View file

@ -57,18 +57,24 @@ stages:
- name: defaultPoolDemands - name: defaultPoolDemands
value: ${{ parameters.poolInternalAmd64.demands }} value: ${{ parameters.poolInternalAmd64.demands }}
- ${{ if ne(parameters.vmrBranch, '') }}:
- name: VmrBranch
value: ${{ parameters.vmrBranch }}
- ${{ else }}:
- name: VmrBranch
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
jobs: jobs:
- template: ../jobs/vmr-build.yml - template: ../jobs/vmr-build.yml
parameters: parameters:
buildName: CentOSStream8_Online buildName: CentOSStream8_Online
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: x64 architecture: x64
pool: pool:
name: ${{ variables.defaultPoolName }} name: ${{ variables.defaultPoolName }}
demands: ${{ variables.defaultPoolDemands }} demands: ${{ variables.defaultPoolDemands }}
container: ${{ parameters.centOSStream8Container }} container: ${{ parameters.centOSStream8Container }}
bootstrapPrep: true # ✅
buildFromArchive: false # 🚫 buildFromArchive: false # 🚫
enablePoison: false # 🚫 enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅ excludeOmniSharpTests: true # ✅
@ -81,13 +87,12 @@ stages:
parameters: parameters:
buildName: CentOSStream8_Offline buildName: CentOSStream8_Offline
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: x64 architecture: x64
pool: pool:
name: ${{ variables.defaultPoolName }} name: ${{ variables.defaultPoolName }}
demands: ${{ variables.defaultPoolDemands }} demands: ${{ variables.defaultPoolDemands }}
container: ${{ parameters.centOSStream8Container }} container: ${{ parameters.centOSStream8Container }}
bootstrapPrep: true # ✅
buildFromArchive: true # ✅ buildFromArchive: true # ✅
enablePoison: false # 🚫 enablePoison: false # 🚫
excludeOmniSharpTests: true # ✅ excludeOmniSharpTests: true # ✅
@ -99,13 +104,12 @@ stages:
parameters: parameters:
buildName: CentOSStream9_Offline buildName: CentOSStream9_Offline
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: x64 architecture: x64
pool: pool:
name: ${{ variables.defaultPoolName }} name: ${{ variables.defaultPoolName }}
demands: ${{ variables.defaultPoolDemands }} demands: ${{ variables.defaultPoolDemands }}
container: ${{ parameters.centOSStream9Container }} container: ${{ parameters.centOSStream9Container }}
bootstrapPrep: true # ✅
buildFromArchive: true # ✅ buildFromArchive: true # ✅
enablePoison: false # 🚫 enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫 excludeOmniSharpTests: false # 🚫
@ -117,13 +121,12 @@ stages:
parameters: parameters:
buildName: Fedora36_Offline buildName: Fedora36_Offline
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: x64 architecture: x64
pool: pool:
name: ${{ variables.defaultPoolName }} name: ${{ variables.defaultPoolName }}
demands: ${{ variables.defaultPoolDemands }} demands: ${{ variables.defaultPoolDemands }}
container: ${{ parameters.fedora36Container }} container: ${{ parameters.fedora36Container }}
bootstrapPrep: true # 🚫
buildFromArchive: true # ✅ buildFromArchive: true # ✅
enablePoison: true # ✅ enablePoison: true # ✅
excludeOmniSharpTests: false # 🚫 excludeOmniSharpTests: false # 🚫
@ -135,13 +138,12 @@ stages:
parameters: parameters:
buildName: Ubuntu2004_Offline buildName: Ubuntu2004_Offline
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: x64 architecture: x64
pool: pool:
name: ${{ variables.defaultPoolName }} name: ${{ variables.defaultPoolName }}
demands: ${{ variables.defaultPoolDemands }} demands: ${{ variables.defaultPoolDemands }}
container: ${{ parameters.ubuntu2004Container }} container: ${{ parameters.ubuntu2004Container }}
bootstrapPrep: true # ✅
buildFromArchive: false # 🚫 buildFromArchive: false # 🚫
enablePoison: false # 🚫 enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫 excludeOmniSharpTests: false # 🚫
@ -153,11 +155,10 @@ stages:
parameters: parameters:
buildName: Debian11_Offline buildName: Debian11_Offline
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: arm64 architecture: arm64
pool: ${{ parameters.poolInternalArm64 }} pool: ${{ parameters.poolInternalArm64 }}
container: ${{ parameters.debian11Arm64Container }} container: ${{ parameters.debian11Arm64Container }}
bootstrapPrep: true # ✅
buildFromArchive: false # 🚫 buildFromArchive: false # 🚫
enablePoison: false # 🚫 enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫 excludeOmniSharpTests: false # 🚫
@ -169,13 +170,12 @@ stages:
parameters: parameters:
buildName: Fedora36_Offline_Using_Previous buildName: Fedora36_Offline_Using_Previous
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ parameters.vmrBranch }} vmrBranch: ${{ variables.VmrBranch }}
architecture: x64 architecture: x64
pool: pool:
name: ${{ variables.defaultPoolName }} name: ${{ variables.defaultPoolName }}
demands: ${{ variables.defaultPoolDemands }} demands: ${{ variables.defaultPoolDemands }}
container: ${{ parameters.fedora36Container }} container: ${{ parameters.fedora36Container }}
bootstrapPrep: true # 🚫
buildFromArchive: false # 🚫 buildFromArchive: false # 🚫
enablePoison: false # 🚫 enablePoison: false # 🚫
excludeOmniSharpTests: false # 🚫 excludeOmniSharpTests: false # 🚫

View file

@ -30,8 +30,7 @@ steps:
- ${{ if or(not(parameters.isBuiltFromVmr), eq(variables['System.TeamProject'], 'internal')) }}: - ${{ if or(not(parameters.isBuiltFromVmr), eq(variables['System.TeamProject'], 'internal')) }}:
- script: | - script: |
branch_name=$(echo '${{ parameters.vmrBranch }}' | sed -e "s#^/refs/heads/##") git switch -c ${{ parameters.vmrBranch }}
git switch -c "$branch_name"
displayName: Checkout ${{ parameters.vmrBranch }} displayName: Checkout ${{ parameters.vmrBranch }}
workingDirectory: $(Agent.BuildDirectory)/vmr workingDirectory: $(Agent.BuildDirectory)/vmr

View file

@ -23,9 +23,8 @@ steps:
path: installer path: installer
- script: | - script: |
branch_name=$(echo '${{ parameters.vmrBranch }}' | sed -e "s#^/refs/heads/##") git checkout -B ${{ parameters.vmrBranch }}
git checkout -B "$branch_name" echo "##vso[task.setvariable variable=vmrBranch]${{ parameters.vmrBranch }}"
echo "##vso[task.setvariable variable=vmrBranch]$branch_name"
displayName: Prepare branch ${{ parameters.vmrBranch }} displayName: Prepare branch ${{ parameters.vmrBranch }}
workingDirectory: ${{ parameters.vmrPath }} workingDirectory: ${{ parameters.vmrPath }}
@ -33,7 +32,7 @@ steps:
./eng/vmr-sync.sh ./eng/vmr-sync.sh
--vmr ${{ parameters.vmrPath }} --vmr ${{ parameters.vmrPath }}
--tmp $(Agent.TempDirectory) --tmp $(Agent.TempDirectory)
--branch $(echo '${{ parameters.vmrBranch }}' | sed -e "s#^/refs/heads/##") --branch ${{ parameters.vmrBranch }}
--target-ref ${{ parameters.targetRef }} --target-ref ${{ parameters.targetRef }}
displayName: Synchronize dotnet/dotnet displayName: Synchronize dotnet/dotnet
workingDirectory: $(Agent.BuildDirectory)/installer workingDirectory: $(Agent.BuildDirectory)/installer

View file

@ -5,14 +5,10 @@ IFS=$'\n\t'
SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)" SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)"
usage() { usage() {
echo "usage: $0 [options]" echo "usage: $0"
echo "" echo ""
echo " Prepares the environment to be built by downloading Private.SourceBuilt.Artifacts.*.tar.gz and" 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 " 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 "" echo ""
} }
@ -28,9 +24,6 @@ while :; do
usage usage
exit 0 exit 0
;; ;;
--bootstrap)
buildBootstrap=true
;;
*) *)
positional_args+=("$1") positional_args+=("$1")
;; ;;
@ -95,23 +88,7 @@ function DownloadArchive {
fi fi
} }
# Read the eng/Versions.props to get the archives to download and download them function BootstrapArtifacts {
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
DOTNET_SDK_PATH="$SCRIPT_ROOT/.dotnet" DOTNET_SDK_PATH="$SCRIPT_ROOT/.dotnet"
# Create working directory for running bootstrap project # Create working directory for running bootstrap project
@ -136,4 +113,20 @@ if [ "$buildBootstrap" == "true" ]; then
# Remove working directory # Remove working directory
rm -rf $workingDir 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 fi