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

rustc should emit an error when there's a bootstrap key mismatch #36544

Closed
brson opened this issue Sep 16, 2016 · 5 comments
Closed

rustc should emit an error when there's a bootstrap key mismatch #36544

brson opened this issue Sep 16, 2016 · 5 comments
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Sep 16, 2016

@glandium hit a situation today where he was trying to bootstrap from the wrong compiler, and because rustc didn't see a bootstrap key match it just didn't turn on unstable features, and resulted in a mysterious failure. An error about a bootstrap key mismatch would be much more clear.

Fix is probably in rustc::session::config where CFG_BOOTSTRAP_KEY is compared.

cc @alexcrichton

@brson brson added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-driver Area: rustc_driver that ties everything together into the `rustc` compiler labels Sep 16, 2016
@nagisa
Copy link
Member

nagisa commented Sep 16, 2016

Would completely break rustc for people who have $CFG_BOOSTRAP_KEY in their environment for non-rustc purposes. I’m not sure error is warranted, but note or warning may be fine.

@brson
Copy link
Contributor Author

brson commented Sep 16, 2016

@nagisa CFG_BOOTSTRAP_KEY is not the value being read at runtime, it's RUSTC_BOOTSTRAP_KEY.

@devin-wakefield
Copy link

Hey guys, I'm new and trying to figure this one out for everyone :) Go team!!

@brson, did @alexcrichton have CFG_DISABLE_UNSTABLE_FEATURES set as an environment flag? It looks like if you didn't have CFG_BOOTSTRAP_KEY or RUSTC_BOOTSTRAP_KEY flags set (both are checked in src/librustc/session/config.rs, in the function get_unstable_features_setting() ), but you had CFG_DISABLE_UNSTABLE_FEATURES set to false, you would be able to continue.

There's a match statement, and when either of the [CFG/RUSTC]_BOOTSTRAP_KEY values come up as None, then if CFG_DISABLE_UNSTABLE_FEATURES is set to false, I think it returns UnstableFeatures::Allow, but if CFG_DISABLE_UNSTABLE_FEATURES is set to true, then it returns UnstableFeatures::Disallow.

@alexcrichton
Copy link
Member

@VladDrakul I think the idea is that if this comparison returns != then a warning is issued, otherwise nothing happens.

@TimNN
Copy link
Contributor

TimNN commented Oct 25, 2016

I suppose this can be closed, now that bootstrap key checking has been disabled in #37265.

@TimNN TimNN closed this as completed Oct 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants