-
Notifications
You must be signed in to change notification settings - Fork 13k
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
mk: Move disable-jemalloc logic into makefiles #31846
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @brson Unfortunately this all seems basically super brittle because... makefiles. I've tested though by having a local change that disables jemalloc for i686-unknown-linux-gnu, and I then configured both that + x86_64 and ran a full make check until everything passed. That at least gives me a relatively high amount of confidence in this! |
@bors r+ |
📌 Commit 0af6b65 has been approved by |
⌛ Testing commit 0af6b65 with merge 996ea14... |
💔 Test failed - auto-win-msvc-64-opt |
The `--disable-jemalloc` configure option has a failure mode where it will create a distribution that is not compatible with other compilers. For example the nightly for Linux will assume that it will link to jemalloc by default as an allocator for executable crates. If, however, a standard library is used which was built via `./configure --disable-jemalloc` then this will fail because the jemalloc crate wasn't built. While this seems somewhat reasonable as a niche situation, the same mechanism is used for disabling jemalloc for platforms that just don't support it. For example if the rumprun target is compiled then the sibiling Linux target *also* doesn't have jemalloc. This is currently a problem for our cross-build nightlies which build many targets. If rumprun is also built, it will disable jemalloc for all targets, which isn't desired. This commit moves the platform-specific disabling of jemalloc as hardcoded logic into the makefiles that is scoped per-platform. This way when configuring multiple targets **without the `--disable-jemalloc` option specified** all targets will get jemalloc as they should.
0af6b65
to
b980f22
Compare
⌛ Testing commit b980f22 with merge 7bfdb5a... |
⛄ The build was interrupted to prioritize another pull request. |
The `--disable-jemalloc` configure option has a failure mode where it will create a distribution that is not compatible with other compilers. For example the nightly for Linux will assume that it will link to jemalloc by default as an allocator for executable crates. If, however, a standard library is used which was built via `./configure --disable-jemalloc` then this will fail because the jemalloc crate wasn't built. While this seems somewhat reasonable as a niche situation, the same mechanism is used for disabling jemalloc for platforms that just don't support it. For example if the rumprun target is compiled then the sibiling Linux target *also* doesn't have jemalloc. This is currently a problem for our cross-build nightlies which build many targets. If rumprun is also built, it will disable jemalloc for all targets, which isn't desired. This commit moves the platform-specific disabling of jemalloc as hardcoded logic into the makefiles that is scoped per-platform. This way when configuring multiple targets **without the `--disable-jemalloc` option specified** all targets will get jemalloc as they should.
@alexcrichton What about Surely, the idea is not new, and @brson seems to like it - are there any caveats? |
To me |
Ok, how would you go about changing the default allocator permanently, leaving the |
By changing this line in the relevant target. |
Thanks for the suggestion - what about a more user-friendly |
I was under the impression we don't want it as a configure switch? If jemalloc is inferior on some platforms we should just always turn it off by default. |
Jemalloc is highly tunable so having the crate at your disposal makes sense, even though it's turned off by default. Right now, this scenario is not easily bootstrappable. |
The
--disable-jemalloc
configure option has a failure mode where it willcreate a distribution that is not compatible with other compilers. For example
the nightly for Linux will assume that it will link to jemalloc by default as
an allocator for executable crates. If, however, a standard library is used
which was built via
./configure --disable-jemalloc
then this will failbecause the jemalloc crate wasn't built.
While this seems somewhat reasonable as a niche situation, the same mechanism is
used for disabling jemalloc for platforms that just don't support it. For
example if the rumprun target is compiled then the sibiling Linux target also
doesn't have jemalloc. This is currently a problem for our cross-build nightlies
which build many targets. If rumprun is also built, it will disable jemalloc for
all targets, which isn't desired.
This commit moves the platform-specific disabling of jemalloc as hardcoded logic
into the makefiles that is scoped per-platform. This way when configuring
multiple targets without the
--disable-jemalloc
option specified alltargets will get jemalloc as they should.