11# Copyright (c) Microsoft Corporation.
22# Licensed under the MIT License.
33
4- # Since we're boosting our builds by using a private, pre-compiled raw toolchain
5- # the pipeline requires defining the following variables outside of the YAML:
6- # - rawToolchainCacheURL_AMD64
7- # - rawToolchainCacheURL_ARM64
4+ # The "agentPool" parameter is defined in the "Agent pools (DEV)" variable group.
5+ # The "rawToolchain*" parameters are defined in the "Raw toolchain info" variable group.
86
97trigger : none
108
@@ -13,15 +11,15 @@ parameters:
1311 type : object
1412 default :
1513 - name : " AMD64"
16- agentPool : " $(DEV_AMD64_Managed)" # Pool defined inside the "Agent pools (DEV)" variable group.
14+ agentPool : " $(DEV_AMD64_Managed)"
1715 maxCPUs : " $(($(nproc) / 2))"
18- rawToolchainCacheURL : " $(rawToolchainCacheURL_AMD64 )"
19- rawToolchainExpectedHash : " f56df34b90915c93f772d3961bf5e9eeb8c1233db43dd92070214e4ce6b72894 "
16+ rawToolchainCacheURL : " $(rawToolchainCacheURL_AMD64_3.0 )"
17+ rawToolchainExpectedHash : " $(rawToolchainCacheHash_AMD64_3.0) "
2018 - name : " ARM64"
21- agentPool : " $(DEV_ARM64_Managed)" # Pool defined inside the "Agent pools (DEV)" variable group.
19+ agentPool : " $(DEV_ARM64_Managed)"
2220 maxCPUs : " $(($(nproc) / 3))"
23- rawToolchainCacheURL : " $(rawToolchainCacheURL_ARM64 )"
24- rawToolchainExpectedHash : " 65de43b3bdcfdaac71df1f11fd1f830a8109b1eb9d7cb6cbc2e2d0e929d0ef76 "
21+ rawToolchainCacheURL : " $(rawToolchainCacheURL_ARM64_3.0 )"
22+ rawToolchainExpectedHash : " $(rawToolchainCacheHash_ARM64_3.0) "
2523 - name : debug
2624 type : boolean
2725 default : false
@@ -36,12 +34,15 @@ resources:
3634
3735variables :
3836 - group : " Agent pools (DEV)"
37+ - group : " Raw toolchain info"
3938 - name : rpmsArtifactNameBase
4039 value : RPMs
4140 - name : toolchainArtifactNameBase
4241 value : Toolchain
42+ - name : toolchainTestsArtifactNameBase
43+ value : Toolchain_tests
4344 - name : system.debug
44- value : ' ${{ parameters.debug }}'
45+ value : " ${{ parameters.debug }}"
4546
4647extends :
4748 template : v2/OneBranch.NonOfficial.CrossPlat.yml@templates
@@ -59,7 +60,7 @@ extends:
5960 isCustom : true
6061 name : ${{ configuration.agentPool }}
6162 variables :
62- ob_artifactBaseName : $(toolchainArtifactNameBase)_${{ configuration.name }}
63+ ob_artifactBaseName : $(toolchainArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
6364 ob_outputDirectory : $(Build.ArtifactStagingDirectory)
6465 steps :
6566 - template : .pipelines/templates/RawToolchainDownload.yml@self
@@ -75,14 +76,21 @@ extends:
7576 # Toolchain package tests should be run through the full package build, calculate the list of packages that should be re-tested
7677 # and make it available to the next stage via an output variable: 'CalculateToolchainPackageRetestList.toolchainPackageRetestList'
7778 - template : .pipelines/templates/ToolchainCalculatePackageRetests.yml@self
79+ parameters :
80+ # GCC fails to build as a regular package.
81+ ignoredSpecs : ["gcc"]
82+
83+ - script : echo "##vso[task.setvariable variable=toolchainArtifactName;isOutput=true]$(ob_artifactBaseName)"
84+ name : " ToolchainArtifactName"
85+ displayName : " Set variable for published artifact name"
7886
7987 # 1. Automatic publishing won't work if 'isCustom: true' is set on the pool. We cannot do 'isCustom: false' because
8088 # then OneBranch attempts to perform additional actions (adding build tags for instance), which require additional permissions
8189 # that the PR check pipeline does not have.
8290 # 2. The value for 'artifact' must equal $(ob_artifactBaseName), as this is the only value OneBranch accepts.
8391 - task : PublishPipelineArtifact@1
8492 inputs :
85- artifact : $(toolchainArtifactNameBase)_${{ configuration.name }}
93+ artifact : $(toolchainArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
8694 targetPath : $(ob_outputDirectory)
8795 condition : always()
8896 displayName : " Publish toolchain artifacts"
@@ -96,38 +104,83 @@ extends:
96104 isCustom : true
97105 name : ${{ configuration.agentPool }}
98106 variables :
99- ob_artifactBaseName : ${{ variables. rpmsArtifactNameBase }} _${{ configuration.name }}
107+ ob_artifactBaseName : $( rpmsArtifactNameBase) _${{ configuration.name }}_$(System.JobAttempt)
100108 ob_outputDirectory : $(Build.ArtifactStagingDirectory)
101- testListFromToolchain : $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['CalculateToolchainPackageRetestList.toolchainPackageRetestList '] ]
109+ toolchainArtifactName : $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainArtifactName '] ]
102110 steps :
103111 - template : .pipelines/templates/PackageBuild.yml@self
104112 parameters :
105- customToolchainArtifactName : $(toolchainArtifactNameBase)_${{ configuration.name }}
113+ checkBuildRetries : " 1"
114+ customToolchainArtifactName : $(toolchainArtifactName)
106115 isCheckBuild : true
107116 isQuickRebuildPackages : true
108- outputArtifactsFolder : $(ob_outputDirectory)
117+ isUseCCache : true
109118 maxCPU : " ${{ configuration.maxCPUs }}"
119+ outputArtifactsFolder : $(ob_outputDirectory)
110120 pipArtifactFeeds : " mariner/Mariner-Pypi-Feed"
111121 selfRepoName : self
112122 testSuiteName : " [${{ configuration.name }}] Package test"
113- testRerunList : " $(testListFromToolchain)"
123+
124+ - script : echo "##vso[task.setvariable variable=rpmsArtifactName;isOutput=true]$(ob_artifactBaseName)"
125+ name : " RPMsArtifactName"
126+ displayName : " Set variable for published artifact name"
114127
115128 - task : PublishPipelineArtifact@1
116129 inputs :
117- artifact : ${{ variables. rpmsArtifactNameBase }} _${{ configuration.name }}
130+ artifact : $( rpmsArtifactNameBase) _${{ configuration.name }}_$(System.JobAttempt)
118131 targetPath : $(ob_outputDirectory)
119132 condition : always()
120133 displayName : " Publish packages build artifacts"
121134
122- - stage : sodiff_${{ configuration.name }}
135+ - stage : Toolchain_tests_${{ configuration.name }}
136+ dependsOn : Toolchain_${{ configuration.name }}
137+ jobs :
138+ - job : TestToolchainPackages
139+ condition : stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['CalculateToolchainPackageRetestList.toolchainPackageRetestList']
140+ pool :
141+ type : linux
142+ isCustom : true
143+ name : ${{ configuration.agentPool }}
144+ variables :
145+ ob_artifactBaseName : $(toolchainTestsArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
146+ ob_outputDirectory : $(Build.ArtifactStagingDirectory)
147+ testListFromToolchain : $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['CalculateToolchainPackageRetestList.toolchainPackageRetestList'] ]
148+ toolchainArtifactName : $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainArtifactName'] ]
149+ steps :
150+ - template : .pipelines/templates/PackageBuild.yml@self
151+ parameters :
152+ checkBuildRetries : " 1"
153+ customToolchainArtifactName : $(toolchainArtifactName)
154+ isAllowToolchainRebuilds : true
155+ isCheckBuild : true
156+ isQuickRebuildPackages : true
157+ isUseCCache : true
158+ maxCPU : " ${{ configuration.maxCPUs }}"
159+ outputArtifactsFolder : $(ob_outputDirectory)
160+ pipArtifactFeeds : " mariner/Mariner-Pypi-Feed"
161+ selfRepoName : self
162+ srpmPackList : " $(testListFromToolchain)"
163+ testRerunList : " $(testListFromToolchain)"
164+ testSuiteName : " [${{ configuration.name }}] Toolchain test"
165+
166+ - task : PublishPipelineArtifact@1
167+ inputs :
168+ artifact : $(toolchainTestsArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
169+ targetPath : $(ob_outputDirectory)
170+ condition : always()
171+ displayName : " Publish toolchain build artifacts"
172+
173+ - stage : Sodiff_${{ configuration.name }}
123174 dependsOn : RPMs_${{ configuration.name }}
124175 jobs :
125176 - job : Sodiff_Check
126177 pool :
127178 type : linux
128179 isCustom : true
129180 name : ${{ configuration.agentPool }}
181+ variables :
182+ rpmsArtifactName : $[ stageDependencies.RPMs_${{ configuration.name }}.BuildAndTest.outputs['RPMsArtifactName.rpmsArtifactName'] ]
130183 steps :
131184 - template : .pipelines/templatesWithCheckout/SodiffCheck.yml@self
132185 parameters :
133- inputArtifactName : ${{ variables.rpmsArtifactNameBase }}_${{ configuration.name }}
186+ inputArtifactName : $(rpmsArtifactName)
0 commit comments