-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refactor Dockerfile #1594
Refactor Dockerfile #1594
Conversation
e7a7188
to
e0e0db8
Compare
So, I've tested the Dockerfile in most configurations imaginable: native and cross-comile builds on both ARM and x86 (on M1 Mac, through docker virtualization; takes ages :/), without My results:
I've currently pushed a change with
Note the times for |
Oh, and BTW, is unstripped debug build for linux 900-1000 MB!? UPD: It is. 🙈 |
I ran the four commands at 09a5ed6, see my results below. Notice that I did add
I ran this on Ubuntu (Linux 5.19 x86_64), AMD Ryzen 9 5900X (12/24 cores), 32GB RAM. I guess that for release builds there are no visible improvements (outside the margin of error). |
09a5ed6
to
a59442a
Compare
Figured why release Docker builds failed on my Mac... it was RAM. Increased RAM limit available to Docker to 12GB and it works now. Didn't note the build time (before I've |
4a2722d
to
559bed6
Compare
559bed6
to
aca7221
Compare
Rebased to current Here's a comparison between "cold" builds. Left is this PR (aca7221, CI link), right is #1859 (d0933e5, CI link). And here's a comparison between "cold" build (aca7221, CI link) and "hot" build (dbbac23, CI link) in this PR. And, for the reference, "cold" build (d0933e5, CI link) and "hot" build (d4e4453, CI link) in the #1859. |
- fix cross-compilation - improve caching TODO: - check if `lld` is used/works for linkage (and enable if not used, or remove if doesn't work)
1ee2a14
to
57c6a0e
Compare
Rebased on recent |
Here is my checklist:
If those checked, then - LGTM |
@generall I'll verify all of these once again (a bit) later, but unless something got accidentally broken recently, all of them should be good. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@generall I've tested the Dockerfile once again and marked most items in the checklist. I need help testing on AMD64 host (as I only have macOS, which is ARM). I think sufficient tests would be:
All of these works on my machine. E.g., "plain" |
@ffuugoo I'll give these a spin. I'm on Linux with amd64. |
@ffuugoo All builds ( For cross compilation with Cache works with I used |
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 work on this! Don't see any real problems based on a quick inspection.
Co-authored-by: Tim Visée <tim+github@visee.me>
* Refactor Dockerfile - fix cross-compilation - improve caching TODO: - check if `lld` is used/works for linkage (and enable if not used, or remove if doesn't work) * Remove `aarch64` linker config from `.cargo/config.toml` (seems to be unnecessary) * Expose `LINKER` argument and enable `lld` linker * Add `mold` linker support * Document Dockerfile * Add closing ` in the Dockerfile comments Co-authored-by: Tim Visée <tim+github@visee.me> --------- Co-authored-by: Tim Visée <tim+github@visee.me>
Refactored Dockerfile:
aarch64
host tox86_64
targetbuilder
stagePROFILE
,FEATURES
,RUSTFLAGS
andLINKER
options/parameters as DockerfileARG
sARG
directives for better cachingTODO:
lld
is used/works for linkagemold
linkermold
is not in the Debian 11 repos...