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: Add a new -Z force-unstable-if-unmarked flag #41847

Merged
merged 3 commits into from
May 13, 2017

Conversation

alexcrichton
Copy link
Member

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!

@alexcrichton
Copy link
Member Author

cc @eddyb

@rust-highfive
Copy link
Collaborator

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -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
Copy link
Member

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...

Copy link
Member Author

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

@arielb1 arielb1 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 9, 2017
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*sysroot, *and

@bors
Copy link
Contributor

bors commented May 9, 2017

☔ The latest upstream changes (presumably #41709) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -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"),
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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();
Copy link
Member

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!
@Mark-Simulacrum
Copy link
Member

Legitimate tidy errors.

[00:01:56] Building stage0 tool tidy (x86_64-unknown-linux-gnu)
[00:01:57]    Compiling tidy v0.1.0 (file:///checkout/src/tools/tidy)
[00:02:04]     Finished release [optimized] target(s) in 6.87 secs
[00:02:04] tidy check (x86_64-unknown-linux-gnu)
[00:02:04] tidy error: /checkout/src/bootstrap/bin/rustc.rs:198: TODO is deprecated; use FIXME
[00:02:04] tidy error: /checkout/src/bootstrap/bin/rustc.rs:228: TODO is deprecated; use FIXME
[00:02:04] tidy error: /checkout/src/bootstrap/lib.rs:529: TODO is deprecated; use FIXME
[00:02:05] some tidy checks failed

These are now no longer necessary with `-Z force-unstable-if-unmarked`
@alexcrichton
Copy link
Member Author

Fixed!

@alexcrichton
Copy link
Member Author

I think @pnkfelix may be on leave, @eddyb mind reviewing this?

@eddyb
Copy link
Member

eddyb commented May 12, 2017

@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2017

📌 Commit ab54f4b has been approved by eddyb

@Mark-Simulacrum
Copy link
Member

@bors p=1

Giving higher priority since I know this blocks at least a few other PRs.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 12, 2017
…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!
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 12, 2017
…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!
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 12, 2017
…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!
bors added a commit that referenced this pull request May 12, 2017
@bors
Copy link
Contributor

bors commented May 13, 2017

⌛ Testing commit ab54f4b with merge 4f3886a...

bors added a commit that referenced this pull request May 13, 2017
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!
@bors
Copy link
Contributor

bors commented May 13, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 4f3886a to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants