Skip to content
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

reorder config.toml.example options and add one missing option #65408

Merged
merged 7 commits into from
Oct 25, 2019

Conversation

guanqun
Copy link
Contributor

@guanqun guanqun commented Oct 14, 2019

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 14, 2019
@guanqun
Copy link
Contributor Author

guanqun commented Oct 14, 2019

This is based on the discussion in this issue: #65352

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 14, 2019
@guanqun guanqun force-pushed the remove-rust-optimize branch 2 times, most recently from afef9f6 to fb5789f Compare October 14, 2019 15:09
@guanqun
Copy link
Contributor Author

guanqun commented Oct 14, 2019

So I just removed the documentation part, internally the flag is still there.

@Mark-Simulacrum
Copy link
Member

Perfect, thanks!

@bors r+ rollup=always

cc @rust-lang/compiler on this change but I believe it should be uncontroversial so approving -- this is just hiding the optimize flag from the documentation since it is an "advanced" feature and we don't expect 99.9% of contributors to change it, or indeed really anyone.

@bors
Copy link
Contributor

bors commented Oct 14, 2019

📌 Commit fb5789f0b23ffde6608f69817130230958d45a5c has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 14, 2019
@Zoxc
Copy link
Contributor

Zoxc commented Oct 14, 2019

I personally consider everything in config.toml advanced features and I'd like to keep it.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 14, 2019

I am tempted to r- the PR because I personally am in @Zoxc's camp that everything config.toml is "advanced features", and I don't think people should have to go grepping through the rust-build infrastructure to discover options like this ...

... the main reason why I have balked at r-'ing the PR is that I am not aware of anyone who has gotten utility from setting optimize = false... so, is having this big block of text in the config.toml buying us anything ...?

The one thing that I think this big block of text does buy us is this: Clarity as to what are the effects of debug = true.

If you apply this PR, some people might infer (incorrectly) that setting debug = true will disable optiimizations of the stdlib and compiler.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 14, 2019

@bors r-

Lets at least touch on this in the Thursday compiler team meeting.

(that is: nominating for discussion at compiler team meeting.)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 14, 2019
@pnkfelix pnkfelix added I-nominated S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 14, 2019
@Mark-Simulacrum
Copy link
Member

Sounds good :)

To be clear I don't personally have much opinion here; I think I agree as to ambiguity of debug. I mainly wanted to land this to avoid further bug reports about optimize = false not working on some platforms, which I closed in the belief that said mode was not supported. One option is to just say "the option exists but we really only support = true" and leave it in.

But I'm happy to discuss at the meeting.

@Zoxc
Copy link
Contributor

Zoxc commented Oct 14, 2019

I use debug builds sometimes to get accurate stack traces. It's a bit slow, but using a parallel compiler helps a lot.

-Z share-generics is required for debug builds on Windows to not hit PE limitations. We should probably apply that for Windows (or for all platforms?).

@Mark-Simulacrum
Copy link
Member

I use debug builds sometimes to get accurate stack traces. It's a bit slow, but using a parallel compiler helps a lot.

When you say "a bit slow" -- prior issues/PRs have noted >10x slowdown which I would imagine makes bootstrapping impossible; does a parallel compiler actually help a lot here?

@Zoxc
Copy link
Contributor

Zoxc commented Oct 14, 2019

Usually you just need to build libcore or libstd with the debug compiler to debug it.

The parallel compiler helps much more than normally since LLVM is still as fast and the overhead of atomics is less since everything else is slower.

@JohnTitor JohnTitor added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 14, 2019
@guanqun
Copy link
Contributor Author

guanqun commented Oct 14, 2019

Thank you @Zoxc for the inputs, I'm fine not to merge this change, then we probably need to re-open this ticket #65352 because if it's exposed, we probably should make it work on Windows platform as well.

@nikomatsakis
Copy link
Contributor

My two cents:

I do not think we should have options that are not commented. I consider config.toml.example the "canonical documentation" for all options available and I would be quite surprised that there are things missing from there.

However, I think we can just add a stronger note on optimize = true to say something like:

# WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping,
# building without optimizations takes much longer than optimizing. Further, some platforms
# (notably Windows) fail to build without this optimization (c.f. #65352).

