#!/usr/bin/env bash
+# This is a simple script primarily used for CI to install necessary dependencies
+#
+# For CI typical usage is
+#
+# ./install-native-dependencies.sh <OS> <arch> 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 <OS>
+
+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
+
if [ "$1" = "Linux" ]; then
sudo apt update
if [ "$?" != "0" ]; then
# 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')) }}:
- 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 }} azDO
displayName: Install Build Dependencies
- script: |
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 }}
+ helixQueueGroup: ${{ parameters.helixQueueGroup }}
+ ${{ insert }}: ${{ parameters.jobParameters }}
+
# macOS x64
- ${{ if or(containsValue(parameters.platforms, 'OSX_x64'), eq(parameters.platformGroup, 'all')) }}:
# 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 }} azDO
displayName: Install native dependencies
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
# Necessary to install correct cmake version
# OSX Build Pool (we don't have on-prem OSX BuildPool
${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
- vmImage: 'macOS-10.14'
+ vmImage: 'macOS-10.15'
${{ if eq(parameters.osGroup, 'Browser') }}:
vmImage: 'ubuntu-latest'
- Linux_musl_arm64
- Linux_musl_x64
- Linux_x64
+ - OSX_arm64
- OSX_x64
- Windows_NT_arm
- Windows_NT_arm64
- Linux_arm
- Linux_musl_arm64
- Linux_x64
+ - OSX_arm64
- OSX_x64
- Windows_NT_x86
jobParameters:
# 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 }} azDO
displayName: Install native dependencies
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
# Necessary to install python
# 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 }} azDO
displayName: Install native dependencies
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
# Necessary to install python
- 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 }}
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
/p:PortableBuild=true
/p:SkipTests=$(SkipTests)
/p:RuntimeFlavor=${{ parameters.runtimeFlavor }}
+ /p:TargetArchitecture=${{ parameters.archType }}
+ /p:CrossBuild=${{ eq(parameters.archType, 'arm64') }}
$(llvmParameter)
- name: BaseJobBuildCommand
$(Build.SourcesDirectory)/build.sh -ci
$(BuildAction)
-configuration $(_BuildConfig)
+ -arch ${{ parameters.archType }}
$(LiveOverridePathArgs)
$(CommonMSBuildArgs)
$(OfficialBuildArg)
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 }} azDO
displayName: Install Build Dependencies
- script: |
- _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
- 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 }} azDO
displayName: Install Build Dependencies
- script: |
- Linux_arm64
- Linux_musl_arm64
- ${{ if eq(variables['includeOsxOuterloop'], true) }}:
+ - OSX_arm64
- OSX_x64
jobParameters:
testGroup: innerloop
- 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:
- Linux_x64
- Linux_musl_x64
- ${{ if eq(variables['includeOsxOuterloop'], true) }}:
+ - OSX_arm64
- OSX_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isFullMatrix: ${{ variables['isFullMatrix'] }}
framework: net48
runTests: true
- testScope: outerloop
\ No newline at end of file
+ testScope: outerloop
# 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 }} azDO
displayName: Install native dependencies
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
# Necessary to install python
jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml
buildConfig: release
platforms:
+ - OSX_arm64
- OSX_x64
- Linux_x64
- Linux_arm
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
platforms:
+ - OSX_arm64
- OSX_x64
- Linux_x64
- Linux_arm
useOfficialAllConfigurations: true
buildFullPlatformManifest: true
platforms:
+ - OSX_arm64
- OSX_x64
- Linux_x64
- Linux_arm
- Linux_musl_arm
- Linux_musl_arm64
- Linux_musl_x64
+ - OSX_arm64
- Windows_NT_x86
- Windows_NT_x64
- Windows_NT_arm
jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml
buildConfig: release
platforms:
+ - OSX_arm64
- OSX_x64
- Linux_x64
- Linux_arm
- Linux_arm64
- Linux_musl_x64
- Linux_x64
+ - OSX_arm64
- OSX_x64
- Windows_NT_x64
- FreeBSD_x64
parameters:
buildConfig: Release
platforms:
+ - OSX_arm64
- OSX_x64
- Linux_x64
- Linux_arm64