-
Notifications
You must be signed in to change notification settings - Fork 619
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
[Rosetta] Prioritize rosetta over qemu-user-static
by creating binfmt.d(5)
configuration
#2474
[Rosetta] Prioritize rosetta over qemu-user-static
by creating binfmt.d(5)
configuration
#2474
Conversation
bf0bfc3
to
52fb3eb
Compare
I haven't read the PR yet, but I have 2 questions so far:
|
I am trying to create an aarch64 binary of SwiftLint in my docker-swiftlint repo. While I was able to cross-compile the aarch64 binary using the x86_64 version of the Swift Toolchain, I encountered issues with crashes and hangs when running that aarch64 binary within a Dockerfile using To avoid this issue, I tried various methods of installing
After none of these methods resolved the issue, I tried using After your question, I investigated which distribution of I'll answer the second question in the next post. |
6f54d36
to
003f82a
Compare
I have fixed the issue with the
|
Another difference between |
I fixed the mount error that was occurring on Alpine due to this PR. |
Regarding binfmt, the behavior should remain unchanged on non-systemd machines. |
I cannot reproduce the kernel panic that occurred in the failed integration test on my local x86_64 machine.
|
837b249
to
b6580e4
Compare
Me too, this issue seems specific to the infra of GHA |
Sometime `qemu-user-static` interpreters are registered with `systemd-binfmt.service(8)` by creating configuration files for `binfmt.d(5)`. By creating a `binfmt.d(5)` configuration for Rosetta, Rosetta will be prioritized over `qemu-user-static` regardless of the execution timing of `systemd-binfmt.service(8)`. In subsequent startups, Rosetta will already be registered with binfmt_misc at this stage, so a check has been added to prevent errors due to duplicate registrations. Signed-off-by: Norio Nomura <[email protected]>
After creating the `binfmt.d(5)` configuration for Rosetta, `systemd-binfmt.service(8)` attempts to register at an earlier stage in subsequent boots. To prevent errors from not finding the Rosetta interpreter, `user-data` is used to mount the Rosetta volume earlier. Signed-off-by: Norio Nomura <[email protected]>
Signed-off-by: Norio Nomura <[email protected]>
Since the mount option workaround for selinux to vz-rosetta will be covered in 05-lima-mounts.sh. Signed-off-by: Norio Nomura <[email protected]>
If `binfmt.d/rosetta.conf` already exists, Rosetta might already be registered by the time this script is called. To apply the settings in `lima.yml`, if Rosetta is already registered, the script will remove `binfmt.d/rosetta.conf` and unregister it from `binfmt_misc`. Signed-off-by: Norio Nomura <[email protected]>
b6580e4
to
5ef067b
Compare
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
And there are additional patches that are only applied to the Docker Desktop version: https://github.com/tonistiigi/binfmt/blob/015fe68a09f75b84e7cf84cc54466d3add6d01c5/docker-bake.hcl#L80-L86 I've not had time to look into why these patches are relevant to Docker Desktop but not to other uses of I wish somebody could figure out what the ideal version would be for Lima and add it to our docs! |
Thanks! 🙏 |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [lima-vm/lima](https://github.com/lima-vm/lima) | minor | `v0.22.0` -> `v0.23.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>lima-vm/lima (lima-vm/lima)</summary> ### [`v0.23.1`](https://github.com/lima-vm/lima/releases/tag/v0.23.1) [Compare Source](lima-vm/lima@v0.23.0...v0.23.1) #### Changes - Fixed the CI to generate the release note ([#​2555](lima-vm/lima#2555)) #### Usage ```console [macOS]$ limactl create [macOS]$ limactl start ... INFO[0029] READY. Run `lima` to open the shell. [macOS]$ lima uname Linux ``` *** The binaries were built automatically on GitHub Actions. The build log is available for 90 days: https://github.com/lima-vm/lima/actions/runs/10441930092 The sha256sum of the SHA256SUMS file itself is `e93a48f3a011c25367da50ab3609bb28437fcde259371f005f8b234caa46efff` . *** Release manager: [@​AkihiroSuda](https://github.com/AkihiroSuda) ### [`v0.23.0`](https://github.com/lima-vm/lima/releases/tag/v0.23.0) [Compare Source](lima-vm/lima@v0.22.0...v0.23.0) - YAML: - Add a `param` field for defining variables ([#​2498](lima-vm/lima#2498), thanks to [@​norio-nomura](https://github.com/norio-nomura)) - vz: - Prioritize rosetta over qemu-user-static ([#​2474](lima-vm/lima#2474), thanks to [@​norio-nomura](https://github.com/norio-nomura)) - Configura AOT caching options using an abstract socket ([#​2489](lima-vm/lima#2489), thanks to [@​norio-nomura](https://github.com/norio-nomura)) - Templates: - add `alpine-image` ([#​2360](lima-vm/lima#2360), thanks to [@​jandubois](https://github.com/jandubois)) - remove `centos-stream-8`, `deprecated/centos-7` ([#​2457](lima-vm/lima#2457)) - update to the latest revisions ([#​2553](lima-vm/lima#2553)) - Governance: - MAINTAINERS: invite Oleksandr Redko ([@​alexandear](https://github.com/alexandear)) as a Reviewer ([#​2383](lima-vm/lima#2383)) Full changes: https://github.com/lima-vm/lima/milestone/46?closed=1 Thanks to [@​AdamKorcz](https://github.com/AdamKorcz) [@​AmedeeBulle](https://github.com/AmedeeBulle) [@​SmartManoj](https://github.com/SmartManoj) [@​afbjorklund](https://github.com/afbjorklund) [@​alexandear](https://github.com/alexandear) [@​danchr](https://github.com/danchr) [@​fwilhe2](https://github.com/fwilhe2) [@​jandubois](https://github.com/jandubois) [@​norio-nomura](https://github.com/norio-nomura) [@​tcooper](https://github.com/tcooper) [@​why168](https://github.com/why168) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
This change aims to ensure that Rosetta is prioritized over
qemu-user-static
when both are installed. The key steps and intentions of this change include:Creating a
binfmt.d(5)
Configuration for Rosetta: This configuration ensures that Rosetta is registered withsystemd-binfmt
, taking precedence overqemu-user-static
.Early Mounting of Rosetta Volume: Using
user-data
to mount the Rosetta volume earlier in the boot process, preventing errors related to the Rosetta interpreter not being found bysystemd-binfmt.service(8)
.Duplicate Registration Check: Adding a check to avoid errors from duplicate registrations in binfmt_misc during subsequent startups, ensuring smooth operation when Rosetta is already registered.
The expected methods for installing
qemu-user-static
are as follows:docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
on a Docker rootful VM.apt-get install qemu-user-static
within the provision script inlima.yaml
.Both methods create configuration files for
binfmt.d(5)
.Thanks,