Skip to content

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

@varkor

Description

@varkor
Member

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.

Activity

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Oct 28, 2020
jyn514

jyn514 commented on Oct 28, 2020

@jyn514
Member

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

varkor

varkor commented on Oct 28, 2020

@varkor
MemberAuthor

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

jyn514 commented on Jan 1, 2021

@jyn514
Member

@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

varkor commented on Jan 1, 2021

@varkor
MemberAuthor

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

jyn514

jyn514 commented on Jan 1, 2021

@jyn514
Member

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

varkor

varkor commented on Jan 1, 2021

@varkor
MemberAuthor

@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

jyn514 commented on Jan 1, 2021

@jyn514
Member

@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)

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[/+] on Jan 1, 2021
varkor

varkor commented on Jan 1, 2021

@varkor
MemberAuthor

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

jyn514 commented on Jan 1, 2021

@jyn514
Member

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

added
C-discussionCategory: Discussion or questions that doesn't represent real issues.
and removed
C-bugCategory: This is a bug.
on Jan 1, 2021
jyn514

jyn514 commented on Jan 1, 2021

@jyn514
Member
jyn514

jyn514 commented on Jan 1, 2021

@jyn514
Member

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

changed the title [-]`x.py check library/std` always uses stage 0[/-] [+]Warn when checking `library/std` when `profile = "compiler"`[/+] on Jan 1, 2021
jyn514

jyn514 commented on Jan 1, 2021

@jyn514
Member

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

jyn514

jyn514 commented on Feb 3, 2023

@jyn514
Member

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @varkor@jyn514

        Issue actions

          Warn when checking `library/std` when `profile = "compiler"` · Issue #78466 · rust-lang/rust