@guanqun
Copy link
Contributor Author

guanqun commented Oct 18, 2019

I can try to figure out the missing options.

for the optimize flag, I can simply copy niko's sentences above if everyone is okay with it.

@nikomatsakis
Copy link
Contributor

@guanqun works for me, obviously =)

(to be clear, I also think we can close #65352 if we have no intention to fix it)

@guanqun
Copy link
Contributor Author

guanqun commented Oct 20, 2019

oh, I do spot one missing option, it's the musl-root in the [rust] section. It's added in the commit.

@guanqun guanqun changed the title Remove rust optimize reorder config.toml.example options and add one missing option Oct 20, 2019
@Mark-Simulacrum
Copy link
Member

Could you split the commit into 3:

  • reordering the options
  • editing the optimize flag text
  • adding musl-root

This'll make the commit history a bit better.

Other than that I'm personally probably fine with this, although we might instead prefer to edit the source code to match the ordering in config.toml.example, since that seems to be the "source of truth" more so than the code IMO.

config.toml.example Outdated Show resolved Hide resolved
@guanqun
Copy link
Contributor Author

guanqun commented Oct 21, 2019

I thought for a few seconds which would be the "source of truth" as you mentioned above, :) I lean towards the code, but it seems Mark is on the config.toml.example side.

I'll wait for one more day before I update the commit. So my plan would be:

  1. recorder the fields based on the config.toml.exmaple's order (according to @Mark-Simulacrum 's suggestion above)
  2. split commits into separate functionalities (add the musl-root and modify the optimize comments)

@nikomatsakis
Copy link
Contributor

I mean the code is obviously the real source of truth, but I think people are more likely to peruse this file (certainly I did). It's length also strongly suggests it is exhaustive.

I don't really care if we make the code match the toml or vice versa -- but having them be the same makes sense.

@Mark-Simulacrum
Copy link
Member

I mean the code is obviously the real source of truth, but I think people are more likely to peruse this file (certainly I did). It's length also strongly suggests it is exhaustive.

I think this is sort of not true -- in the sense that the code today is just haphazardly ordered whereas config.toml.example has had at least some thought put into it.

@nikomatsakis nikomatsakis removed the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Oct 24, 2019
@nikomatsakis
Copy link
Contributor

Removing the S-waiting-on-team tag since I think we've decided.

@guanqun
Copy link
Contributor Author

guanqun commented Oct 24, 2019

I've split the commits into three categories:

  1. add a warning to rust.optimize option
  2. add the missing rust.musl_root option
  3. reorders the fields (I'm following the orders in config.toml.example)

@Mark-Simulacrum @nikomatsakis Could you please help review again?

@rust-lang rust-lang deleted a comment from nikomatsakis Oct 24, 2019
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=always

Thanks for bearing with the process so far!

I'm going to approve this as I believe we're in a "this changes almost nothing" state -- and we had consensus I believe on the warning being added.

@bors
Copy link
Contributor

bors commented Oct 24, 2019

📌 Commit 5defe06 has been approved by Mark-Simulacrum

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 24, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 25, 2019
…k-Simulacrum

reorder config.toml.example options and add one missing option

r? @Mark-Simulacrum
bors added a commit that referenced this pull request Oct 25, 2019
Rollup of 9 pull requests

Successful merges:

 - #62959 (Add by-value iterator for arrays )
 - #65390 (Add long error explanation for E0576)
 - #65408 (reorder config.toml.example options and add one missing option)
 - #65414 (ignore uninhabited non-exhaustive variant fields)
 - #65666 (Deprecated proc_macro doesn't trigger warning on build library)
 - #65742 (Pre-expansion gate most of the things)
 - #65747 (Adjust the tracking issue for `untagged_unions`.)
 - #65763 (Changed APIT with explicit generic args span to specific arg spans)
 - #65775 (Fix more `ReEmpty` ICEs)

Failed merges:

 - #65519 (trait-based structural match implementation)

r? @ghost
@bors bors merged commit 5defe06 into rust-lang:master Oct 25, 2019
@guanqun guanqun deleted the remove-rust-optimize branch October 25, 2019 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants