-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: Add a new -Z force-unstable-if-unmarked
flag
#41847
rustc: Add a new -Z force-unstable-if-unmarked
flag
#41847
Conversation
cc @eddyb |
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
src/bootstrap/bin/rustc.rs
Outdated
@@ -194,6 +194,8 @@ fn main() { | |||
// do that we pass a weird flag to the compiler to get it to do | |||
// so. Note that this is definitely a hack, and we should likely | |||
// flesh out rpath support more fully in the future. | |||
// | |||
// TODO: remove condition after next stage0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to this PR's primary changes, right? Just want to make sure...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! I just remembered to touch it up in this PR
src/librustc/middle/stability.rs
Outdated
// with the `rustc_private` feature. This is intended for use when | ||
// compiling librustc crates themselves so we can leverage crates.io | ||
// while maintaining the invariant that all sysroort crates are unstable | ||
// by default an are unable to be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*sysroot, *and
☔ The latest upstream changes (presumably #41709) made this pull request unmergeable. Please resolve the merge conflicts. |
d019abb
to
deafeca
Compare
@@ -1027,6 +1027,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, | |||
"add a source pattern to the file path remapping config"), | |||
remap_path_prefix_to: Vec<String> = (vec![], parse_string_push, [TRACKED], | |||
"add a mapping target to the file path remapping config"), | |||
force_unstable_if_unmarked: bool = (false, parse_bool, [TRACKED], | |||
"force all crates to be `rustc_private` unstable"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the `rustc_private be provided from rustbuild instead if being hardcoded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, yeah, but I'm not sure it'd buy much? We otherwise would still hardcode the issue number as well as the description of the unstable feature (the "note"), and passing all that info as CLI flags may not also be worth it :(.
Do you think we'll want different unstable features on differnet crates though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more that the flag name doesn't seem specific to rustc_private
. I don't care too much anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh we could also call it -Z tag-this-crate-with-rustc-private-unstable-feature-if-otherwise-unmarked
let is_staged_api = self.lookup_stability(DefId { | ||
index: CRATE_DEF_INDEX, | ||
..def_id | ||
}).is_some(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah this is what I didn't consider refactoring - it's much nicer!
This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
deafeca
to
43cd756
Compare
Legitimate tidy errors.
|
These are now no longer necessary with `-Z force-unstable-if-unmarked`
43cd756
to
ab54f4b
Compare
Fixed! |
@bors r+ |
📌 Commit ab54f4b has been approved by |
@bors p=1 Giving higher priority since I know this blocks at least a few other PRs. |
…ons, r=eddyb rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
…ons, r=eddyb rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
…ons, r=eddyb rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
rustc: Add a new `-Z force-unstable-if-unmarked` flag This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
☀️ Test successful - status-appveyor, status-travis |
This commit adds a new
-Z
flag to the compiler for use when bootstrapping thecompiler itself. We want to be able to use crates.io crates, but we also want
the usage of such crates to be as ergonomic as possible! To that end compiler
crates are a little tricky in that the crates.io crates are not annotated as
unstable, nor do they expect to pull in unstable dependencies.
To cover all these situations it's intended that the compiler will forever now
bootstrap with
-Z force-unstable-if-unmarked
. This flags serves a dual purposeof forcing crates.io crates to themselves be unstable while also allowing them
to use other "unstable" crates.io crates. This should mean that adding a
dependency to compiler no longer requires upstream modification with
unstable/staged_api attributes for inclusion!