Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on CBL-mariner host with rootfs #84148

Merged
merged 88 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8735c94
Enable x64 Alpine crossbuild
janvorli Feb 9, 2023
0084966
Set PKG_CONFIG_SYSROOT_DIR
sbomer Feb 22, 2023
bb39763
More build fixes
sbomer Mar 3, 2023
a5f2dbd
test
sbomer Mar 6, 2023
db7bf3e
Print full clang command to show selected linker
sbomer Mar 7, 2023
597a304
Build scripts
sbomer Mar 8, 2023
3e5a366
Fix x64 -> x64 musl cross-build
sbomer Mar 10, 2023
4c369f3
Enable thumb-2 in mono build
sbomer Mar 14, 2023
612c686
Allow cross compiling for x86
sbomer Mar 24, 2023
a9fd083
Enable x86 build with lld
sbomer Mar 24, 2023
d0a1560
Fix x86 mono cross-build
sbomer Mar 24, 2023
2abee9b
Some cleanup
sbomer Mar 24, 2023
54dc641
Add gcc-toolchain arg when aot-ing crossgen
sbomer Mar 24, 2023
2da99a9
Merge remote-tracking branch 'origin/main' into marinerTest
sbomer Mar 27, 2023
825a1d9
Fix AOT compilation of ILCompiler and crossgen2
sbomer Mar 27, 2023
c7468f6
Only pass --gcc-toolchain where required
sbomer Mar 27, 2023
ae6c6ab
Cleanup
sbomer Mar 27, 2023
3d70352
Fix symbol stripping on ci builds
sbomer Mar 29, 2023
2f12a9a
Fix nativeaot test build
sbomer Mar 30, 2023
f6bd3e5
Pick up mariner images, set cross-build arguments
sbomer Mar 30, 2023
e9f17fb
Don't use lld on macos
sbomer Mar 31, 2023
26621ab
Update src/coreclr/pgosupport.cmake
sbomer Mar 31, 2023
39ca0c0
Don't pass clang9
sbomer Mar 31, 2023
220094a
Fix osx linker in tests too
sbomer Mar 31, 2023
d4f71e9
Define separate platform for GCC build
sbomer Mar 31, 2023
d85c7d6
Disable PGO for linux x64 and musl-x64
sbomer Mar 31, 2023
1b3afcb
Build cross tools for x64 and musl-x64
sbomer Mar 31, 2023
938cdf1
Pass crossArg to mono build
sbomer Mar 31, 2023
749ee9c
Pass cross arg in build-test-job.yml
sbomer Mar 31, 2023
6cb0b8e
Fix typo
sbomer Mar 31, 2023
96243bd
Pass through no-PGO arg in global-build-job.yml
sbomer Mar 31, 2023
b84beba
Remove pgoType from job name
sbomer Apr 1, 2023
c9137b3
Pass noPgo arg to native prereqs step
sbomer Apr 2, 2023
d0d3312
Fix crossArg not defined for NativeAOT test build
sbomer Apr 2, 2023
ed0c013
Pass crossBuild through build-test-job.yml
sbomer Apr 2, 2023
2367f3f
Set linker flavor, sysroot in nativeaot library tests
sbomer Apr 2, 2023
a51dbde
Use git diff for AsnXml
sbomer Apr 3, 2023
76c434f
Merge remote-tracking branch 'origin/main' into marinerBuild
sbomer Apr 3, 2023
c30a214
Pass crossBuild through mono's xplat-pipeline-job.yml
sbomer Apr 3, 2023
dd59301
Move crossArg after runtime build params
sbomer Apr 3, 2023
c4c5fa7
Disable PGO from MSBuild instead
sbomer Apr 3, 2023
8a19475
Fix empty container
sbomer Apr 3, 2023
8c41d41
Pass crossArg to mono Build packages step
sbomer Apr 3, 2023
a8cc38d
Fix gcc container definition
sbomer Apr 3, 2023
9aa3527
Use init-compiler.sh for mono cross build
sbomer Apr 3, 2023
cd1f16a
Condition linker selection based on compiler
sbomer Apr 3, 2023
143552e
Fix publish condition
sbomer Apr 4, 2023
04e6182
Pass compilerArg to managed component build
sbomer Apr 4, 2023
47246a3
Use command -v instead of which
sbomer Apr 4, 2023
7ecd081
Use crossArg instead of _crossBuildPropertyArg
sbomer Apr 4, 2023
405fbae
Set mono toolchain for aot build
sbomer Apr 4, 2023
c1da152
Adjust DwarfDump baseline, show expected AOT size
sbomer Apr 4, 2023
9cd348b
Don't use new images for Mono LLVMAot test build
sbomer Apr 4, 2023
d6b0649
Build cross tools when BuildArch != TargetArch
sbomer Apr 4, 2023
8e12626
Fix typo
sbomer Apr 4, 2023
ecd4081
Don't set crossBuild for mono llvmaot
sbomer Apr 5, 2023
028a889
Fix ILCompiler, crossgen invocation for windows
sbomer Apr 6, 2023
7fc39d3
Add PGO instrumentation legs
sbomer Apr 6, 2023
6aa9f0a
Run source-build legs
sbomer Apr 6, 2023
667921b
Pick up arm images
sbomer Apr 7, 2023
cf0ffef
Fix indentation
sbomer Apr 7, 2023
6c0b026
Undo job name change
sbomer Apr 7, 2023
fc9c302
Add linux arm64 libraries build
sbomer Apr 7, 2023
a5e22a0
Don't run AOT'd crossgen that targets musl
sbomer Apr 7, 2023
09f6889
Fix crossgen-corelib logic
sbomer Apr 7, 2023
d23534a
Freeze image versions
sbomer Apr 7, 2023
609f19b
Use existing images for mono arm64 build
sbomer Apr 7, 2023
bedfad7
Don't trigger source-build
sbomer Apr 7, 2023
c708244
Merge remote-tracking branch 'origin/main' into marinerBuild
sbomer Apr 7, 2023
02ec629
Update dwarfdump, size baseline
sbomer Apr 7, 2023
e130eb5
Fix yaml mistakes
sbomer Apr 7, 2023
0fcef90
Update src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.…
sbomer Apr 7, 2023
f1ea8ad
PR feedback
sbomer Apr 8, 2023
04571e5
Fix arm image tags
sbomer Apr 8, 2023
45bb34d
Update src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.…
sbomer Apr 10, 2023
ee57442
Merge remote-tracking branch 'origin/main' into marinerBuild
sbomer Apr 10, 2023
d80a584
Revert "Write linker script for lld to enable gc-sections (#84493)"
sbomer Apr 10, 2023
ddcd261
Update image tags
sbomer Apr 10, 2023
812d284
Revert "Use git diff for AsnXml"
sbomer Apr 10, 2023
e25b5c9
Fix nativeaot libraries test build
sbomer Apr 10, 2023
0fe6ac6
Remove temporary PGO instrumentation legs
sbomer Apr 10, 2023
8406c40
Fix musl_arm tag
sbomer Apr 10, 2023
97a9faf
Remove left-over leg
sbomer Apr 10, 2023
bfad4ea
Merge remote-tracking branch 'origin/main' into marinerBuild
sbomer Apr 11, 2023
018e961
Merge remote-tracking branch 'origin/main' into marinerBuild
sbomer Apr 11, 2023
1e2e056
PR feedback
sbomer Apr 12, 2023
ba6001c
Update src/mono/mono.proj
sbomer Apr 12, 2023
92d1f22
Fix condition for mono aot flags
sbomer Apr 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@
Category="clr" />
</ItemGroup>

