-
Notifications
You must be signed in to change notification settings - Fork 128
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
opt-level = 0 + debug=false does not produce no-debuginfo bins #79
Comments
I'm not personally intimately familiar enough with cmake to know how to fix this myself, but your patch seems reasonable to me! I sort of wish we could just tell it what flags we want in the axes that we have, but having a workaround in the meantime should be fine. Want to send a PR for those changes? |
Yeah, I'll send a patch when I get it working. It may be reasonable to just translate rust's options directly to |
I don't have an answer, but I just wanted to put this thought out there. Currently,
Here's one alternative that gives
Perhaps you could move the |
I think that the algorithm I suggested in #79 (comment) is a reasonable and simple change that would handle the corner cases mentioned by @brson, but I'm not sure if it's the best way to go in the long term. If it's given that the goal of a With that in mind, perhaps it would be useful to have
|
Having more options seems reasonable to me! I'm not really sure which is the best way but having a few to try seems reasonable. |
Thanks for the suggestions @spl |
From the linked tikv thread, it may end up that we use debuginfo=1 for release mode. CMake itself doesn't seem to make any distinction between debuginfo levels, just on or off. And furthermore, by my recollection, cargo itself doesn't provide the debuginfo level to the build script, just on or off. So for the tikv use case we may not be able to get what we want out of cargo and cmake-rs. (the equivalent of opt-level=3 + debuginfo=1 for cmake projects). Unfortunately rocksdb is a big chunk of our binary and our debuginfo. If the above scenario happens we may just have to hack up or build script for our fork of rocksdb. |
cmake-rs tries to translate cargo settings to cmake settings, but there are two cases where the debuginfio settings are ignored. The first is opt-level=0 + debug=false. This picks the CMake Debug profile, which always has debuginfo on.
The second is opt-level=s + debug=true. This picks MinSizeRel, which always has debuginfo off.
Solving this in the general case looks hard. I have begun trying to do it by running the cmake configure step once with the
-LA
flags, to list the configured values ofCMAKE_C_FLAGS_DEBUG
(etc); modify those flags, then run the actual configuration.I think it's a viable solution, but I haven't quite gotten there: https://github.com/brson/cmake-rs/tree/dev-nodebug
This is a problem in TiKV where we are turning off debuginfo to improve compile times, but RocksDB makes up a huge chunk of that debuginfo. cc tikv/tikv#4711
We could probably solve this one-off in librocksdb_sys, but it would seem better to solve it for everybody.
The text was updated successfully, but these errors were encountered: