Skip to content

Commit

Permalink
Add AzDO builds for iOS (#33424)
Browse files Browse the repository at this point in the history
This is based on #33292
  • Loading branch information
directhex committed Mar 17, 2020
1 parent 91f1418 commit 65a1d2c
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 11 deletions.
2 changes: 1 addition & 1 deletion eng/codeOptimization.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
IBCMerge optimizations on Mac for now to unblock the offical build.
See issue https://github.com/dotnet/runtime/issues/33303
-->
<IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX'">false</IsEligibleForNgenOptimization>
<IsEligibleForNgenOptimization Condition="'$(TargetOS)' == 'OSX' or '$(TargetOS)' == 'iOS'">false</IsEligibleForNgenOptimization>
</PropertyGroup>

<Target Name="SetApplyNgenOptimization"
Expand Down
12 changes: 11 additions & 1 deletion eng/install-native-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@ elif [ "$1" = "OSX" ]; then
if [ "$?" != "0" ]; then
exit 1;
fi
elif [ "$1" = "iOS" ]; then
brew update
brew upgrade
if [ "$?" != "0" ]; then
exit 1;
fi
brew install openssl autoconf automake libtool pkg-config python3
if [ "$?" != "0" ]; then
exit 1;
fi
else
echo "Must pass \"Linux\" or \"OSX\" as first argument."
echo "Must pass \"Linux\", \"iOS\" or \"OSX\" as first argument."
exit 1
fi

60 changes: 60 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,66 @@ jobs:
# asArray: []
# ${{ insert }}: ${{ parameters.jobParameters }}

# iOS x64

- ${{ if or(containsValue(parameters.platforms, 'iOS_x64'), eq(parameters.platformGroup, 'all')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: iOS
archType: x64
platform: iOS_x64
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
managedTestBuildOsGroup: OSX
${{ insert }}: ${{ parameters.jobParameters }}

# iOS arm

- ${{ if or(containsValue(parameters.platforms, 'iOS_arm'), eq(parameters.platformGroup, 'all')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: iOS
archType: arm
platform: iOS_x64
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
managedTestBuildOsGroup: OSX
${{ insert }}: ${{ parameters.jobParameters }}

# iOS arm64

- ${{ if or(containsValue(parameters.platforms, 'iOS_arm64'), eq(parameters.platformGroup, 'all')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: iOS
archType: arm64
platform: iOS_x64
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
managedTestBuildOsGroup: OSX
${{ insert }}: ${{ parameters.jobParameters }}

# macOS x64

- ${{ if or(containsValue(parameters.platforms, 'OSX_x64'), eq(parameters.platformGroup, 'all')) }}:
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/common/xplat-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ jobs:
${{ if eq(parameters.osGroup, 'OSX') }}:
vmImage: 'macOS-10.14'

# Public OSX Build Pool
${{ if eq(parameters.osGroup, 'iOS') }}:
vmImage: 'macOS-10.14'

# Official Build Windows Pool
${{ if and(eq(parameters.osGroup, 'Windows_NT'), ne(variables['System.TeamProject'], 'public')) }}:
name: NetCoreInternal-Pool
Expand Down
11 changes: 8 additions & 3 deletions eng/pipelines/libraries/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
- _BuildConfig: ${{ parameters.buildConfig }}

- _msbuildCommonParameters: ''
- _stripSymbolsArg: ''
# rename this variable, due to collision with build-native.proj
- _stripSymbolsArgYaml: ''
- _runtimeOSArg: ''
- _finalFrameworkArg: ''
- _buildScript: $(_buildScriptFileName)$(scriptExt)
Expand Down Expand Up @@ -70,6 +71,10 @@ jobs:
- ${{ if eq(parameters.osGroup, 'WebAssembly') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

# force a value for OS when cross-building iOS on OSX
- ${{ if eq(parameters.osGroup, 'iOS') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

- ${{ if ne(parameters.framework, '') }}:
- _finalFrameworkArg: -framework ${{ parameters.framework }}
- _extraHelixArguments: /p:BuildTargetFramework=${{ parameters.framework }}
Expand Down Expand Up @@ -107,9 +112,9 @@ jobs:
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: ./$(_buildScriptFileName)$(scriptExt)
- ${{ if eq(parameters.isOfficialBuild, 'true') }}:
- _stripSymbolsArg: -stripSymbols
- _stripSymbolsArgYaml: -stripSymbols

- _buildArguments: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_stripSymbolsArg) $(_testScopeArg) $(_warnAsErrorArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
- _buildArguments: -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_stripSymbolsArgYaml) $(_testScopeArg) $(_warnAsErrorArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
- ${{ parameters.variables }}

dependsOn:
Expand Down
13 changes: 8 additions & 5 deletions eng/pipelines/mono/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
value: /p:OutputRid=linux-musl-${{ parameters.archType }}
- name: _PortableBuild
value: true
- ${{ if eq(parameters.osGroup, 'iOS') }}:
- name: osOverride
value: -os iOS
- ${{ parameters.variables }}

steps:
Expand All @@ -75,7 +78,7 @@ jobs:
# Linux builds use docker images with dependencies preinstalled,
# 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') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'iOS') }}:
- script: sh $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
displayName: Install native dependencies
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
Expand All @@ -85,10 +88,10 @@ jobs:

# Build
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- script: ./mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci /p:MonoEnableLLVM=${{ parameters.llvm }}
- script: ./mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) $(osOverride) -ci /p:MonoEnableLLVM=${{ parameters.llvm }}
displayName: Build product
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- script: mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci /p:MonoEnableLLVM=${{ parameters.llvm }}
- script: mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) $(osOverride) -ci /p:MonoEnableLLVM=${{ parameters.llvm }}
displayName: Build product

# Publish product output directory for consumption by tests.
Expand All @@ -104,10 +107,10 @@ jobs:

# Build packages
- ${{ if and(ne(parameters.llvm, true), ne(parameters.osGroup, 'Windows_NT')) }}:
- script: ./mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci $(officialBuildIdArg) /p:MonoEnableLLVM=${{ parameters.llvm }} -pack $(OutputRidArg)
- script: ./mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) /p:MonoEnableLLVM=${{ parameters.llvm }} -pack $(OutputRidArg)
displayName: Build nupkg
- ${{ if and(ne(parameters.llvm, true), eq(parameters.osGroup, 'Windows_NT')) }}:
- script: mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) -ci $(officialBuildIdArg) /p:MonoEnableLLVM=${{ parameters.llvm }} -pack $(OutputRidArg)
- script: mono$(scriptExt) -configuration $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) /p:MonoEnableLLVM=${{ parameters.llvm }} -pack $(OutputRidArg)
displayName: Build nupkg

# Save packages using the prepare-signed-artifacts format.
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/mono/templates/xplat-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
agentOs: Ubuntu
${{ if eq(parameters.osGroup, 'FreeBSD') }}:
agentOs: FreeBSD
${{ if eq(parameters.osGroup, 'OSX') }}:
${{ if in(parameters.osGroup, 'OSX', 'iOS') }}:
agentOs: MacOS
${{ if eq(parameters.osGroup, 'Windows_NT') }}:
agentOs: Windows_NT
Expand Down
19 changes: 19 additions & 0 deletions eng/pipelines/runtime-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ stages:
runtimeFlavor: mono
buildConfig: release
platforms:
- iOS_x64
- iOS_arm
- iOS_arm64
- OSX_x64
- Linux_x64
- Linux_arm
Expand Down Expand Up @@ -104,6 +107,22 @@ stages:
isOfficialBuild: ${{ variables.isOfficialBuild }}
liveRuntimeBuildConfig: release

#
# Build libraries using live CoreLib from Mono
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- iOS_x64
- iOS_arm
- iOS_arm64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
liveRuntimeBuildConfig: release

#
# Build libraries AllConfigurations for packages
#
Expand Down
34 changes: 34 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ jobs:
runtimeFlavor: mono
buildConfig: debug
platforms:
- iOS_x64
- iOS_arm
- iOS_arm64
- OSX_x64
- Linux_x64
- Linux_arm
Expand Down Expand Up @@ -253,6 +256,9 @@ jobs:
runtimeFlavor: mono
buildConfig: release
platforms:
- iOS_x64
- iOS_arm
- iOS_arm64
- OSX_x64
- Linux_x64
- Linux_arm
Expand Down Expand Up @@ -357,6 +363,34 @@ jobs:
- Windows_NT_x64
jobParameters:
liveRuntimeBuildConfig: release

#
# Build libraries using Mono CoreLib only
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- iOS_arm
- iOS_arm64
- iOS_x64
jobParameters:
liveRuntimeBuildConfig: release

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Debug
runtimeFlavor: mono
platforms:
- iOS_arm
- iOS_arm64
- iOS_x64
jobParameters:
liveRuntimeBuildConfig: debug

#
# Libraries Build that only run when libraries is changed
#
Expand Down

0 comments on commit 65a1d2c

Please sign in to comment.