Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd release and develop flags to configure #17665
Comments
nrc
added
A-build
A-infrastructure
labels
Sep 30, 2014
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
LLVM uses cmake which has a standard way of doing release vs. development builds. Using |
This comment has been minimized.
This comment has been minimized.
|
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:
|
This comment has been minimized.
This comment has been minimized.
|
I also think that |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
@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 |
This comment has been minimized.
This comment has been minimized.
|
@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:
|
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
If you want to make sure people use the right config, why not make |
This comment has been minimized.
This comment has been minimized.
|
@wizeman I would like to do this |
This comment has been minimized.
This comment has been minimized.
|
We discussed this in the weekly meeting. The conclusions were:
|
This comment has been minimized.
This comment has been minimized.
|
#18213 has enabled parallel codegen without the configure flags. |
This comment has been minimized.
This comment has been minimized.
|
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. |
alexcrichton
referenced this issue
Jan 8, 2015
Closed
mk: Disable extra debugging on the non-dev release channels. #20713 #20715
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Apr 9, 2015
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Apr 9, 2015
bors
added a commit
that referenced
this issue
Apr 9, 2015
This was referenced Apr 26, 2015
brson
closed this
Aug 22, 2016
This comment has been minimized.
This comment has been minimized.
|
Closing because old. If somebody ever wants to pursue this again just start over. |
nrc commentedSep 30, 2014
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
--releaseand--developwhich 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.--developshould 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.--releaseshould 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
--developinclude 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.