From cf22db5a0a7b26797ea9f584ac9fe04ddd0cb42f Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 12 May 2023 00:02:12 -0700 Subject: [PATCH 1/9] Fix official build of cross DAC components Revert changes that broke build of the cross DAC linux-arm components Fixes #86073 --- eng/pipelines/coreclr/templates/build-job.yml | 4 ++++ src/coreclr/build-runtime.cmd | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 7679cca27fa54b..c7566dccc7af47 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -202,6 +202,10 @@ jobs: - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -hostarch x64 $(osArg) -ci $(compilerArg) -component crosscomponents -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" $(officialBuildIdArg) $(clrRuntimePortableBuildArg) displayName: Build CoreCLR Cross-Arch Tools (Tools that run on x64 targeting x86) + - ${{ if and(eq(parameters.osGroup, 'windows'), eq(parameters.archType, 'x86')) }}: + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) arm -hostarch x86 $(osArg) -ci $(compilerArg) -component crosscomponents -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" $(officialBuildIdArg) $(clrRuntimePortableBuildArg) + displayName: Build CoreCLR Cross-Arch Tools (Tools that run on win-x86 targeting arm) + - ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}: - script: | du -sh $(Build.SourcesDirectory)/* diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index 40ced7a1f977cf..a8fca255b86116 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -42,6 +42,7 @@ set __BuildAll= set __TargetArchX64=0 set __TargetArchX86=0 +set __TargetArchArm=0 set __TargetArchArm64=0 set __BuildTypeDebug=0 @@ -86,6 +87,7 @@ if /i "%1" == "--help" goto Usage if /i "%1" == "-all" (set __BuildAll=1&shift&goto Arg_Loop) if /i "%1" == "-x64" (set __TargetArchX64=1&shift&goto Arg_Loop) if /i "%1" == "-x86" (set __TargetArchX86=1&shift&goto Arg_Loop) +if /i "%1" == "-arm" (set __TargetArchArm=1&shift&goto Arg_Loop) if /i "%1" == "-arm64" (set __TargetArchArm64=1&shift&goto Arg_Loop) if /i "%1" == "-debug" (set __BuildTypeDebug=1&shift&goto Arg_Loop) @@ -99,6 +101,7 @@ REM don't add more, use the - syntax instead if /i "%1" == "all" (set __BuildAll=1&shift&goto Arg_Loop) if /i "%1" == "x64" (set __TargetArchX64=1&shift&goto Arg_Loop) if /i "%1" == "x86" (set __TargetArchX86=1&shift&goto Arg_Loop) +if /i "%1" == "arm" (set __TargetArchArm=1&shift&goto Arg_Loop) if /i "%1" == "arm64" (set __TargetArchArm64=1&shift&goto Arg_Loop) if /i "%1" == "debug" (set __BuildTypeDebug=1&shift&goto Arg_Loop) @@ -162,7 +165,7 @@ if defined VCINSTALLDIR ( if defined __BuildAll goto BuildAll -set /A __TotalSpecifiedTargetArch=__TargetArchX64 + __TargetArchX86 + __TargetArchArm64 +set /A __TotalSpecifiedTargetArch=__TargetArchX64 + __TargetArchX86 + __TargetArchArm + __TargetArchArm64 if %__TotalSpecifiedTargetArch% GTR 1 ( echo Error: more than one build architecture specified, but "all" not specified. goto Usage @@ -173,6 +176,7 @@ if "%__ProcessorArch%"=="" set __ProcessorArch=%PROCESSOR_ARCHITECTURE% if %__TargetArchX64%==1 set __TargetArch=x64 if %__TargetArchX86%==1 set __TargetArch=x86 +if %__TargetArchArm%==1 set __TargetArch=arm if %__TargetArchArm64%==1 set __TargetArch=arm64 if "%__HostArch%" == "" set __HostArch=%__TargetArch% @@ -187,6 +191,10 @@ if %__BuildTypeChecked%==1 set __BuildType=Checked if %__BuildTypeRelease%==1 set __BuildType=Release if %__EnforcePgo%==1 ( + if %__TargetArchArm%==1 ( + echo NOTICE: enforcepgo does nothing on arm architecture + set __EnforcePgo=0 + ) if %__TargetArchArm64%==1 ( echo NOTICE: enforcepgo does nothing on arm64 architecture set __EnforcePgo=0 @@ -443,7 +451,7 @@ REM ============================================================================ set __TargetArchList= -set /A __TotalSpecifiedTargetArch=__TargetArchX64 + __TargetArchX86 + __TargetArchArm64 +set /A __TotalSpecifiedTargetArch=__TargetArchX64 + __TargetArchX86 + __TargetArchArm + __TargetArchArm64 if %__TotalSpecifiedTargetArch% EQU 0 ( REM Nothing specified means we want to build all architectures. set __TargetArchList=x64 x86 arm arm64 @@ -453,6 +461,7 @@ REM Otherwise, add all the specified architectures to the list. if %__TargetArchX64%==1 set __TargetArchList=%__TargetArchList% x64 if %__TargetArchX86%==1 set __TargetArchList=%__TargetArchList% x86 +if %__TargetArchArm%==1 set __TargetArchList=%__TargetArchList% arm if %__TargetArchArm64%==1 set __TargetArchList=%__TargetArchList% arm64 set __BuildTypeList= @@ -536,7 +545,7 @@ echo All arguments are optional. The options are: echo. echo.-? -h -help --help: view this message. echo -all: Builds all configurations and platforms. -echo Build architecture: one of -x64, -x86, -arm64 ^(default: -x64^). +echo Build architecture: one of -x64, -x86, -arm, -arm64 ^(default: -x64^). echo Build type: one of -Debug, -Checked, -Release ^(default: -Debug^). echo -component ^ : specify this option one or more times to limit components built to those specified. echo Allowed ^: hosts jit alljits runtime paltests iltools nativeaot spmi From ffb514bf7f340af7ed124217e74c92653e2941dd Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 12 May 2023 00:29:20 -0700 Subject: [PATCH 2/9] FB --- eng/pipelines/coreclr/templates/build-job.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index c7566dccc7af47..6494ddc96e756b 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -202,10 +202,6 @@ jobs: - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -hostarch x64 $(osArg) -ci $(compilerArg) -component crosscomponents -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" $(officialBuildIdArg) $(clrRuntimePortableBuildArg) displayName: Build CoreCLR Cross-Arch Tools (Tools that run on x64 targeting x86) - - ${{ if and(eq(parameters.osGroup, 'windows'), eq(parameters.archType, 'x86')) }}: - - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) arm -hostarch x86 $(osArg) -ci $(compilerArg) -component crosscomponents -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" $(officialBuildIdArg) $(clrRuntimePortableBuildArg) - displayName: Build CoreCLR Cross-Arch Tools (Tools that run on win-x86 targeting arm) - - ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}: - script: | du -sh $(Build.SourcesDirectory)/* @@ -291,6 +287,15 @@ jobs: ${{ else }}: hostArchType: x64 + - ${{ if and(in(parameters.osGroup, 'windows'), eq(parameters.archType, 'x86'), ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, 'clrTools'), eq(parameters.pgoType, '')) }}: + - template: /eng/pipelines/coreclr/templates/crossdac-build.yml + parameters: + archType: arm + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + isOfficialBuild: ${{ parameters.signBinaries }} + hostArchType: x86 + - ${{ if and(ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, ''), ne(parameters.testGroup, 'clrTools'), ne(parameters.disableClrTest, true)) }}: # Publish test native components for consumption by test execution. - ${{ if and(ne(parameters.isOfficialBuild, true), eq(parameters.pgoType, '')) }}: From 0396f57e306e78c848de36708aea0e65dd77968a Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 12 May 2023 00:50:43 -0700 Subject: [PATCH 3/9] Update eng/pipelines/coreclr/templates/build-job.yml Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> --- eng/pipelines/coreclr/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 6494ddc96e756b..4566252bc5a286 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -287,7 +287,7 @@ jobs: ${{ else }}: hostArchType: x64 - - ${{ if and(in(parameters.osGroup, 'windows'), eq(parameters.archType, 'x86'), ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, 'clrTools'), eq(parameters.pgoType, '')) }}: + - ${{ if and(in(parameters.osGroup, 'windows'), eq(parameters.archType, 'x86'), ne(parameters.testGroup, 'clrTools'), eq(parameters.pgoType, '')) }}: - template: /eng/pipelines/coreclr/templates/crossdac-build.yml parameters: archType: arm From b17f453768be47bca9077143ba45a97f0d48f613 Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Fri, 12 May 2023 00:53:48 -0700 Subject: [PATCH 4/9] Update crossdac-build.yml --- eng/pipelines/coreclr/templates/crossdac-build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml index 82ad6e2e365342..56c6a52ec7af96 100644 --- a/eng/pipelines/coreclr/templates/crossdac-build.yml +++ b/eng/pipelines/coreclr/templates/crossdac-build.yml @@ -45,8 +45,15 @@ steps: $availableFiles | %{ cp $_.FullName $targetDir -v } } - CopyAndVerifyCrossOsAssets -CrossDacDir $(buildMuslDacRootFolderPath) -TargetDir '$(buildMuslDacStagingPath)/${{ parameters.hostArchType }}' - CopyAndVerifyCrossOsAssets -CrossDacDir $(buildLinuxDacRootFolderPath) -TargetDir '$(buildLinuxDacStagingPath)/${{ parameters.hostArchType }}' + $buildMuslDacRootFolderPath = "$(Build.SourcesDirectory)/artifacts/bin/coreclr/alpine.${{ parameters.archType }}.$(buildConfigUpper)" + $buildMuslStagingPath = "$(crossDacArtifactPath)/Linux_musl.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" + + $buildLinuxDacRootFolderPath = "$(Build.SourcesDirectory)/artifacts/bin/coreclr/Linux.${{ parameters.archType }}.$(buildConfigUpper)" + $buildLinuxDacStagingPath = "$(crossDacArtifactPath)/Linux.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" + + + CopyAndVerifyCrossOsAssets -CrossDacDir $(buildMuslDacRootFolderPath) -TargetDir '$buildMuslStagingPath' + CopyAndVerifyCrossOsAssets -CrossDacDir $(buildLinuxDacRootFolderPath) -TargetDir '$buildLinuxDacStagingPath' Write-Host "Final directory contents:" ls -R $(crossDacArtifactPath) From e2492e28d636e19bacd3773b8494112ee1c781e1 Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Fri, 12 May 2023 00:56:13 -0700 Subject: [PATCH 5/9] Update xplat-pipeline-job.yml --- .../coreclr/templates/xplat-pipeline-job.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml index 8e4c7b4684b3f5..83347d78b8b1cc 100644 --- a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml +++ b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml @@ -76,18 +76,6 @@ jobs: - name: crossDacArtifactPath value: $(Build.SourcesDirectory)/artifacts/$(buildCrossDacArtifactName) - - name: buildMuslDacRootFolderPath - value: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/alpine.$(archType).$(buildConfigUpper)' - - - name: buildMuslDacStagingPath - value: '$(crossDacArtifactPath)/Linux_musl.$(archType).$(buildConfigUpper)' - - - name: buildLinuxDacRootFolderPath - value: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/Linux.$(archType).$(buildConfigUpper)' - - - name: buildLinuxDacStagingPath - value: '$(crossDacArtifactPath)/Linux.$(archType).$(buildConfigUpper)' - # We need this because both mono and coreclr build currently depends on CoreClr - name: coreClrProductArtifactName value: 'CoreCLRProduct_${{ parameters.pgoType }}_${{ parameters.runtimeVariant }}_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' From 8de24b9b2b1c4a703f54f7550877727d8ffa3b65 Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Fri, 12 May 2023 02:03:22 -0700 Subject: [PATCH 6/9] Update eng/pipelines/coreclr/templates/crossdac-build.yml --- eng/pipelines/coreclr/templates/crossdac-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml index 56c6a52ec7af96..b4a7fff4efa5e6 100644 --- a/eng/pipelines/coreclr/templates/crossdac-build.yml +++ b/eng/pipelines/coreclr/templates/crossdac-build.yml @@ -52,8 +52,9 @@ steps: $buildLinuxDacStagingPath = "$(crossDacArtifactPath)/Linux.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" - CopyAndVerifyCrossOsAssets -CrossDacDir $(buildMuslDacRootFolderPath) -TargetDir '$buildMuslStagingPath' - CopyAndVerifyCrossOsAssets -CrossDacDir $(buildLinuxDacRootFolderPath) -TargetDir '$buildLinuxDacStagingPath' + CopyAndVerifyCrossOsAssets -CrossDacDir $buildMuslDacRootFolderPath -TargetDir '$buildMuslStagingPath' + CopyAndVerifyCrossOsAssets -CrossDacDir $buildLinuxDacRootFolderPath + -TargetDir '$buildLinuxDacStagingPath' Write-Host "Final directory contents:" ls -R $(crossDacArtifactPath) From 5a143ca85506ee0e634f9e4062f751354476372f Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Fri, 12 May 2023 02:51:12 -0700 Subject: [PATCH 7/9] Update crossdac-build.yml --- eng/pipelines/coreclr/templates/crossdac-build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml index b4a7fff4efa5e6..8d2bd8b131e509 100644 --- a/eng/pipelines/coreclr/templates/crossdac-build.yml +++ b/eng/pipelines/coreclr/templates/crossdac-build.yml @@ -52,12 +52,11 @@ steps: $buildLinuxDacStagingPath = "$(crossDacArtifactPath)/Linux.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" - CopyAndVerifyCrossOsAssets -CrossDacDir $buildMuslDacRootFolderPath -TargetDir '$buildMuslStagingPath' - CopyAndVerifyCrossOsAssets -CrossDacDir $buildLinuxDacRootFolderPath - -TargetDir '$buildLinuxDacStagingPath' + CopyAndVerifyCrossOsAssets -CrossDacDir '$buildMuslDacRootFolderPath' -TargetDir '$buildMuslStagingPath' + CopyAndVerifyCrossOsAssets -CrossDacDir '$buildLinuxDacRootFolderPath' -TargetDir '$buildLinuxDacStagingPath' Write-Host "Final directory contents:" - ls -R $(crossDacArtifactPath) + ls -R '$(crossDacArtifactPath)' displayName: Gather CrossDac Artifacts From 4d40d7aa3b2800c1deacbdfdc864cbab10509976 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 12 May 2023 07:43:44 -0700 Subject: [PATCH 8/9] Update eng/pipelines/coreclr/templates/crossdac-build.yml --- eng/pipelines/coreclr/templates/crossdac-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml index 8d2bd8b131e509..f09af6e9c40c45 100644 --- a/eng/pipelines/coreclr/templates/crossdac-build.yml +++ b/eng/pipelines/coreclr/templates/crossdac-build.yml @@ -52,8 +52,8 @@ steps: $buildLinuxDacStagingPath = "$(crossDacArtifactPath)/Linux.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" - CopyAndVerifyCrossOsAssets -CrossDacDir '$buildMuslDacRootFolderPath' -TargetDir '$buildMuslStagingPath' - CopyAndVerifyCrossOsAssets -CrossDacDir '$buildLinuxDacRootFolderPath' -TargetDir '$buildLinuxDacStagingPath' + CopyAndVerifyCrossOsAssets -CrossDacDir $buildMuslDacRootFolderPath -TargetDir $buildMuslStagingPath + CopyAndVerifyCrossOsAssets -CrossDacDir $buildLinuxDacRootFolderPath -TargetDir $buildLinuxDacStagingPath Write-Host "Final directory contents:" ls -R '$(crossDacArtifactPath)' From cefee467535f055659021d2fdebf595ecdfea409 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Fri, 12 May 2023 07:44:03 -0700 Subject: [PATCH 9/9] Update eng/pipelines/coreclr/templates/crossdac-build.yml --- eng/pipelines/coreclr/templates/crossdac-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml index f09af6e9c40c45..f0ac5d36f00475 100644 --- a/eng/pipelines/coreclr/templates/crossdac-build.yml +++ b/eng/pipelines/coreclr/templates/crossdac-build.yml @@ -56,7 +56,7 @@ steps: CopyAndVerifyCrossOsAssets -CrossDacDir $buildLinuxDacRootFolderPath -TargetDir $buildLinuxDacStagingPath Write-Host "Final directory contents:" - ls -R '$(crossDacArtifactPath)' + ls -R $(crossDacArtifactPath) displayName: Gather CrossDac Artifacts