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

Add no-emulation support in build-rootfs #15370

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

am11
Copy link
Member

@am11 am11 commented Dec 31, 2024

Building rootfs currently requires emulation to run post-install, maintainers scripts. That mean qemu, debootstrap, binfmt all need to support the $newPlatform. Locally things work because docker/podman are typically supporting the new platform like loongarch64, but on Azure DevOps side, qemu is pretty old.

Once the rootfs environment is built, no part of the infra in runtime/diagnostics repos ever chroot into the rootfsdir. Instead, all we rely on is headers, libs and toolchains in place and --sysroot with host clang. The maintainers scripts can compile stuff post-install and create symlinks etc. Our use-cases are simple enough to avoid running maintainer scripts.

On Alpine Linux, it's just a matter of --no-scripts passed to apk add. debootstrap doesn't provide such option.

This PR:

Tested at dotnet/dotnet-buildtools-prereqs-docker#1306 with --skipemulation.

@am11
Copy link
Member Author

am11 commented Dec 31, 2024

cc @akoeplinger @janvorli, @shushanhf PTAL. It is parameterized properly and we can switch all other archs to this plan (basically just pass --skipemulation in any cross/Dockerfile using debian-likes and alpine), to remove qemu and debootstrap dependencies from our infra in prereqs repo. For now, I've only used it on LA64 new port dotnet/dotnet-buildtools-prereqs-docker#1306.

@am11 am11 force-pushed the feature/rootfs/no-emulation branch 2 times, most recently from 3ab7d52 to 8950419 Compare December 31, 2024 17:45
@am11 am11 force-pushed the feature/rootfs/no-emulation branch from 8950419 to da9e2c0 Compare December 31, 2024 22:54
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@shushanhf
Copy link
Contributor

@am11 @janvorli
Thanks very much.

@janvorli janvorli merged commit 24dfc75 into dotnet:main Jan 3, 2025
11 checks passed
@am11 am11 deleted the feature/rootfs/no-emulation branch January 3, 2025 09:56
akoeplinger pushed a commit to dotnet/dotnet-buildtools-prereqs-docker that referenced this pull request Jan 3, 2025
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.

3 participants