-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustbuild: Build jemalloc and libbacktrace only once (take 2) #39329
Conversation
src/liballoc_jemalloc/build.rs
Outdated
} else if !target.contains("windows") && !target.contains("musl") { | ||
println!("cargo:rustc-link-lib=pthread"); | ||
} | ||
if !cfg!(stage0) { |
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.
Yeah I believe you're right in that this may break cross compiles. Perhaps !cfg!(stage0) && some_stamp_file.exists()
could be checked here? That "stamp" file could be created at the end of the build.
☔ The latest upstream changes (presumably #39252) made this pull request unmergeable. Please resolve the merge conflicts. |
This is exactly what I want to avoid - redoing The best solution is what the previous PR does - running |
Yeah |
Restored the solution from #38583, it's automatically correct regardless of rustbuild configuration or cross-compilation intricacies. |
@petrochenkov I've mentioned before though that this approach is empirically incorrect? For a number of reasons:
|
Ok, those are valid reasons. I'll have to move |
Actually, nevermind. This is still much faster than building libbacktrace and jemalloc. |
@bors: r+ Looks great, thanks! |
📌 Commit 0e41f13 has been approved by |
⌛ Testing commit 0e41f13 with merge f6ce61b... |
💔 Test failed - status-travis |
Hm, is this spurious or not? |
Nah I think that's a correct error, adding a new dependency here change the dependency graph. You can fix this though by appending |
@bors r=alexcrichton |
📌 Commit b4abb72 has been approved by |
rustbuild: Build jemalloc and libbacktrace only once (take 2) This is a rebase of #38583 without any additions, but with implemented @alexcrichton's suggestions. ~~This includes `exists(Makefile)` => `cfg(stage0)` suggestion... but it will break cross-compilation, no? Are `libstd/liballoc_jemalloc` cross-compiled for `target != host` built during `stage0`?~~ r? @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
This is a rebase of #38583 without any additions, but with implemented @alexcrichton's suggestions.
This includesexists(Makefile)
=>cfg(stage0)
suggestion... but it will break cross-compilation, no? Arelibstd/liballoc_jemalloc
cross-compiled fortarget != host
built duringstage0
?r? @alexcrichton