Repository navigation
Fix linux-bionic CI build breaks - #8009
Conversation
Enabling CoreCLR for linux-bionic (dotnet/runtime#131115) copied the Android configuration, but linux-bionic reports TargetOS as 'linux' and TargetsMobile as false, so the Android-shaped guards silently let it through. _BuildAnyCrossArch never fired for bionic: CrossBuild is false, BuildArchitecture equals TargetArchitecture, and HostOS equals TargetOS (both 'linux'). No cross-components build ran, leaving CrossHostArch empty, so AotCompilerCommon.props copied the NDK-built libjitinterface_x64.so into the crossgen2 output. The glibc host crossgen2 then failed to dlopen it: System.DllNotFoundException: Unable to load shared library 'jitinterface_x64' [...] liblog.so: cannot open shared object file linux-bionic is always cross-targeted via the NDK regardless of what HostOS/TargetOS report, so key the check on TargetsLinuxBionic. The same expression is duplicated in crossgen2.csproj and ILCompiler.ReadyToRun.Tests.csproj, so update those too. Separately, the NDK toolchain sets CMAKE_SYSTEM_NAME=Android, so CMake sees CLR_CMAKE_TARGET_ANDROID and skips CLR_CMAKE_BUILD_TOOLS. ilasm and ildasm are therefore never produced, but coreclr-packages.proj gated them only on TargetsMobile, which is false for bionic, breaking the arm64 leg: File not found: '.../linux.arm64.Release/ilasm' Also harden _BuildCdacPack, which passes every term for bionic while compile-native.proj disables SupportsNativeAotComponents for it. That is latent today only because bionic's default subsets omit 'tools'. Co-authored-by: Copilot <[email protected]> Copilot-Session: d6553736-6f22-41f2-9bd4-7223785d09e6
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run dotnet-unified-build-full |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Fixes CI failures in the VMR’s flowed src/runtime build logic for linux-bionic Shortstack legs by ensuring bionic is treated like a cross-targeted/NDK-driven platform where appropriate (rather than accidentally matching “plain linux” guards based on TargetOS=linux).
Changes:
- Treat
TargetsLinuxBionic=trueas a trigger for “cross-arch host tools/components required” in crossgen2 and R2R test JIT-build logic. - Exclude linux-bionic from ILAsm/ILDAsm and CDAC pack/build paths where artifacts are not produced under the NDK toolchain assumptions.
- Enable CoreCLR for linux-bionic
armby removing the priorarmexclusion (keeping the existingx86exclusion).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/ILCompiler.ReadyToRun.Tests.csproj | Forces cross-JIT build path for linux-bionic so host-loadable binaries are produced for R2R tests. |
| src/runtime/src/coreclr/tools/aot/crossgen2/crossgen2.csproj | Ensures bionic sets CrossHostArch so cross-components/host tool behavior matches bionic’s actual cross-targeting needs. |
| src/runtime/src/coreclr/.nuget/coreclr-packages.proj | Avoids packaging ILAsm/ILDAsm for linux-bionic where the toolchain path doesn’t produce them. |
| src/runtime/eng/Subsets.props | Updates bionic support matrix and subset gating: cross-arch tool build trigger, cdac pack exclusion, and enables CoreCLR for bionic arm. |
| src/runtime/eng/RuntimeIdentifier.props | Removes dead HostOS == 'win' PortableOS override (HostOS is windows). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run dotnet-unified-build-full |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run dotnet-unified-build-full |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run dotnet-unified-build-full |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
The PortableOS override was conditioned on HostOS being 'win', but eng/OSArch.props has only ever set HostOS to 'windows' on Windows, including at the commit that introduced this check in February 2025. HostOS is not overridden anywhere else; the pipelines pass AotHostOS, which is a different property. The condition has therefore never evaluated to true. Remove it rather than correcting the value, since making it fire would change TargetRid from linux-x64 to win-x64 for Windows-host builds that target another OS, long after everything downstream settled on it being inert. No behavior change: PortableOS and TargetRid are unchanged for windows-x64, linux-x64, linux-bionic-x64, android-arm64, and a Windows-host/linux-target build. Windows still resolves to 'win' through the separate 'windows' to 'win' normalization above. Co-authored-by: Copilot <[email protected]> Copilot-Session: d6553736-6f22-41f2-9bd4-7223785d09e6
dbf4218 to
9ce6292
Compare
|
Latest run (1529675) confirms the core fix: The bionic arm work turned out to be a bigger change than expected, so I have dropped it from this PR to unblock getting CI green. This PR is now just the two original fixes:
The three arm commits are preserved on the For the record, the arm leg now fails later, in the bundle rather than in restore: So the bundle wants the Mono runtime pack, which does not exist for bionic arm because |
|
/azp run dotnet-unified-build-full |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
relevant jobs on dotnet-unified-build-full are green, rest are unrelated infrastructure issues, merging |
The
LinuxBionic_Shortstack_x64andLinuxBionic_Shortstack_arm64legs have been failing since source update #7872 flowed in dotnet/runtime#131115 ("Enable CoreCLR for linux-bionic platforms").Regression window: build 1524524 (green) → 1526335 (red).
Root cause
dotnet/runtime#131115 enabled CoreCLR for linux-bionic by copying the Android configuration. But linux-bionic reports
TargetOSaslinux(notlinux-bionic) andTargetsMobileasfalse, so every Android-shaped guard silently let it through. The repo convention is to spell bionic out alongside mobile —$(TargetsMobile) != true and $(TargetsLinuxBionic) != true, as atSubsets.propslines 32, 49, 54, 733, 740 and 748 — and that pairing was only partly applied.x64:
jitinterface_x64fails to load_BuildAnyCrossArchnever fired for bionic:CrossBuildis false,BuildArchitectureequalsTargetArchitecture, andHostOSequalsTargetOS(bothlinux). Android escapes this only because itsTargetOSreally isandroid.With no cross-components build,
CrossHostArchstayed empty andAotCompilerCommon.propscopied the NDK-builtlibjitinterface_x64.sointo the crossgen2 output. The glibc-host crossgen2 then failed todlopenit — noteliblog.so, an Android-only library:linux-bionic is always cross-targeted via the NDK regardless of what
HostOS/TargetOSreport, so the check is keyed onTargetsLinuxBionic. The same expression is duplicated incrossgen2.csprojandILCompiler.ReadyToRun.Tests.csproj, so those are updated too.The fix is safe because the cross-components build passes
-hostos $(HostOS)=linux, andbuild-commons.shgates the NDK toolchain on that argument — so it correctly skips the NDK and produces glibc host binaries.arm64: ilasm/ildasm packaging
The NDK toolchain sets
CMAKE_SYSTEM_NAME=Android, so CMake seesCLR_CMAKE_TARGET_ANDROIDand skipsCLR_CMAKE_BUILD_TOOLS.ilasm/ildasmare therefore never produced, butcoreclr-packages.projgated them only onTargetsMobile:_SdkToolsSupportedOSalready treats bionic like mobile for exactly this reason, so this mirrors it. (x64 would have hit this too once the crossgen2 fix landed.)_BuildCdacPackhardening_BuildCdacPackpasses all four terms for bionic whilecompile-native.projdisablesSupportsNativeAotComponentsfor it — the same "pack requested, artifact never built" shape as the ilasm bug. Latent today only because bionics default subsets omittools; Android is blocked by two independent terms, bionic by none. Verified with/p:Subset=clr+tools+packs: bionic_BuildCdacPack=true, Android empty.Other commits
Enable CoreCLR for linux-bionic arm. The bionic line picked up an
armexclusion that Android had already dropped two months earlier (re-enabled 2026-05-21; blocking issue dotnet/runtime#111665 closed 2026-07-20). That issue was "fseeko/ftello not supported on arm32 and x86 below API level 24", andbuild-commons.shpinsANDROID_API_LEVELto 24, so it never applied here. This is the one commit that changes a currently-green leg —LinuxBionic_Shortstack_armwill build full CoreCLR arm32 for the first time. It is isolated to one line and can be dropped independently if that leg goes red.Remove dead HostOS check.
RuntimeIdentifier.propsoverrodePortableOSwhenHostOSiswin, butOSArch.propshas only ever setHostOStowindows— including at the commit that introduced the check in February 2025 — so it never fired. Removed rather than corrected, since making it fire would changeTargetRidfromlinux-x64towin-x64for Windows-host cross-target builds. No behavior change.Validation
Verified by MSBuild property/item evaluation, since a real linux-bionic build needs a Linux host plus the Android NDK:
_BuildAnyCrossArchbefore → afterTargetRid""→truelinux-bionic-x64true→truelinux-bionic-arm64true→truelinux-bionic-arm""→""linux-x64android-arm64ILAsm/ILDAsm and cdac now drop out for bionic only; Android and plain Linux are unaffected. CI is the real test.
These changes belong in dotnet/runtime and are made here to unblock CI; they should be backflowed.
This PR was prepared with GitHub Copilot CLI.