Skip to content

x check --stage 1 std doesn't work #98720

Closed

Description

@WaffleLapkin

For me currently x b --stage 1 library/std works fine, while x c --stage 1 library/std with a lot of errors related to core not being found.

error: could not compile ppv-lite86 due to 750 previous errors
error: could not compile test due to 60 previous errors
error: could not compile proc_macro due to 2 previous errors

This is the commit that I'm trying to check: c68cd2f

I had the same problem previously too, but it usually solves magically after rebase / x clean / etc. However the usual "reboot router" kind of solutions doesn't seem to help this time :')

Full output: log.txt

Activity

  1. changed the title [-]checking std doesn't work[/-] [+]`x check --stage 1 std` doesn't work[/+] on Jun 30, 2022
  2. ehuss commented on Jun 30, 2022

    @ehuss
    Contributor

    It's not really clear to me how #81064 was supposed to work, but commenting out this line makes it work for me.

  3. jyn514 commented on Jul 14, 2022

    @jyn514
    Member

    Found the issue. I broke this when I added --all-targets in #88094. Not exactly sure why it's breaking, but it seems fine to me to only run --all-targets in stage 0.

    Mentoring instructions: change

    cargo.arg("--all-targets");
    to only run in stage 0.

  4. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    C-bugCategory: This is a bug.
    on Jul 14, 2022
  5. jyn514 commented on Jul 14, 2022

    @jyn514
    Member

    It's not really clear to me how #81064 was supposed to work, but commenting out this line makes it work for me.

    The way it works is by building all of libstd before checking the compiler:

    rust/src/bootstrap/check.rs

    Lines 195 to 202 in 601c5a2

    if compiler.stage != 0 {
    // If we're not in stage 0, then we won't have a std from the beta
    // compiler around. That means we need to make sure there's one in
    // the sysroot for the compiler to find. Otherwise, we're going to
    // fail when building crates that need to generate code (e.g., build
    // scripts and their dependencies).
    builder.ensure(crate::compile::Std::new(compiler, compiler.host));
    builder.ensure(crate::compile::Std::new(compiler, target));

    That works fine and makes it ok not to call add_to_sysroot in check, but the same step is missing before checking tests and examples. That would be an alternate fix; call builder.ensure(compile::Std) before --all-targets, not just before building the compiler.

  6. jyn514 commented on Jul 14, 2022

    @jyn514
    Member

    Hmm, I wonder if we should start using --extern noprelude:core in bootstrap to avoid all these sysroot shenanigans. It would make the code a lot simpler I think, and avoid having to compile things twice.

  7. jo3bingham commented on Jul 15, 2022

    @jo3bingham
    Contributor

    @rustbot claim

  8. jo3bingham commented on Jul 15, 2022

    @jo3bingham
    Contributor

    @jyn514 is the fix here to still only run --all-targets in stage0, or is your latest comment a better solution? If the latter, is that an easy solution? This is my first contribution to rust so I'm not well versed on how bootstrap, or anything else for that matter, works.

  9. jyn514 commented on Jul 15, 2022

    @jyn514
    Member

    @jo3bingham my second comment is a harder but more correct solution. I would accept either as PRs, neither are terribly hard.

    (My third comment about sysroots I think is the ideal solution, but involves several large refactors to bootstrap and isn't a good first PR.)

  10. jyn514 commented on Jul 15, 2022

    @jyn514
    Member

    Take a look at the bootstrapping section of the dev guide, especially the bit about contributing: https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#contributing-to-bootstrap

  11. added a commit that references this issue on Aug 2, 2022
  12. jo3bingham commented on Aug 2, 2022

    @jo3bingham
    Contributor

    Fixed by #99293. I forgot to link the issue in the PR, but this can be closed now that it has merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions