Skip to content

Commit

Permalink
Utilize build script args to specify target rid (#42293)
Browse files Browse the repository at this point in the history
  • Loading branch information
Winniexu01 authored Jul 25, 2024
1 parent 8fcbaac commit 79c9907
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
13 changes: 13 additions & 0 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ parameters:
type: boolean
default: false

# Overrides the rid that is produced by the build.
- name: targetRid
type: string
default: ''

#### SOURCE-ONLY parameters ####

# Instead of building the VMR directly, exports the sources into a tarball and builds from that
Expand Down Expand Up @@ -325,6 +330,10 @@ jobs:
customBuildArgs="$customBuildArgs --dev"
fi
if [[ -n "${{ parameters.targetRid }}" ]]; then
customBuildArgs="$customBuildArgs --target-rid ${{ parameters.targetRid }}"
fi
if [[ -n "${{ parameters.crossRootFs }}" ]]; then
customEnvVars="$customEnvVars ROOTFS_DIR=${{ parameters.crossRootFs}}"
if [[ '${{ parameters.targetArchitecture }}' != 'wasm' ]]; then
Expand Down Expand Up @@ -401,6 +410,10 @@ jobs:
customBuildArgs="$customBuildArgs --source-only /p:SmokeTestsWarnOnSdkContentDiffs=true /p:SmokeTestsExcludeOmniSharpTests=${{ parameters.excludeOmniSharpTests }}"
fi
if [[ -n "${{ parameters.targetRid }}" ]]; then
customBuildArgs="$customBuildArgs --target-rid ${{ parameters.targetRid }}"
fi
if [[ -n "${{ parameters.extraProperties }}" ]]; then
extraBuildProperties="$extraBuildProperties ${{ parameters.extraProperties }}"
fi
Expand Down
14 changes: 7 additions & 7 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ stages:
artifactsRid: ${{ variables.alpinePreviousX64Rid }}
pool: ${{ parameters.pool_Linux }}
container: ${{ variables.alpinePreviousContainer }}
extraProperties: /p:TargetRID=${{ variables.alpinePreviousX64Rid }}
targetRid: ${{ variables.alpinePreviousX64Rid }}
buildFromArchive: false # 🚫
buildSourceOnly: true #
enablePoison: true #
Expand All @@ -154,7 +154,7 @@ stages:
architecture: x64
pool: ${{ parameters.pool_Linux }}
container: ${{ variables.almaLinuxContainer }}
extraProperties: /p:TargetRID=${{ variables.almaLinuxX64Rid }}
targetRid: ${{ variables.almaLinuxX64Rid }}
buildFromArchive: false # 🚫
buildSourceOnly: true #
enablePoison: false # 🚫
Expand All @@ -172,7 +172,7 @@ stages:
architecture: x64
pool: ${{ parameters.pool_Linux }}
container: ${{ variables.alpineLatestContainer }}
extraProperties: /p:TargetRID=${{ variables.alpineLatestX64Rid }}
targetRid: ${{ variables.alpineLatestX64Rid }}
buildFromArchive: false # 🚫
buildSourceOnly: true #
enablePoison: false # 🚫
Expand Down Expand Up @@ -876,7 +876,7 @@ stages:
crossRootFs: '/crossrootfs/x64'
targetOS: linux-musl
targetArchitecture: x64
extraProperties: /p:TargetRID=linux-musl-x64
targetRid: ${{ variables.linuxMuslX64Rid}}

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -890,7 +890,7 @@ stages:
useMonoRuntime: true
targetOS: linux-musl
targetArchitecture: x64
extraProperties: /p:TargetRID=linux-musl-x64
targetRid: ${{ variables.linuxMuslX64Rid }}

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -903,7 +903,7 @@ stages:
crossRootFs: '/crossrootfs/arm'
targetOS: linux-musl
targetArchitecture: arm
extraProperties: /p:TargetRID=linux-musl-arm
targetRid: ${{ variables.linuxMuslArmRid }}

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -916,7 +916,7 @@ stages:
crossRootFs: '/crossrootfs/arm64'
targetOS: linux-musl
targetArchitecture: arm64
extraProperties: /p:TargetRID=linux-musl-arm64
targetRid: ${{ variables.linuxMuslArm64Rid }}

- template: ../jobs/vmr-build.yml
parameters:
Expand Down
6 changes: 6 additions & 0 deletions eng/pipelines/templates/variables/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ variables:

- name: almaLinuxX64Rid
value: almalinux.8-x64
- name: linuxMuslX64Rid
value: linux-musl-x64
- name: linuxMuslArmRid
value: linux-musl-arm
- name: linuxMuslArm64Rid
value: linux-musl-arm64
- name: alpineLatestX64Rid
value: alpine.3.20-x64
- name: alpinePreviousX64Rid
Expand Down

0 comments on commit 79c9907

Please sign in to comment.