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

Warn when checking library/std when profile = "compiler" #78466

Open
varkor opened this issue Oct 28, 2020 · 13 comments
Open

Warn when checking library/std when profile = "compiler" #78466

varkor opened this issue Oct 28, 2020 · 13 comments
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. 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.

Comments

@varkor
Copy link
Member

varkor commented Oct 28, 2020

I expect these two commands to do the same thing, but for check or build, respectively. However, check may succeed even if build fails type checking. I suspect the syntax for check is a subset of that for build.

@varkor varkor 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) labels Oct 28, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 28, 2020

@varkor can you give an example of code that succeeds for check but fails for build?

@jyn514 jyn514 added the C-bug Category: This is a bug. label Oct 28, 2020
@varkor
Copy link
Member Author

varkor commented Oct 28, 2020

I edited some code in compiler/rustc_middle/src/infer/canonical.rs. This had a type-checking error in it, but x.py check library/std succeeded. When I ran x.py check (without specifying a path), it emitted an error as expected. x.py build library/std emitted an error with the path specified.

@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

@varkor I think this is actually related to staging: x.py build library/std builds the stage0 compiler artifacts before building stage1 libstd with the newly built compiler. x.py check always uses stage 0, so x.py check library/std doesn't build the compiler.

@varkor
Copy link
Member Author

varkor commented Jan 1, 2021

@jyn514: x.py check (without the path) emitted the correct error. Does this mean the check stage is affected by the path?

@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

@varkor yes, the same as build. If you run x.py check compiler/rustc for example, that won't check rustdoc.

@varkor
Copy link
Member Author

varkor commented Jan 1, 2021

@jyn514: are you saying that x.py check library/std will literally only check library/std, using the definitions from the stage0 artefacts, without taking account of the current compiler changes (i.e. those which would be built for stage1)?

@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

@varkor yes: x.py check library/std is roughly analogous to RUSTFLAGS=--profile=check x.py build --stage 0 library/std. There's not currently a way to check with stage1, although I'd like to add one: #46955 (comment)

@jyn514 jyn514 changed the title x.py check library/std does not work analogously to x.py build library/std x.py check library/std always uses stage 0 Jan 1, 2021
@varkor
Copy link
Member Author

varkor commented Jan 1, 2021

Okay, I see. I don't necessarily think there needs to be an option to change the stage: it should just match whatever build does (though this will also take some work to implement).

@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

@varkor well, if it matches build then you'd have to build the entire compiler before checking the stage 1 standard library, which would double or triple the time. So I don't think stage 1 should be the default.

@jyn514 jyn514 added C-discussion Category: Discussion or questions that doesn't represent real issues. and removed C-bug Category: This is a bug. labels Jan 1, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

We decided the best approach is to warn on x.py check library/std if you have profile = "compiler" set (and recommend x.py check instead).

@jyn514 jyn514 changed the title x.py check library/std always uses stage 0 Warn when checking library/std when profile = "compiler" Jan 1, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 1, 2021

I changed the title since #46955 already tracks --stage 1 support for x.py check.

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

This would be helped by my proposal in https://jyn.dev/2023/01/12/Bootstrapping-Rust-in-2023.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. 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

No branches or pull requests

3 participants
@varkor @jyn514 and others