From e57fd54581be554e3089827cb20eeb5dd0563ef3 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:06:28 -0800 Subject: [PATCH 1/6] Add coreclr crossbuild job --- eng/pipelines/templates/jobs/vmr-build.yml | 6 ++--- .../templates/stages/vmr-cross-build.yml | 22 ++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml index a92b4dca5..1977778f9 100644 --- a/eng/pipelines/templates/jobs/vmr-build.yml +++ b/eng/pipelines/templates/jobs/vmr-build.yml @@ -190,7 +190,7 @@ jobs: if [[ -n '${{ parameters.artifactsRid }}' ]]; then customPrepArgs="${customPrepArgs} --artifacts-rid ${{ parameters.artifactsRid }}" fi - + if [[ '${{ parameters.withPreviousSDK }}' == 'True' ]]; then # Source-built artifacts are from CentOS 8 Stream or Alpine 3.17. We want to download them without # downloading portable versions from the internet. @@ -200,7 +200,7 @@ jobs: customPrepArgs="${customPrepArgs} --no-sdk --no-artifacts" prepSdk=false fi - + if [[ "$prepSdk" == "false" ]]; then mkdir $(sourcesPath)/.dotnet previousSdkPath="$(sourcesPath)/prereqs/packages/archive/dotnet-sdk-*.tar.gz" @@ -245,7 +245,7 @@ jobs: if [[ ! -z '${{ parameters.crossRootFs }}' ]]; then customRunArgs="$customRunArgs -e CROSSCOMPILE=1 -e ROOTFS_DIR=${{ parameters.crossRootFs}}" - extraBuildProperties="$extraBuildProperties /p:PortableBuild=true /p:DotNetBuildVertical=true" + extraBuildProperties="$extraBuildProperties /p:PortableBuild=true /p:DotNetBuildVertical=true /p:CrossBuild=true" fi if [[ ! -z '${{ parameters.targetRid }}' ]]; then diff --git a/eng/pipelines/templates/stages/vmr-cross-build.yml b/eng/pipelines/templates/stages/vmr-cross-build.yml index 758bdaaf2..ed9cded1b 100644 --- a/eng/pipelines/templates/stages/vmr-cross-build.yml +++ b/eng/pipelines/templates/stages/vmr-cross-build.yml @@ -89,7 +89,7 @@ stages: - template: ../jobs/vmr-build.yml parameters: # Changing the build name requires updating the referenced name in the source-build-sdk-diff-tests.yml pipeline - buildName: MarinerCrossArm64_Online_MsftSdk + buildName: MarinerCrossArm64_Online_MsftSdk_Mono isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} vmrBranch: ${{ variables.VmrBranch }} architecture: x64 @@ -105,3 +105,23 @@ stages: withPreviousSDK: false # 🚫 crossRootFs: '/crossrootfs/arm64' # 📝 targetRid: 'linux-arm64' # 📝 + + - template: ../jobs/vmr-build.yml + parameters: + # Changing the build name requires updating the referenced name in the source-build-sdk-diff-tests.yml pipeline + buildName: MarinerCrossArm64_Online_MsftSdk_CoreCLR + isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} + vmrBranch: ${{ variables.VmrBranch }} + architecture: x64 + pool: + name: ${{ variables.defaultPoolName }} + demands: ${{ variables.defaultPoolDemands }} + container: ${{ parameters.marinerArm64CrossContainer }} + buildFromArchive: false # 🚫 + enablePoison: false # 🚫 + excludeOmniSharpTests: true # ✅ + runOnline: true # ✅ + useMonoRuntime: false # 🚫 + withPreviousSDK: false # 🚫 + crossRootFs: '/crossrootfs/arm64' # 📝 + targetRid: 'linux-arm64' # 📝 From 588791821cef9d5156ea4989cdc81b4d256d897e Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:45:30 -0800 Subject: [PATCH 2/6] Don't set CROSSCOMPILE=1 --- eng/pipelines/templates/jobs/vmr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml index 1977778f9..da3c1e05e 100644 --- a/eng/pipelines/templates/jobs/vmr-build.yml +++ b/eng/pipelines/templates/jobs/vmr-build.yml @@ -244,7 +244,7 @@ jobs: fi if [[ ! -z '${{ parameters.crossRootFs }}' ]]; then - customRunArgs="$customRunArgs -e CROSSCOMPILE=1 -e ROOTFS_DIR=${{ parameters.crossRootFs}}" + customRunArgs="$customRunArgs -e ROOTFS_DIR=${{ parameters.crossRootFs}}" extraBuildProperties="$extraBuildProperties /p:PortableBuild=true /p:DotNetBuildVertical=true /p:CrossBuild=true" fi From 8d401cb4dc7ea02260c174dd0c3021cef14efd4e Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:56:31 -0800 Subject: [PATCH 3/6] Pass CrossBuild to inner builds --- src/SourceBuild/content/repo-projects/Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SourceBuild/content/repo-projects/Directory.Build.props b/src/SourceBuild/content/repo-projects/Directory.Build.props index 266ebe7ce..f6718ed9e 100644 --- a/src/SourceBuild/content/repo-projects/Directory.Build.props +++ b/src/SourceBuild/content/repo-projects/Directory.Build.props @@ -168,6 +168,7 @@ $(StandardSourceBuildArgs) /p:PreviouslySourceBuiltNupkgCacheDir="$(PrebuiltSourceBuiltPackagesPath)" $(StandardSourceBuildArgs) /p:SourceBuildUseMonoRuntime=$(SourceBuildUseMonoRuntime) $(StandardSourceBuildArgs) /p:DotNetBuildVertical=$(DotNetBuildVertical) + $(StandardSourceBuildArgs) /p:CrossBuild=$(CrossBuild) $(ProjectDirectory)\build$(ShellExtension) From 916aa0241a743bf5a762f1abe77316b5bbccf5cd Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 14 Dec 2023 09:44:47 -0800 Subject: [PATCH 4/6] Set CROSSCOMPILE for mono only --- eng/pipelines/templates/jobs/vmr-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml index da3c1e05e..91766c727 100644 --- a/eng/pipelines/templates/jobs/vmr-build.yml +++ b/eng/pipelines/templates/jobs/vmr-build.yml @@ -246,6 +246,9 @@ jobs: if [[ ! -z '${{ parameters.crossRootFs }}' ]]; then customRunArgs="$customRunArgs -e ROOTFS_DIR=${{ parameters.crossRootFs}}" extraBuildProperties="$extraBuildProperties /p:PortableBuild=true /p:DotNetBuildVertical=true /p:CrossBuild=true" + if [[ '${{ parameters.useMonoRuntime }}' == 'True' ]]; then + customBuildArgs="$customRunArgs -e CROSSCOMPILE=1" + fi fi if [[ ! -z '${{ parameters.targetRid }}' ]]; then From 50405a5c26988b060cdf586f2adcddfb246a8474 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:53:09 -0800 Subject: [PATCH 5/6] Set the right variable for docker args --- eng/pipelines/templates/jobs/vmr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/vmr-build.yml b/eng/pipelines/templates/jobs/vmr-build.yml index 91766c727..85e5cd726 100644 --- a/eng/pipelines/templates/jobs/vmr-build.yml +++ b/eng/pipelines/templates/jobs/vmr-build.yml @@ -247,7 +247,7 @@ jobs: customRunArgs="$customRunArgs -e ROOTFS_DIR=${{ parameters.crossRootFs}}" extraBuildProperties="$extraBuildProperties /p:PortableBuild=true /p:DotNetBuildVertical=true /p:CrossBuild=true" if [[ '${{ parameters.useMonoRuntime }}' == 'True' ]]; then - customBuildArgs="$customRunArgs -e CROSSCOMPILE=1" + customRunArgs="$customRunArgs -e CROSSCOMPILE=1" fi fi From eb7c8d26e9b6795c8e604f9f70fc6f0d2508a81e Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:00:29 -0800 Subject: [PATCH 6/6] Set architecture to arm64 to upload artifacts --- eng/pipelines/templates/stages/vmr-cross-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/stages/vmr-cross-build.yml b/eng/pipelines/templates/stages/vmr-cross-build.yml index ed9cded1b..7a27282cb 100644 --- a/eng/pipelines/templates/stages/vmr-cross-build.yml +++ b/eng/pipelines/templates/stages/vmr-cross-build.yml @@ -92,7 +92,7 @@ stages: buildName: MarinerCrossArm64_Online_MsftSdk_Mono isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} vmrBranch: ${{ variables.VmrBranch }} - architecture: x64 + architecture: arm64 pool: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }} @@ -112,7 +112,7 @@ stages: buildName: MarinerCrossArm64_Online_MsftSdk_CoreCLR isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }} vmrBranch: ${{ variables.VmrBranch }} - architecture: x64 + architecture: arm64 pool: name: ${{ variables.defaultPoolName }} demands: ${{ variables.defaultPoolDemands }}