Skip to content

Commit 797dc08

Browse files
authored
Collapse mono runtime pack builds in official build (#37511)
* Collapse mono runtime pack builds in official build * Minor cleanups
1 parent a021db0 commit 797dc08

File tree

6 files changed

+66
-133
lines changed

6 files changed

+66
-133
lines changed

eng/pipelines/common/global-build-job.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ parameters:
66
osGroup: ''
77
osSubgroup: ''
88
container: ''
9+
crossrootfsDir: ''
910
variables: {}
1011
timeoutInMinutes: ''
1112
pool: ''
1213
condition: true
14+
isOfficialBuild: false
1315
extraStepsTemplate: ''
1416
extraStepsParameters: {}
1517

@@ -34,11 +36,24 @@ jobs:
3436
- name: _osParameter
3537
value: /p:RuntimeOS=linux-musl /p:OutputRid=linux-musl-${{ parameters.archType }}
3638

39+
# Do not rename as it clashes with MSBuild property in libraries/build-native.proj
40+
- name: _crossBuildPropertyArg
41+
value: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }}
42+
43+
- name: _officialBuildParameter
44+
$ {{ if eq(parameters.isOfficialBuild, true) }}:
45+
value: /p:OfficialBuildId=$(Build.BuildNumber)
46+
$ {{ if ne(parameters.isOfficialBuild, true) }}:
47+
value: ''
48+
3749
- ${{ parameters.variables }}
3850

3951
steps:
4052
- template: /eng/pipelines/common/clone-checkout-bundle-step.yml
4153

54+
- ${{ if eq(parameters.isOfficialBuild, true) }}:
55+
- template: /eng/pipelines/common/restore-internal-tools.yml
56+
4257
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
4358
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }}
4459
displayName: Install Build Dependencies
@@ -49,7 +64,7 @@ jobs:
4964
displayName: Disk Usage before Build
5065
5166
# Build
52-
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }}
67+
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg)
5368
displayName: Build product
5469

5570
- ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
@@ -58,15 +73,6 @@ jobs:
5873
df -h
5974
displayName: Disk Usage after Build
6075
61-
- task: PublishBuildArtifacts@1
62-
displayName: Publish Logs
63-
inputs:
64-
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/'
65-
PublishLocation: Container
66-
ArtifactName: Logs_Build_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
67-
continueOnError: true
68-
condition: always()
69-
7076
# If intended to send extra steps after regular build add them here.
7177
- ${{ if ne(parameters.extraStepsTemplate, '') }}:
7278
- template: ${{ parameters.extraStepsTemplate }}
@@ -76,3 +82,12 @@ jobs:
7682
archType: ${{ parameters.archType }}
7783
buildConfig: ${{ parameters.buildConfig }}
7884
${{ insert }}: ${{ parameters.extraStepsParameters }}
85+
86+
- task: PublishBuildArtifacts@1
87+
displayName: Publish Logs
88+
inputs:
89+
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/'
90+
PublishLocation: Container
91+
ArtifactName: Logs_Build_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
92+
continueOnError: true
93+
condition: always()

eng/pipelines/common/platform-matrix.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ parameters:
2727
jobs:
2828