<!-- Build the CoreCLR cross-arch tools when we're doing a cross-architecture build and either we're building any CoreCLR native tools for platforms CoreCLR fully supports or when someone explicitly requests them -->
<ItemGroup Condition="(('$(ClrRuntimeBuildSubsets)' != '' and '$(PrimaryRuntimeFlavor)' == 'CoreCLR' and '$(TargetsMobile)' != 'true') or $(_subset.Contains('+clr.crossarchtools+'))) and '$(BuildArchitecture)' != '$(TargetArchitecture)'">
<!-- Build the CoreCLR cross tools when we're doing a cross build and either we're building any CoreCLR native tools for platforms CoreCLR fully supports or when someone explicitly requests them -->
<ItemGroup Condition="(('$(ClrRuntimeBuildSubsets)' != '' and '$(PrimaryRuntimeFlavor)' == 'CoreCLR' and '$(TargetsMobile)' != 'true') or $(_subset.Contains('+clr.crossarchtools+'))) and ('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)')">
<ProjectToBuild
Include="$(CoreClrProjectRoot)runtime.proj"
AdditionalProperties="%(AdditionalProperties);
Expand Down Expand Up @@ -325,7 +325,7 @@
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />

<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(TargetArchitecture)' != '$(BuildArchitecture)'" Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_crossarch.csproj" Category="clr" />
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and ('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)')" Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_crossarch.csproj" Category="clr" />
<ProjectToBuild Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)'" Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_crossarch.csproj" Category="clr" />

<ProjectToBuild Condition="'$(TargetOS)' == 'windows' or ('$(TargetOS)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')) or '$(TargetOS)' == 'osx'" Include="$(CoreClrProjectRoot)tools\SuperFileCheck\SuperFileCheck.csproj" Category="clr" />
Expand Down Expand Up @@ -367,8 +367,8 @@

<ItemGroup Condition="$(_subset.Contains('+clr.nativecorelib+'))">
<!-- Build crossgen2 that will be used to compile System.Private.CoreLib library for CoreCLR -->
<ProjectToBuild Condition="'$(TargetArchitecture)' != 'x64' and '$(BuildArchitecture)' == 'x64'" Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_crossarch.csproj" Category="clr" />
<ProjectToBuild Condition="!('$(TargetArchitecture)' != 'x64' and '$(BuildArchitecture)' == 'x64')" Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
<ProjectToBuild Condition="('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)') and '$(BuildArchitecture)' == 'x64'" Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_crossarch.csproj" Category="clr" />
<ProjectToBuild Condition="!(('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)') and '$(BuildArchitecture)' == 'x64')" Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)crossgen-corelib.proj" Category="clr" />
</ItemGroup>

Expand Down
6 changes: 4 additions & 2 deletions eng/common/cross/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "s390x")
set(TOOLCHAIN "s390x-linux-gnu")
elseif(TARGET_ARCH_NAME STREQUAL "x64")
set(CMAKE_SYSTEM_PROCESSOR x86_64)
if(LINUX)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl)
set(TOOLCHAIN "x86_64-alpine-linux-musl")
elseif(LINUX)
set(TOOLCHAIN "x86_64-linux-gnu")
if(TIZEN)
set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0")
Expand Down Expand Up @@ -279,7 +281,7 @@ endif()

# Specify compile options

if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU)
if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU)
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
Expand Down
2 changes: 1 addition & 1 deletion eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<CoreCLRSharedFrameworkDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework'))</CoreCLRSharedFrameworkDir>
<CoreCLRCrossgen2Dir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2'))</CoreCLRCrossgen2Dir>
<CoreCLRILCompilerDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc-published'))</CoreCLRILCompilerDir>
<CoreCLRCrossILCompilerDir Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)'">$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc'))</CoreCLRCrossILCompilerDir>
<CoreCLRCrossILCompilerDir Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)'">$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc'))</CoreCLRCrossILCompilerDir>
<CoreCLRAotSdkDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'aotsdk'))</CoreCLRAotSdkDir>
<CoreCLRBuildIntegrationDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'build'))</CoreCLRBuildIntegrationDir>

Expand Down
1 change: 1 addition & 0 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ while :; do
hostarch|-hostarch)
if [[ -n "$2" ]]; then
__HostArch="$2"
__ExplicitHostArch=1
shift
else
echo "ERROR: 'hostarch' requires a non-empty option argument"
Expand Down
5 changes: 3 additions & 2 deletions eng/native/tryrun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/s390x-alpine-linux-musl OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/ppc64le-alpine-linux-musl OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl OR
sbomer marked this conversation as resolved.
Show resolved Hide resolved
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl)

set(ALPINE_LINUX 1)
Expand Down Expand Up @@ -74,7 +75,7 @@ if(DARWIN)
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!")
endif()
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86)$" OR FREEBSD OR ILLUMOS OR TIZEN)
elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86|x64)$" OR FREEBSD OR ILLUMOS OR TIZEN)
set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0)
Expand Down Expand Up @@ -160,6 +161,6 @@ else()
message(FATAL_ERROR "Unsupported platform. OS: ${CMAKE_SYSTEM_NAME}, arch: ${TARGET_ARCH_NAME}")
endif()

if(TARGET_ARCH_NAME MATCHES "^(x86|s390x|armv6|loongarch64|riscv64|ppc64le)$")
if(TARGET_ARCH_NAME MATCHES "^(x86|x64|s390x|armv6|loongarch64|riscv64|ppc64le)$")
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
3 changes: 2 additions & 1 deletion eng/nativepgo.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>
<PropertyGroup>
<NativeOptimizationDataSupported Condition="'$(TargetOS)' == 'windows' And ('$(TargetArchitecture)' == 'x64' Or '$(TargetArchitecture)' == 'x86' Or '$(TargetArchitecture)' == 'arm64')">true</NativeOptimizationDataSupported>
<NativeOptimizationDataSupported Condition="'$(TargetOS)' == 'linux' And ('$(TargetArchitecture)' == 'x64' Or '$(TargetArchitecture)' == 'arm64')">true</NativeOptimizationDataSupported>
<!-- Disable PGO until we get profile data collected with a new clang -->
<NativeOptimizationDataSupported Condition="'$(TargetOS)' == 'linux' And ('$(TargetArchitecture)' == 'x64' Or '$(TargetArchitecture)' == 'arm64')">false</NativeOptimizationDataSupported>
sbomer marked this conversation as resolved.
Show resolved Hide resolved
<NativeOptimizationDataSupported Condition="'$(NoPgoOptimize)' == 'true'">false</NativeOptimizationDataSupported>
<NativeOptimizationDataSupported Condition="'$(Configuration)' != 'Release'">false</NativeOptimizationDataSupported>

Expand Down
10 changes: 6 additions & 4 deletions eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ jobs:
- name: _osParameter
value: /p:RuntimeOS=linux-bionic

# Do not rename as it clashes with MSBuild property in libraries/build-native.proj
- name: _crossBuildPropertyArg
value: /p:CrossBuild=${{ parameters.crossBuild }}
- name: crossArg
value: ''
- ${{ if eq(parameters.crossBuild, true) }}:
- name: crossArg
value: '-cross'

- ${{ if ne(parameters.jobParameters.crossrootfsDir, '') }}:
# This is only required for cross builds.
Expand Down Expand Up @@ -187,7 +189,7 @@ jobs:
- task: CodeQL3000Init@0
displayName: Initialize CodeQL (manually-injected)

- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter)
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) $(crossArg) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter)
displayName: Build product
${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}:
continueOnError: ${{ parameters.shouldContinueOnError }}
Expand Down
64 changes: 64 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
buildConfig: ${{ parameters.buildConfig }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
crossBuild: true
${{ insert }}: ${{ parameters.jobParameters }}

# Linux musl arm
Expand Down Expand Up @@ -222,6 +223,7 @@ jobs:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
buildConfig: ${{ parameters.buildConfig }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
crossBuild: true
${{ insert }}: ${{ parameters.jobParameters }}

# Linux x86
Expand Down Expand Up @@ -316,6 +318,68 @@ jobs:
isNonPortableSourceBuild: false
${{ insert }}: ${{ parameters.jobParameters }}

# GCC Linux x64 Build

- ${{ if containsValue(parameters.platforms, 'gcc_linux_x64') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: linux
archType: x64
targetRid: linux-x64
platform: linux_x64
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: debian-11-gcc12-amd64
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
buildConfig: ${{ parameters.buildConfig }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
compilerName: gcc
${{ insert }}: ${{ parameters.jobParameters }}

# Mono Linux arm64 product build

- ${{ if containsValue(parameters.platforms, 'mono_linux_arm64') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: linux
archType: arm64
targetRid: linux-arm64
platform: linux_arm64
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: mono_linux_arm64
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
buildConfig: ${{ parameters.buildConfig }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
crossBuild: true
${{ insert }}: ${{ parameters.jobParameters }}

# Mono LLVMAot test build

- ${{ if containsValue(parameters.platforms, 'linux_x64_llvmaot') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
osGroup: linux
archType: x64
targetRid: linux-x64
platform: linux_x64
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
container: linux_x64_llvmaot
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
buildConfig: ${{ parameters.buildConfig }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
${{ insert }}: ${{ parameters.jobParameters }}

# Linux s390x

- ${{ if containsValue(parameters.platforms, 'linux_s390x') }}:
Expand Down
30 changes: 23 additions & 7 deletions eng/pipelines/common/templates/pipeline-with-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
resources:
containers:
- container: linux_arm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230410173854-290f679
env:
ROOTFS_DIR: /crossrootfs/arm

Expand All @@ -14,21 +14,29 @@ resources:
env:
ROOTFS_DIR: /crossrootfs/armv6

- container: linux_arm64
# Use old build images until we can avoid a clang-12 crash: https://github.com/dotnet/runtime/issues/84503
- container: mono_linux_arm64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64
env:
ROOTFS_DIR: /crossrootfs/arm64

- container: linux_arm64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-20230410173854-2288685
env:
ROOTFS_DIR: /crossrootfs/arm64

- container: linux_musl_x64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine-20230410173854-2288685
env:
ROOTFS_DIR: /crossrootfs/x64

- container: linux_musl_arm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine-20230410173854-290f679
env:
ROOTFS_DIR: /crossrootfs/arm

- container: linux_musl_arm64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm64-alpine
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine-20230410173854-2288685
env:
ROOTFS_DIR: /crossrootfs/arm64
# This container contains all required toolsets to build for Android and for Linux with bionic libc.
Expand All @@ -37,10 +45,12 @@ resources:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android

- container: linux_x64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-20230410173854-2288685
env:
ROOTFS_DIR: /crossrootfs/x64

- container: linux_x86
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-x86-linux
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86-20230410173854-2288685
env:
ROOTFS_DIR: /crossrootfs/x86

Expand All @@ -59,6 +69,12 @@ resources:
env:
ROOTFS_DIR: /crossrootfs/ppc64le

- container: debian-11-gcc12-amd64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-gcc12-amd64
Comment on lines +72 to +73
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this PR, but can we consider moving this image to be based off Ubuntu 22.04 instead of Debian 11 (Debian 11 has an older CMake version than the one we want to use and IIRC I don't think we want to use the Kitware feed in our builds)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this a try.


- container: linux_x64_llvmaot
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7

Comment on lines +75 to +77
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we keeping the LLVMAOT build on the centos7 image? Same as the previous case?

Keeping this on CentOS 7 will delay some future infrastructure improvements in the repo (like upgrading CMake).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See description above - it's because the mono llvmaot test build depends on binutils (aot-compiler.c). I'd like to move this one over to the new images, but I'll ask @akoeplinger for guidance here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consider moving this to the CentOS Stream 8 image? That will get us onto something supported and off of CentOS 7.

Copy link
Member Author

@sbomer sbomer Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give this a try as well in a separate change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah we should be able to pass in the clang tools instead of binutils (I know xamarin-android does this already), can you please file a separate issue so we can take a look at that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #84700 to track this

- container: browser_wasm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-net8-20230322221728-80fdceb

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ steps:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }}
displayName: Build Tests
- ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }}
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(crossArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }}
displayName: Build Tests


Expand Down
21 changes: 4 additions & 17 deletions eng/pipelines/common/templates/runtimes/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:
runtimeVariant: ''
dependsOn: []
dependOnEvaluatePaths: false
crossBuild: false
pgoType: ''

### Build managed test components (native components are getting built as part
Expand All @@ -31,16 +32,13 @@ jobs:
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
crossBuild: ${{ parameters.crossBuild }}
container: ${{ parameters.container }}
runtimeVariant: ${{ parameters.runtimeVariant }}
testGroup: ${{ parameters.testGroup }}
pool: ${{ parameters.pool }}
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}

${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc'), not(and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl'))), not(eq(parameters.osGroup, 'osx'))) }}:
compilerArg: '-clang9'
${{ if not(and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc'), not(and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl'))), not(eq(parameters.osGroup, 'osx')))) }}:
compilerArg: ''
compilerArg: ''

# Test jobs should continue on error for internal builds
${{ if eq(variables['System.TeamProject'], 'internal') }}:
Expand Down Expand Up @@ -74,17 +72,6 @@ jobs:
value: 'libs.sfx+libs.oob+clr.iltools /p:RefOnly=true -c Release -ci'
- name: compilerArg
value: ''
- ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}:
- name: compilerArg
value: '-clang9'
# We need to use the stable version available on Alpine Linux
- ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl')) }}:
- name: compilerArg
value: ''
# AppleClang has different version scheme, so we let compiler introspection pick up the available clang from PATH
- ${{ if eq(parameters.osGroup, 'osx') }}:
- name: compilerArg
value: ''

- name: runtimeFlavorArgs
value: ''
Expand All @@ -109,7 +96,7 @@ jobs:
displayName: Install native dependencies

# Build core/libraries dependencies of test build
- script: $(Build.SourcesDirectory)/build$(scriptExt) $(liveRuntimeBuildParams) $(compilerArg)
- script: $(Build.SourcesDirectory)/build$(scriptExt) $(liveRuntimeBuildParams) $(crossArg) $(compilerArg)
displayName: Build coreclr/libs components needed by test build

- ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}:
Expand Down
Loading