Skip to content

Commit 79c9907

Browse files
authored
Utilize build script args to specify target rid (#42293)
1 parent 8fcbaac commit 79c9907

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

eng/pipelines/templates/jobs/vmr-build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ parameters:
4141
type: boolean
4242
default: false
4343

44+
# Overrides the rid that is produced by the build.
45+
- name: targetRid
46+
type: string
47+
default: ''
48+
4449
#### SOURCE-ONLY parameters ####
4550

4651
# Instead of building the VMR directly, exports the sources into a tarball and builds from that
@@ -325,6 +330,10 @@ jobs:
325330
customBuildArgs="$customBuildArgs --dev"
326331
fi
327332
333+
if [[ -n "${{ parameters.targetRid }}" ]]; then
334+
customBuildArgs="$customBuildArgs --target-rid ${{ parameters.targetRid }}"
335+
fi
336+
328337
if [[ -n "${{ parameters.crossRootFs }}" ]]; then
329338
customEnvVars="$customEnvVars ROOTFS_DIR=${{ parameters.crossRootFs}}"
330339
if [[ '${{ parameters.targetArchitecture }}' != 'wasm' ]]; then
@@ -401,6 +410,10 @@ jobs:
401410
customBuildArgs="$customBuildArgs --source-only /p:SmokeTestsWarnOnSdkContentDiffs=true /p:SmokeTestsExcludeOmniSharpTests=${{ parameters.excludeOmniSharpTests }}"
402411
fi
403412
413+
if [[ -n "${{ parameters.targetRid }}" ]]; then
414+
customBuildArgs="$customBuildArgs --target-rid ${{ parameters.targetRid }}"
415+
fi
416+
404417
if [[ -n "${{ parameters.extraProperties }}" ]]; then
405418
extraBuildProperties="$extraBuildProperties ${{ parameters.extraProperties }}"
406419
fi

eng/pipelines/templates/stages/vmr-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ stages:
132132
artifactsRid: ${{ variables.alpinePreviousX64Rid }}
133133
pool: ${{ parameters.pool_Linux }}
134134
container: ${{ variables.alpinePreviousContainer }}
135-
extraProperties: /p:TargetRID=${{ variables.alpinePreviousX64Rid }}
135+
targetRid: ${{ variables.alpinePreviousX64Rid }}
136136
buildFromArchive: false # 🚫
137137
buildSourceOnly: true #
138138
enablePoison: true #
@@ -154,7 +154,7 @@ stages:
154154
architecture: x64
155155
pool: ${{ parameters.pool_Linux }}
156156
container: ${{ variables.almaLinuxContainer }}
157-
extraProperties: /p:TargetRID=${{ variables.almaLinuxX64Rid }}
157+
targetRid: ${{ variables.almaLinuxX64Rid }}
158158
buildFromArchive: false # 🚫
159159
buildSourceOnly: true #
160160
enablePoison: false # 🚫
@@ -172,7 +172,7 @@ stages:
172172
architecture: x64
173173
pool: ${{ parameters.pool_Linux }}
174174
container: ${{ variables.alpineLatestContainer }}
175-
extraProperties: /p:TargetRID=${{ variables.alpineLatestX64Rid }}
175+
targetRid: ${{ variables.alpineLatestX64Rid }}
176176
buildFromArchive: false # 🚫
177177
buildSourceOnly: true #
178178
enablePoison: false # 🚫
@@ -876,7 +876,7 @@ stages:
876876
crossRootFs: '/crossrootfs/x64'
877877
targetOS: linux-musl
878878
targetArchitecture: x64
879-
extraProperties: /p:TargetRID=linux-musl-x64
879+
targetRid: ${{ variables.linuxMuslX64Rid}}
880880

881881
- template: ../jobs/vmr-build.yml
882882
parameters:
@@ -890,7 +890,7 @@ stages:
890890
useMonoRuntime: true
891891
targetOS: linux-musl
892892
targetArchitecture: x64
893-
extraProperties: /p:TargetRID=linux-musl-x64
893+
targetRid: ${{ variables.linuxMuslX64Rid }}
894894

895895
- template: ../jobs/vmr-build.yml
896896
parameters:
@@ -903,7 +903,7 @@ stages:
903903
crossRootFs: '/crossrootfs/arm'
904904
targetOS: linux-musl
905905
targetArchitecture: arm
906-
extraProperties: /p:TargetRID=linux-musl-arm
906+
targetRid: ${{ variables.linuxMuslArmRid }}
907907

908908
- template: ../jobs/vmr-build.yml
909909
parameters:
@@ -916,7 +916,7 @@ stages:
916916
crossRootFs: '/crossrootfs/arm64'
917917
targetOS: linux-musl
918918
targetArchitecture: arm64
919-
extraProperties: /p:TargetRID=linux-musl-arm64
919+
targetRid: ${{ variables.linuxMuslArm64Rid }}
920920

921921
- template: ../jobs/vmr-build.yml
922922
parameters:

eng/pipelines/templates/variables/vmr-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ variables:
6262

6363
- name: almaLinuxX64Rid
6464
value: almalinux.8-x64
65+
- name: linuxMuslX64Rid
66+
value: linux-musl-x64
67+
- name: linuxMuslArmRid
68+
value: linux-musl-arm
69+
- name: linuxMuslArm64Rid
70+
value: linux-musl-arm64
6571
- name: alpineLatestX64Rid
6672
value: alpine.3.20-x64
6773
- name: alpinePreviousX64Rid

0 commit comments

Comments
 (0)