-
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
Add release and develop flags to configure #17665
Comments
I think a lot of systems (incl LLVM) call these options 'release' and 'debug' (not 'development'). The naming of the current Can we fold the current
The naming of Under the current configure script how do you even turn on Even if we turn off debug logging and asserts for release builds we should keep it on for snapshots. Let's please not land any changes here without updating the automation. |
Data point: LLVM (and I assume transitively clang since clang is part of the LLVM build) builds 'Release+Asserts' by default (not 'Release') which is more or less equivalent to what we do now. |
LLVM uses cmake which has a standard way of doing release vs. development builds. Using |
I would vote for this state of affairs:
I believe that the vast majority of builders of rust will want a very fast build and will not be distributing the binaries. It's much easier to recommend that one package maintainer turns on one or two flags as opposed to recommending that all users who download rust pass some set of many flags. Additionally, given the defaults above, our automation would do this:
The idea here is that the output should be as fast as possible so parallel codegen is disabled. On nightlies/releases we can removing debuginfo/debug logging. Note that whatever flags we use on nightlies/releases are also the flags that we would recommend to packagers. I personally don't think that If we pursue this strategy, then the changes from today would be:
|
I also think that |
Using Developers working on Rust itself can be expected to pass non-default flags. You can't really expect packagers for countless distributions to know which non-standard flags they should pass. It doesn't matter if you document it somewhere obscure, they will use the defaults. There will also always be users building it for themselves, and you can't really expect them to know that they're going to get a poorly performing Rust by default. |
Regarding debuginfo, apart from #14930 which needs to be tested again, I don't know of a crash bug at the moment. Just compiling with |
@brson I'm not attached to names, I'd be happy with --debug or making debug the default and just add --release. --debug is a make flag not a configure one, right? I think this has to be a configure thing to get the right versions of jemalloc and llvm. I think we might want to toggle things independently (e.g., to debug an optimised build), I was envisioning these things being umbrella flags. Not sure how to pass -g from configure to make, by assume it can't be too hard to make a way. There are a bunch of configure flags which are not --enable/--disable prefixed - libdir, llvm-root, etc. Although they do all take parameters and --release would not. --enable-release doesn't really make sense though, and --disable-debug is kind of wrong because it does more than just not emit debug info etc. Agree about the snapshots |
@alexcrichton with debuginfo as well as the flags you list, that is four flags that need to be toggled to get an optimum build, it seems to me that having either a release or debug umbrella flag is worth while (assuming the default is the other configuration). Infra would then use:
|
So the tricky question is the default. I agree with @alexcrichton that the majority of people who build rustc will want the develop/debug config, but also with @thestinger that packagers shouldn't have to mess around with flags and are likely to use the default. @thestinger are packagers likely to use a single |
Actually, @alexcrichton what is the motivation for having debug=on for snapshots? I never look at logging for that stage nor does the compiler really use debug-only asserts? If we get a big speed up without it, perhaps we could leave it off? |
Both debug assertions and debug logging are toggled via the same configuration flag. Since debug assertions are enabled by default, there is very little usage in the standard libraries. Extensive assertions like jemalloc would have too much cost unless they were disabled by default. |
If you want to make sure people use the right config, why not make |
@wizeman I would like to do this |
We discussed this in the weekly meeting. The conclusions were:
|
#18213 has enabled parallel codegen without the configure flags. |
Note that parallel code generation had to be disabled for now because it was breaking the build on systems with an up-to-date binutils. |
This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per rust-lang#17665. It does not add a `--enable-release` flag since that would be a no-op. cc @nrc Fixes rust-lang#22390 Fixes rust-lang#17081 Partially addresses rust-lang#17665
This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per rust-lang#17665. It does not add a `--enable-release` flag since that would be a no-op. cc @nrc Fixes rust-lang#22390 Fixes rust-lang#17081 Partially addresses rust-lang#17665
This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per #17665. It does not add a `--enable-release` flag since that would be a no-op. cc @nrc Fixes #22390 Fixes #17081 Partially addresses #17665
Closing because old. If somebody ever wants to pursue this again just start over. |
The set of flags for building rustc is getting bigger and the configuration for a release build versus something useful for developing is diverging.
We should add two flags to make
--release
and--develop
which are umbrella flags of sensible sets of flags. A release build should be make the optimal compiler and develop should balance compile time, debug info, and optimisation.--develop
should not be no-debug (i.e., include logging), should build jemalloc in debug mode, have all asserts on in llvm, should be an O2 build (I think, cc @epdtry), and should use parallel builds with 4 threads.--release
should be no-debug (see #17496), should build release versions of jemalloc and llvm, should be O3, and should not use parallel builds.Setting any individual flags should override these settings.
Open questions: should
--develop
include debuginfo by default? (Does this even work at the moment, I know there have been bugs recently. cc @michaelwoerister)Are there other flags that should be set?
Can we do this as proposed? I assume configure can set different defaults for make. (cc @alexcrichton)
Which should be the default? (Or should the user be forced to specify one or the other). I think @thestinger has made a good argument elsewhere that --release should be the default since it is more unfortunate if a packager makes a mistake than a developer.
The text was updated successfully, but these errors were encountered: