-
Notifications
You must be signed in to change notification settings - Fork 18
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
cross-compile container images #138
Conversation
Converting to draft because of the usage of |
5bbd90a
to
44c55ca
Compare
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.
Cool stuff 👏
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 for this, this is great! I'm amazed that the compilation time went down to 15 minutes.
Did we talk about performance of running code already? I have read that Musl is not as efficient as libc on mem allocation. I suppose not a problem for our usage, but maybe worth checking.
With this, we will be moving our targets from Rust Tier 1 (guaranteed to work) to Tier 2 (guaranteed to build). For x86_64 this means a reduction in assurances. I suppose it's not a problem, but something to also have in mind.
d068e08
to
887d683
Compare
887d683
to
084f95c
Compare
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.
LGTM! yay!
Do we want to cross-compile on development too?
I tried here cargo build --target x86_64-unknown-linux-musl
and it failed on the ring issue, so from what I understand it's not using .cargo/config
.
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.
Overall great 👏
I left some comments here and there
- run: rustup target add aarch64-unknown-linux-musl | ||
- name: Setup musl for aarch64 | ||
run: | | ||
curl -O https://musl.cc/aarch64-linux-musl-cross.tgz |
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.
Same here
Actually that would be nice, just to be able to reproduce bugs locally... |
084f95c
to
8ea2432
Compare
I also agree. I think is a good strategy. I would push for that right after this work. We can discuss about it. My preferred mechanism would be to have this as a nix project, so our dependencies are pinned and easily built (no need to fill pre-requirements prior to build other than having nix installed). I think is worth checking, let me know if that's good with you and if you think we should plan for that soon. |
You can manually do this already, but is not pretty. Let me know if this fixes the build & link issue for you.
Same for targeting aarch64 from x86_64:
This should work AFAICT. |
6bf20a8
to
ff0df95
Compare
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.
I think there's still some work going on, am I right? This doesn't look ready to be merged
462a08f
to
08078f4
Compare
e2bba6f
to
b2afddd
Compare
This is mergeable. I was testing GitHub behaviors when building the container image. Certain parts are a bit of trial and error. It's good now. |
11a3d1a
to
d431a64
Compare
Create multi-arch container images by first cross compiling the binaries for the different platforms, and then creating the container images by copying the binaries.
d431a64
to
101bdf1
Compare
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.
LGTM! :D
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.
Great, go ahead with it 👏
Create multi-arch container images by first cross compiling the
binaries for the different platforms, and then creating the container
images by copying the binaries.