From 20aac13cab9053dbf8be98452c777fd7745a60c8 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 8 Oct 2020 16:45:10 -0400 Subject: [PATCH 1/6] Enable building .NET Core osx-arm64 in CI --- eng/pipelines/common/platform-matrix.yml | 24 ++++++++++++++++++++++++ eng/pipelines/common/xplat-setup.yml | 6 ++++-- eng/pipelines/coreclr/ci.yml | 2 ++ eng/pipelines/libraries/outerloop.yml | 5 ++++- eng/pipelines/runtime-official.yml | 3 +++ eng/pipelines/runtime.yml | 4 ++++ 6 files changed, 41 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 44d52cbadf9b34..06eaef7e1b54cc 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -445,6 +445,30 @@ jobs: helixQueueGroup: ${{ parameters.helixQueueGroup }} ${{ insert }}: ${{ parameters.jobParameters }} +# macOS arm64 + +- ${{ if or(containsValue(parameters.platforms, 'OSX_arm64'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: OSX + archType: arm64 + targetRid: osx-arm64 + platform: OSX_arm64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ if eq(parameters.passPlatforms, true) }}: + platforms: ${{ parameters.platforms }} + # osx-arm64 is a cross build, but it doesn't require a ROOT_FS + # Use an identifiable value instead of creating and passing a separate parameter + crossrootfsDir: ':CrossBuildNoRootFS:' + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + # macOS x64 - ${{ if or(containsValue(parameters.platforms, 'OSX_x64'), eq(parameters.platformGroup, 'all')) }}: diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index 0a3d6cd6b753d7..437dd4e48d9a43 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -76,7 +76,7 @@ jobs: - name: setScriptToEchoAndFailOnNonZero value: 'set -xe' - - ${{ if ne(parameters.jobParameters.crossrootfsDir, '') }}: + - ${{ if not(in(parameters.jobParameters.crossrootfsDir, '', ':CrossBuildNoRootFS:')) }}: # This is only required for cross builds. - name: ROOTFS_DIR value: ${{ parameters.jobParameters.crossrootfsDir }} @@ -115,8 +115,10 @@ jobs: queue: BuildPool.Ubuntu.1604.Amd64 # OSX Build Pool (we don't have on-prem OSX BuildPool - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: + ${{ if and(in(parameters.osGroup, 'OSX', 'iOS', 'tvOS'), ne(parameters.archType, 'arm64')) }}: vmImage: 'macOS-10.14' + ${{ if and(in(parameters.osGroup, 'OSX', 'iOS', 'tvOS'), eq(parameters.archType, 'arm64')) }}: + vmImage: 'macOS-10.15' ${{ if eq(parameters.osGroup, 'Browser') }}: vmImage: 'ubuntu-latest' diff --git a/eng/pipelines/coreclr/ci.yml b/eng/pipelines/coreclr/ci.yml index e7ef3ab1a4d4d9..9059f11855b421 100644 --- a/eng/pipelines/coreclr/ci.yml +++ b/eng/pipelines/coreclr/ci.yml @@ -44,6 +44,7 @@ jobs: - Linux_musl_arm64 - Linux_musl_x64 - Linux_x64 + - OSX_arm64 - OSX_x64 - Windows_NT_arm - Windows_NT_arm64 @@ -72,6 +73,7 @@ jobs: - Linux_arm - Linux_musl_arm64 - Linux_x64 + - OSX_arm64 - OSX_x64 - Windows_NT_x86 jobParameters: diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml index d88481ea37dd4b..5e7615103e22b0 100644 --- a/eng/pipelines/libraries/outerloop.yml +++ b/eng/pipelines/libraries/outerloop.yml @@ -33,6 +33,7 @@ jobs: - Linux_arm64 - Linux_musl_arm64 - ${{ if eq(variables['includeOsxOuterloop'], true) }}: + - OSX_arm64 - OSX_x64 jobParameters: testGroup: innerloop @@ -56,6 +57,7 @@ jobs: - Linux_musl_x64 - Linux_musl_arm64 - ${{ if and(eq(variables['includeOsxOuterloop'], true), eq(variables['isFullMatrix'], true)) }}: + - OSX_arm64 - OSX_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: @@ -77,6 +79,7 @@ jobs: - Linux_x64 - Linux_musl_x64 - ${{ if eq(variables['includeOsxOuterloop'], true) }}: + - OSX_arm64 - OSX_x64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: @@ -101,4 +104,4 @@ jobs: isFullMatrix: ${{ variables['isFullMatrix'] }} framework: net48 runTests: true - testScope: outerloop \ No newline at end of file + testScope: outerloop diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 3deef33444c41f..80141273f93c05 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -49,6 +49,7 @@ stages: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm @@ -172,6 +173,7 @@ stages: jobTemplate: /eng/pipelines/libraries/build-job.yml buildConfig: Release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm @@ -214,6 +216,7 @@ stages: useOfficialAllConfigurations: true buildFullPlatformManifest: true platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index e953d209a6ee3b..3fc54c129d4d44 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -143,6 +143,7 @@ jobs: - Linux_musl_arm - Linux_musl_arm64 - Linux_musl_x64 + - OSX_arm64 - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm @@ -201,6 +202,7 @@ jobs: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm @@ -619,6 +621,7 @@ jobs: - Linux_arm64 - Linux_musl_x64 - Linux_x64 + - OSX_arm64 - OSX_x64 - Windows_NT_x64 - FreeBSD_x64 @@ -705,6 +708,7 @@ jobs: parameters: buildConfig: Release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm64 From 2e72c12d7f1f2b7644e98cdba6ed7569a9eb4cbb Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 8 Oct 2020 17:35:49 -0400 Subject: [PATCH 2/6] For osx-arm64 xcode-select xcode_12.2 --- eng/install-native-dependencies.sh | 5 +++++ eng/pipelines/common/global-build-job.yml | 2 +- eng/pipelines/common/templates/runtimes/build-test-job.yml | 2 +- eng/pipelines/coreclr/templates/build-jit-job.yml | 2 +- eng/pipelines/coreclr/templates/build-job.yml | 2 +- eng/pipelines/installer/jobs/base-job.yml | 2 +- eng/pipelines/libraries/build-job.yml | 2 +- eng/pipelines/mono/templates/build-job.yml | 2 +- 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index e8ab193c2d51b0..981277d7d6344b 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if [ "$1" = "OSX" ] && [ "$2" = "arm64" ]; then + # Cross compilation for osx-arm64 requires xcode 12.2 or greater + sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer +fi + if [ "$1" = "Linux" ]; then sudo apt update if [ "$?" != "0" ]; then diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 868ba2f4ad51b3..102f9d13e8b7fc 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -65,7 +65,7 @@ jobs: - template: /eng/pipelines/common/restore-internal-tools.yml - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 144cc135063958..c5ce567d056264 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -87,7 +87,7 @@ jobs: # Install test build dependencies - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install correct cmake version diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml index f46a57a4475601..350ad3d0da1a43 100644 --- a/eng/pipelines/coreclr/templates/build-jit-job.yml +++ b/eng/pipelines/coreclr/templates/build-jit-job.yml @@ -80,7 +80,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 526b43afcc7f48..1ddeb32e23d8fa 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -125,7 +125,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index d5dde2ef08a1d5..40db23c9c334fe 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -462,7 +462,7 @@ jobs: cleanUnpackFolder: false - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index 820247b1cc2136..7a6bdd0e270e5b 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -77,7 +77,7 @@ jobs: - template: /eng/pipelines/common/restore-internal-tools.yml - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index e46ca5ee005f23..aefed0d81f2c84 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -87,7 +87,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python From 2a369a5820d8758210d97bc5a2ff7535f27f5588 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 8 Oct 2020 19:22:40 -0400 Subject: [PATCH 3/6] Use vmImage macOS-10.15 for all platforms --- eng/pipelines/common/xplat-setup.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index 437dd4e48d9a43..dc4a169336afc3 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -115,9 +115,7 @@ jobs: queue: BuildPool.Ubuntu.1604.Amd64 # OSX Build Pool (we don't have on-prem OSX BuildPool - ${{ if and(in(parameters.osGroup, 'OSX', 'iOS', 'tvOS'), ne(parameters.archType, 'arm64')) }}: - vmImage: 'macOS-10.14' - ${{ if and(in(parameters.osGroup, 'OSX', 'iOS', 'tvOS'), eq(parameters.archType, 'arm64')) }}: + ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: vmImage: 'macOS-10.15' ${{ if eq(parameters.osGroup, 'Browser') }}: From cb674625c02e289dd4f99d08749cb2832b3d8ab5 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 8 Oct 2020 19:23:46 -0400 Subject: [PATCH 4/6] Don't use crossrootfsDir to determine if it is a crossBuild --- eng/pipelines/common/global-build-job.yml | 2 +- eng/pipelines/common/platform-matrix.yml | 3 --- eng/pipelines/common/xplat-setup.yml | 2 +- eng/pipelines/coreclr/templates/xplat-job.yml | 6 ++++-- eng/pipelines/installer/jobs/base-job.yml | 5 +++-- eng/pipelines/libraries/base-job.yml | 6 +++++- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 102f9d13e8b7fc..a84d4021d083aa 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -41,7 +41,7 @@ jobs: # Do not rename as it clashes with MSBuild property in libraries/build-native.proj - name: _crossBuildPropertyArg - value: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} + value: /p:CrossBuild=${{ or(ne(parameters.crossrootfsDir, ''), and(eq(parameters.osGroup, 'OSX'), eq(parameters.archType, 'arm64'))) }} - name: _cxx11Parameter ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.archType, 'arm64')) }}: diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 06eaef7e1b54cc..a4ed15af97e22a 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -463,9 +463,6 @@ jobs: buildConfig: ${{ parameters.buildConfig }} ${{ if eq(parameters.passPlatforms, true) }}: platforms: ${{ parameters.platforms }} - # osx-arm64 is a cross build, but it doesn't require a ROOT_FS - # Use an identifiable value instead of creating and passing a separate parameter - crossrootfsDir: ':CrossBuildNoRootFS:' helixQueueGroup: ${{ parameters.helixQueueGroup }} ${{ insert }}: ${{ parameters.jobParameters }} diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index dc4a169336afc3..a5720c22a0303c 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -76,7 +76,7 @@ jobs: - name: setScriptToEchoAndFailOnNonZero value: 'set -xe' - - ${{ if not(in(parameters.jobParameters.crossrootfsDir, '', ':CrossBuildNoRootFS:')) }}: + - ${{ if ne(parameters.jobParameters.crossrootfsDir, '') }}: # This is only required for cross builds. - name: ROOTFS_DIR value: ${{ parameters.jobParameters.crossrootfsDir }} diff --git a/eng/pipelines/coreclr/templates/xplat-job.yml b/eng/pipelines/coreclr/templates/xplat-job.yml index 7f03b78d162f71..485326bfd7600f 100644 --- a/eng/pipelines/coreclr/templates/xplat-job.yml +++ b/eng/pipelines/coreclr/templates/xplat-job.yml @@ -91,12 +91,14 @@ jobs: - name: _HelixSource value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: crossArg + value: '' - ${{ if ne(parameters.crossrootfsDir, '') }}: - name: crossArg value: '-cross' - - ${{ if eq(parameters.crossrootfsDir, '') }}: + - ${{ if and(eq(parameters.osGroup, 'OSX'), eq(parameters.archType, 'arm64')) }}: - name: crossArg - value: '' + value: '-cross' - ${{ each variable in parameters.variables }}: - ${{insert}}: ${{ variable }} diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index 40db23c9c334fe..3ae3a38844c243 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -67,7 +67,8 @@ jobs: not(in(parameters.archType, 'x64', 'x86')), eq(parameters.runtimeFlavor, 'mono'), eq(parameters.isOfficialBuild, true), - ne(parameters.crossrootfsDir, '')) }} + ne(parameters.crossrootfsDir, ''), + and(eq(parameters.osGroup, 'OSX'), eq(parameters.archType, 'arm64'))) }} - name: BuildAction value: -test @@ -215,7 +216,7 @@ jobs: value: >- -subset installer -ci $(BuildAction) - /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} + /p:CrossBuild=${{ or(ne(parameters.crossrootfsDir, ''), and(eq(parameters.osGroup, 'OSX'), eq(parameters.archType, 'arm64'))) }} /p:PortableBuild=$(_PortableBuild) /p:SkipTests=$(SkipTests) $(LiveOverridePathArgs) diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index 3da0d03360919d..dd4864bd96b92f 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -57,7 +57,11 @@ jobs: - _testScopeArg: -testscope ${{ parameters.testScope }} - ${{ if in(parameters.osGroup, 'Linux', 'FreeBSD') }}: - - _crossBuildPropertyArg: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} + - _crossBuildPropertyArg: /p:CrossBuild=${{ or(ne(parameters.crossrootfsDir, ''), and(eq(parameters.osGroup, 'OSX'), eq(parameters.archType, 'arm64'))) }} + + - ${{ if eq(parameters.osGroup, 'OSX') }}: + # OSX is currently building on x64, anything else is a cross build + - _crossBuildPropertyArg: /p:CrossBuild=${{ ne(parameters.archType, 'x64') }} - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, '_musl')) }}: - _runtimeOSArg: /p:RuntimeOS=linux-musl From 2a4df7ffdc51902138b7a9793ad586cbb22dc9b4 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Thu, 8 Oct 2020 19:52:26 -0400 Subject: [PATCH 5/6] Fix osx-arm64 installer builds --- eng/pipelines/installer/jobs/base-job.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index 3ae3a38844c243..ddae590c2b3347 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -131,6 +131,8 @@ jobs: /p:PortableBuild=true /p:SkipTests=$(SkipTests) /p:RuntimeFlavor=${{ parameters.runtimeFlavor }} + /p:TargetArchitecture=${{ parameters.archType }} + /p:CrossBuild=${{ eq(parameters.archType, 'arm64') }} $(llvmParameter) - name: BaseJobBuildCommand @@ -138,6 +140,7 @@ jobs: $(Build.SourcesDirectory)/build.sh -ci $(BuildAction) -configuration $(_BuildConfig) + -arch ${{ parameters.archType }} $(LiveOverridePathArgs) $(CommonMSBuildArgs) $(OfficialBuildArg) @@ -216,7 +219,7 @@ jobs: value: >- -subset installer -ci $(BuildAction) - /p:CrossBuild=${{ or(ne(parameters.crossrootfsDir, ''), and(eq(parameters.osGroup, 'OSX'), eq(parameters.archType, 'arm64'))) }} + /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} /p:PortableBuild=$(_PortableBuild) /p:SkipTests=$(SkipTests) $(LiveOverridePathArgs) From 306715023650d75cb3b76446e2b0e4c7152fe160 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Fri, 9 Oct 2020 14:18:52 -0400 Subject: [PATCH 6/6] Allow dev use of eng/install-native-dependencies.sh --- eng/install-native-dependencies.sh | 16 +++++++++++++++- eng/pipelines/common/global-build-job.yml | 2 +- .../common/templates/runtimes/build-test-job.yml | 2 +- .../coreclr/templates/build-jit-job.yml | 2 +- eng/pipelines/coreclr/templates/build-job.yml | 2 +- eng/pipelines/installer/jobs/base-job.yml | 2 +- eng/pipelines/libraries/build-job.yml | 2 +- eng/pipelines/mono/templates/build-job.yml | 2 +- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index 981277d7d6344b..31a61e9989185b 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -1,6 +1,20 @@ #!/usr/bin/env bash -if [ "$1" = "OSX" ] && [ "$2" = "arm64" ]; then +# This is a simple script primarily used for CI to install necessary dependencies +# +# For CI typical usage is +# +# ./install-native-dependencies.sh azDO +# +# For developer use it is not recommended to include the azDO final argument as that +# makes installation and configuration setting only required for azDO +# +# So simple developer usage would currently be +# +# ./install-native-dependencies.sh + +if [ "$1" = "OSX" ] && [ "$2" = "arm64" ] && [ "$3" = "azDO" ]; then + # On AzDO macOS-10.15 build agents the Xcode currently defaults to Xcode 11.7 # Cross compilation for osx-arm64 requires xcode 12.2 or greater sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer fi diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index a84d4021d083aa..502af4fe0a735f 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -65,7 +65,7 @@ jobs: - template: /eng/pipelines/common/restore-internal-tools.yml - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index c5ce567d056264..a658bba42fa982 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -87,7 +87,7 @@ jobs: # Install test build dependencies - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install correct cmake version diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml index 350ad3d0da1a43..34efd80fe13ef4 100644 --- a/eng/pipelines/coreclr/templates/build-jit-job.yml +++ b/eng/pipelines/coreclr/templates/build-jit-job.yml @@ -80,7 +80,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 1ddeb32e23d8fa..30e89d4afe3c69 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -125,7 +125,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index ddae590c2b3347..fd93da9d94a7f5 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -466,7 +466,7 @@ jobs: cleanUnpackFolder: false - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index 7a6bdd0e270e5b..02e1d87bca17bc 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -77,7 +77,7 @@ jobs: - template: /eng/pipelines/common/restore-internal-tools.yml - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO displayName: Install Build Dependencies - script: | diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index aefed0d81f2c84..02bcd0c61e578b 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -87,7 +87,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python