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

Support building on an arm64 host too #127

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

tianon
Copy link
Member

@tianon tianon commented Feb 3, 2025

cc @LaurentGoderre

(the rest of the image build is appropriately using the full compiler prefixes and arch-test to verify executability, even on amd64)

@tianon
Copy link
Member Author

tianon commented Feb 3, 2025

Doh, this will fail without emulation too:

hello-world/update.sh

Lines 23 to 29 in 6ad8af5

for h in amd64/*/hello; do
d="$(dirname "$h")"
b="$(basename "$d")"
"$h" > /dev/null
docker build -t hello-world:"test-$b" "$d"
docker run --rm hello-world:"test-$b"
done

I wish we had an easier way to invoke https://github.com/docker-library/bashbrew/blob/86212cac9100bf6163bc91a0560e7cbc6b1da995/scripts/bashbrew-host-arch.sh, which I guess would have to happen inside a container too since that's the real "arch" we're testing here (and may even be a remote system) 😭

@LaurentGoderre
Copy link
Member

I think this might be good enough for a first step?

@tianon
Copy link
Member Author

tianon commented Feb 3, 2025

I think I can do something ~simple to resolve it 😅

@tianon
Copy link
Member Author

tianon commented Feb 3, 2025

Oh, and we don't need https://github.com/docker-library/bashbrew/blob/86212cac9100bf6163bc91a0560e7cbc6b1da995/scripts/bashbrew-host-arch.sh because we already have the mappings, we just have to use/record them somewhere 😅 😇

This adds a `.host-arch` symlink to build output; this doesn't get committed (for hopefully obvious reasons), but allows for things like `CMD` and `update.sh` to have a known-effective target for testing the output further in some way.

This was a mapping we already had thanks to `ARCH_TEST`, so I've also reordered our builds such that they're grouped by "host" architecture and sorted by "preference"/compatibility (with the goal that we get a more "correct" `.host-arch` symlink).
@tianon
Copy link
Member Author

tianon commented Feb 3, 2025

This adds a .host-arch symlink to build output; this doesn't get committed (for hopefully obvious reasons), but allows for things like CMD and update.sh to have a known-effective target for testing the output further in some way.

This was a mapping we already had thanks to ARCH_TEST, so I've also reordered our builds such that they're grouped by "host" architecture and sorted by "preference"/compatibility (with the goal that we get a more "correct" .host-arch symlink).

@yosifkit yosifkit merged commit 337f857 into docker-library:master Feb 3, 2025
6 checks passed
@yosifkit yosifkit deleted the arm64-host branch February 3, 2025 22:12
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