Closed athre0z closed 4 years ago
This might be somewhat similar to #9. It looks like this is down to cmake-rs
choosing to do CMake debug, release or minsize builds based on the opt-level as well as a few other factors (click, click) which isn't exactly matched by the same decision logic in mimalloc-rs
' build.rs that determines which lib to link against.
I kind of see three ways of fixing this:
.profile("3")
, hardcoding optimized builds for mimalloc
cmake-rs
' logic for deciding the profilecmake-rs
people whether it might be possible to export this code that does the automatic decision via an API, so that we can just reuse it. This will probably take a while.@athre0z Hi and thank you for opening this!
I would honestly go with option 2. We can read the PROFILE and OPT_LEVEL env variables and determine the correct paths according to the same logic the cmake-rs
crate follows.
I believe this might also provide a fix for #9.
Fixed in #16
Overriding
opt-level
in the profile section ofCargo.toml
can cause the build to fail in some configurations.Configurations tested:
All configurations have been tested on macOS 10.15 using
rustc 1.43.0-nightly (61d9231ff 2020-02-15)
, however the issue is also reproducible on stable.I attached an example project to experiment with. mimalloc-bug.tar.gz