2929
# Linux arm
30-
3130
- ${{ if or(containsValue(parameters.platforms, 'Linux_arm'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
3231
- template: xplat-setup.yml
3332
parameters:

eng/pipelines/installer/jobs/base-job.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ jobs:
7777
- name: SignType
7878
value: test
7979

80-
- ${{ if eq(parameters.runtimeVariant, 'llvmjit') }}:
81-
- name: llvmParameter
82-
value: /p:MonoEnableLLVM=true
83-
84-
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
85-
- name: llvmParameter
86-
value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true
87-
8880
# Set up non-PR build from internal project
8981
- ${{ if eq(parameters.isOfficialBuild, true) }}:
9082
- name: SignType
@@ -405,9 +397,11 @@ jobs:
405397
buildType: current
406398
downloadType: specific
407399
downloadPath: '$(Build.SourcesDirectory)/__download__/AllPlatforms/'
400+
allowPartiallySucceededBuilds: true
408401
itemPattern: |
409402
$(runtimeFlavorName)Product_*/**
410403
libraries_bin_*/**
404+
!*Logs*
411405
412406
- ${{ if eq(parameters.buildFullPlatformManifest, true) }}:
413407
- ${{ each platform in parameters.platforms }}:

eng/pipelines/runtime-official.yml

Lines changed: 36 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ stages:
6262
isOfficialBuild: ${{ variables.isOfficialBuild }}
6363

6464
#
65-
# Build Mono release
65+
# Build Mono runtime packs
6666
#
6767
- template: /eng/pipelines/common/platform-matrix.yml
6868
parameters:
69-
jobTemplate: /eng/pipelines/mono/templates/build-job.yml
70-
runtimeFlavor: mono
69+
jobTemplate: /eng/pipelines/common/global-build-job.yml
7170
buildConfig: release
71+
runtimeFlavor: mono
7272
platforms:
7373
- Android_x64
7474
- Android_x86
@@ -92,36 +92,18 @@ stages:
9292
# - Windows_NT_arm
9393
# - Windows_NT_arm64
9494
jobParameters:
95+
buildArgs: -s mono+libs+installer -c $(_BuildConfig)
96+
nameSuffix: AllSubsets_Mono
9597
isOfficialBuild: ${{ variables.isOfficialBuild }}
98+
extraStepsTemplate: /eng/pipelines/common/upload-unsigned-artifacts-step.yml
99+
extraStepsParameters:
100+
name: MonoRuntimePacks
96101

97102
#
98-
# Build Mono LLVM release
103+
# Build Mono LLVM runtime packs
99104
#
100-
- template: /eng/pipelines/common/platform-matrix.yml
105+
- template: /eng/pipelines/common/platform-matrix-multijob.yml
101106
parameters:
102-
jobTemplate: /eng/pipelines/mono/templates/build-job.yml
103-
runtimeFlavor: mono
104-
buildConfig: release
105-
platforms:
106-
- OSX_x64
107-
- Linux_x64
108-
# - Linux_arm
109-
# - Linux_arm64
110-
# - Linux_musl_x64
111-
# - Linux_musl_arm64
112-
# - Windows_NT_x64
113-
# - Windows_NT_x86
114-
# - Windows_NT_arm
115-
# - Windows_NT_arm64
116-
jobParameters:
117-
runtimeVariant: LLVMJIT
118-
isOfficialBuild: ${{ variables.isOfficialBuild }}
119-
120-
- template: /eng/pipelines/common/platform-matrix.yml
121-
parameters:
122-
jobTemplate: /eng/pipelines/mono/templates/build-job.yml
123-
runtimeFlavor: mono
124-
buildConfig: release
125107
platforms:
126108
- OSX_x64
127109
- Linux_x64
@@ -133,9 +115,32 @@ stages:
133115
# - Windows_NT_x86
134116
# - Windows_NT_arm
135117
# - Windows_NT_arm64
136-
jobParameters:
137-
runtimeVariant: LLVMAOT
138-
isOfficialBuild: ${{ variables.isOfficialBuild }}
118+
jobTemplates:
119+
# LLVMJIT
120+
- jobTemplate: /eng/pipelines/common/global-build-job.yml
121+
buildConfig: release
122+
runtimeFlavor: mono
123+
jobParameters:
124+
buildArgs: -s mono+libs+installer -c $(_BuildConfig) /p:MonoEnableLLVM=true
125+
nameSuffix: AllSubsets_Mono_LLVMJIT
126+
runtimeVariant: LLVMJIT
127+
isOfficialBuild: ${{ variables.isOfficialBuild }}
128+
extraStepsTemplate: /eng/pipelines/common/upload-unsigned-artifacts-step.yml
129+
extraStepsParameters:
130+
name: MonoRuntimePacks
131+
#LLVMAOT
132+
- jobTemplate: /eng/pipelines/common/global-build-job.yml
133+
buildConfig: release
134+
runtimeFlavor: mono
135+
jobParameters:
136+
buildArgs: -s mono+libs+installer -c $(_BuildConfig)
137+
/p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true
138+
nameSuffix: AllSubsets_Mono_LLVMAOT
139+
runtimeVariant: LLVMAOT
140+
isOfficialBuild: ${{ variables.isOfficialBuild }}
141+
extraStepsTemplate: /eng/pipelines/common/upload-unsigned-artifacts-step.yml
142+
extraStepsParameters:
143+
name: MonoRuntimePacks
139144

140145
#
141146
# Build libraries using live CoreLib from CoreCLR
@@ -159,30 +164,6 @@ stages:
159164
isOfficialBuild: ${{ variables.isOfficialBuild }}
160165
liveRuntimeBuildConfig: release
161166

162-
#
163-
# Build libraries using live CoreLib from Mono
164-
#
165-
- template: /eng/pipelines/common/platform-matrix.yml
166-
parameters:
167-
jobTemplate: /eng/pipelines/libraries/build-job.yml
168-
buildConfig: Release
169-
runtimeFlavor: mono
170-
platforms:
171-
- Android_x64
172-
- Android_x86
173-
- Android_arm
174-
- Android_arm64
175-
- tvOS_x64
176-
- tvOS_arm64
177-
- iOS_x64
178-
- iOS_x86
179-
- iOS_arm
180-
- iOS_arm64
181-
- Browser_wasm
182-
jobParameters:
183-
isOfficialBuild: ${{ variables.isOfficialBuild }}
184-
liveRuntimeBuildConfig: release
185-
186167
#
187168
# Build libraries AllConfigurations for packages
188169
#
@@ -221,64 +202,6 @@ stages:
221202
- Windows_NT_arm
222203
- Windows_NT_arm64
223204

224-
#
225-
# Installer Build for platforms using Mono
226-
#
227-
- template: /eng/pipelines/installer/installer-matrix.yml
228-
parameters:
229-
jobParameters:
230-
liveRuntimeBuildConfig: release
231-
liveLibrariesBuildConfig: Release
232-
isOfficialBuild: ${{ variables.isOfficialBuild }}
233-
useOfficialAllConfigurations: false
234-
buildFullPlatformManifest: false
235-
runtimeFlavor: mono
236-
platforms:
237-
- OSX_x64
238-
- Linux_x64
239-
- tvOS_x64
240-
- tvOS_arm64
241-
- iOS_arm
242-
- iOS_arm64
243-
- iOS_x64
244-
- iOS_x86
245-
- Android_arm
246-
- Android_arm64
247-
- Android_x64
248-
- Android_x86
249-
- Browser_wasm
250-
251-
#
252-
# Installer Build for platforms using Mono
253-
#
254-
- template: /eng/pipelines/installer/installer-matrix.yml
255-
parameters:
256-
jobParameters:
257-
liveRuntimeBuildConfig: release
258-
liveLibrariesBuildConfig: Release
259-
isOfficialBuild: ${{ variables.isOfficialBuild }}
260-
useOfficialAllConfigurations: false
261-
buildFullPlatformManifest: false
262-
runtimeVariant: LLVMJIT
263-
runtimeFlavor: mono
264-
platforms:
265-
- OSX_x64
266-
- Linux_x64
267-
268-
- template: /eng/pipelines/installer/installer-matrix.yml
269-
parameters:
270-
jobParameters:
271-
liveRuntimeBuildConfig: release
272-
liveLibrariesBuildConfig: Release
273-
isOfficialBuild: ${{ variables.isOfficialBuild }}
274-
useOfficialAllConfigurations: false
275-
buildFullPlatformManifest: false
276-
runtimeVariant: LLVMAOT
277-
runtimeFlavor: mono
278-
platforms:
279-
- OSX_x64
280-
- Linux_x64
281-
282205
- ${{ if eq(variables.isOfficialBuild, true) }}:
283206
- template: /eng/pipelines/official/stages/publish.yml
284207
parameters:

src/installer/pkg/projects/netcoreapp/src/netcoreapp.depproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<FrameworkPackageName>Microsoft.NETCore.App</FrameworkPackageName>
55
<BuildFullPlatformManifest>false</BuildFullPlatformManifest>
6+
<!-- Workaround for https://github.com/dotnet/runtime/issues/37503 -->
7+
<PermitDllAndExeFilesLackingFileVersion Condition="'$(OS)' == 'Windows_NT' and '$(RuntimeFlavor)' == 'Mono'">true</PermitDllAndExeFilesLackingFileVersion>
68
</PropertyGroup>
79

810
<ItemGroup>

src/libraries/pkg/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<!-- Packages opt-in to automatic RID-specific builds by placing a *.RID.props next to their project
1717
that defines the OfficialBuildRID item: all RIDs targeted by the package -->
18-
<Import Project="$(MSBuildProjectDirectory)\*.rids.props" />
18+
<Import Project="$(MSBuildProjectDirectory)\*.rids.props" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or '$(RuntimeFlavor)' != 'Mono'"/>
1919

2020
<!-- create the "BuildRID" item which is the set of all supported RIDs, with metadata.
2121
We'll add a RID for the current platform even if it isn't in the officially supported set -->

0 commit comments

Comments
 (0)