Skip to content

Fix public/unofficial CI NativeAOT cross-build for ARM/ARM64/musl legs - #67252

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:infrastructure/ci-public-nativeaot-crossbuild
Jun 17, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:infrastructure/ci-public-nativeaot-crossbuild

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Jun 16, 2026

Copy link
Copy Markdown
Member

Ports the fix from #67158 (which only touched the internal ci.yml) to ci-public.yml (def 83) and ci-unofficial.yml.

Why

Codeflow #66933 (preview.6.26280, ~Jun 1) made dotnet-dev-certs, dotnet-user-secrets, and dotnet-user-jwts publish NativeAOT for every bundled RID. The cross Build legs (Linux ARM/ARM64/musl-x64/musl-arm/musl-arm64) lacked a cross toolchain + sysroot, so ILC's lld cross-link fails with ld.lld: cannot open Scrt1.o / unable to find library -ldl/-lrt/-lm/-lgcc. This breaks those 5 legs on every public-CI build.

Fix

Run the affected legs in the azurelinux cross-prereq containers with ROOTFS_DIR=/crossrootfs/<arch> and -p:CrossBuild=true, mirroring #67158:

  • ci-public.yml: inline cross images + per-leg ROOTFS_DIR variable + -p:CrossBuild=true (ARM64 leg threads CrossBuild through its inline ./eng/build.sh script).
  • ci-unofficial.yml: adds the 5 named cross container resources and references them per-leg with the same ROOTFS_DIR + -p:CrossBuild=true.

Co-authored-by: Copilot [email protected]

The dotnet-dev-certs/dotnet-user-secrets/dotnet-user-jwts tools now publish
NativeAOT for every bundled RID (added by VMR backflow dotnet#66933). The ARM, ARM64
and musl Build legs in ci-public.yml and ci-unofficial.yml lacked a native cross
toolchain, so ILC's lld cross-link failed (missing Scrt1.o / --sysroot / clang).

Run these 5 legs in the dotnet-buildtools azurelinux cross-prereq containers
(clang + /crossrootfs/<arch>), set ROOTFS_DIR, and pass /p:CrossBuild=true so
LocateNativeCompiler.targets sets SysRoot=$(ROOTFS_DIR) and ILC emits
--sysroot/--target. Mirrors the internal ci.yml fix from dotnet#67158.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 16, 2026 23:17
@wtgodbe
wtgodbe requested a review from a team as a code owner June 16, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the public and unofficial Azure Pipelines definitions to run the Linux ARM/ARM64 and musl cross-build legs inside the AzureLinux cross-prereq containers and to enable NativeAOT cross-build configuration, preventing NativeAOT cross-link failures due to missing sysroot/toolchain on those legs.

Changes:

  • ci-public.yml: switches the affected Linux ARM/ARM64/musl legs to AzureLinux cross-prereq container images, sets ROOTFS_DIR, and passes -p:CrossBuild=true.
  • ci-unofficial.yml: adds named cross-prereq container resources and updates the same five legs to use them with per-leg ROOTFS_DIR plus -p:CrossBuild=true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.azure/pipelines/ci-public.yml Runs cross-build legs in AzureLinux cross-prereq containers and enables CrossBuild + ROOTFS_DIR for NativeAOT cross-linking.
.azure/pipelines/ci-unofficial.yml Adds cross container resources and updates the five cross-build legs to use them with ROOTFS_DIR + CrossBuild.

@wtgodbe
wtgodbe requested a review from DamianEdwards June 17, 2026 00:04
@wtgodbe
wtgodbe merged commit db6ba68 into dotnet:main Jun 17, 2026
27 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants