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

Give a better error for cargo check on libstd itself #79021

Closed
wants to merge 1 commit into from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Nov 13, 2020

Or, Abusing rust-toolchain For Fun and Profit.

Before: hundreds of errors about Sized not being implemented for types in core
After:

$ cargo check
error: invalid channel name 'use x.py instead: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html' in '/home/joshua/rustc/rust-toolchain'
error: caused by: invalid toolchain name: 'use x.py instead: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html'

r? @Mark-Simulacrum
Closes #76446, fixes #76444.

Unlike #76446, this requires no changes to people trying to build the standard library out-of-tree, and also works for cargo fmt.

Before: hundreds of errors about `Sized` not being implemented for types
in `core`
After:

```
$ cargo check
error: invalid channel name 'use x.py instead: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html' in '/home/joshua/rustc/rust-toolchain'
error: caused by: invalid toolchain name: 'use x.py instead: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html'
```
@jyn514 jyn514 added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Nov 13, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 13, 2020
@jyn514
Copy link
Member Author

jyn514 commented Nov 13, 2020

Unlike #76446, this requires no changes to people trying to build the standard library

err, I'm not actually sure that's true - cargo check in library/test also gives this error. I'm not sure how things are built out of tree - do they include the whole rust-lang/rust repo? Or just library/?

@oli-obk
Copy link
Contributor

oli-obk commented Nov 13, 2020

Question: could we just have a rust-toolchain file that always points to the right (usually beta) compiler to be used? I'm sure this has been asked before, but could not find any discussion about why this is not gonna work

@jyn514
Copy link
Member Author

jyn514 commented Nov 13, 2020

@oli-obk that breaks rustfmt: #76419 (comment). But I would like to do that eventually.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 13, 2020

Ah, thanks for the link! Yea, too bad rustfmt on beta doesn't contain what we need and can just be RUST_BOOTSTRAPped

@ehuss
Copy link
Contributor

ehuss commented Nov 13, 2020

I would prefer not to do this. Not all commands go through x.py. Things like cargo tree or cargo update are still run in-tree, and I believe this would break them. I also use cargo check/build in-tree for things that support it.

@jyn514
Copy link
Member Author

jyn514 commented Nov 13, 2020

Ugh, yeah you're right this breaks cargo tree :(

I guess we're back to build scripts? I don't know a way to tell xargo/xbuild apart from cargo though.

@Mark-Simulacrum
Copy link
Member

Yes, I agree that breaking cargo tree and similar is an unfortunate consequence. I think we should not do this in that case, sorry.

@jyn514 jyn514 deleted the better-errors branch November 14, 2020 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

Give a better error message when running cargo test on libstd itself
5 participants