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

only run --all-targets in stage0 for Std #99293

Merged
merged 2 commits into from
Aug 2, 2022

Conversation

jo3bingham
Copy link
Contributor

Repro'd the issue with python3 x.py check --stage 1 library/std and tested the fix with the same command.

r? @jyn514

I tried to implement this solution, but didn't have any luck. I don't think I fully understood what needed to be done. However, I would love to be mentored on it since it would be a more correct solution, and I can learn more about how bootstrap works.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 15, 2022
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jyn514 (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 15, 2022
@jyn514
Copy link
Member

jyn514 commented Jul 15, 2022

I tried to implement this solution, but didn't have any luck.

When you say didn't have luck, you mean it didn't fix the problem? Or you didn't understand it well enough to write code for it?

I think the code should be fairly simple, basically copy those two lines immediately before --all-targets.

@jo3bingham
Copy link
Contributor Author

jo3bingham commented Jul 15, 2022

When you say didn't have luck, you mean it didn't fix the problem? Or you didn't understand it well enough to write code for it?

I think the code should be fairly simple, basically copy those two lines immediately before --all-targets.

I wasn't sure if it was because I didn't understand it well enough or just that it didn't fix the problem, but I did copy those two lines before --all-targets and the errors were the same for me as it was without it:

builder.ensure(crate::compile::Std::new(compiler, compiler.host));
builder.ensure(crate::compile::Std::new(compiler, target));
cargo.arg("--all-targets");
error: could not compile `getrandom` due to 125 previous errors
error: could not compile `test` due to 566 previous errors
error: could not compile `proc_macro` due to 552 previous errors

EDIT:
I was mistaken, the errors I get from adding those two lines are different. Sample error and logs:

error: duplicate lang item in crate `core` (which `rustc_std_workspace_core` depends on): `sized`.
  |
  = note: the lang item is first defined in crate `core` (which `getrandom` depends on)
  = note: first definition in `core` loaded from \\?\C:\Users\joe.bingham\Documents\GitHub\rust\build\x86_64-pc-windows-msvc\stage1\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-62524b6728766064.rlib
  = note: second definition in `core` loaded from \\?\C:\Users\joe.bingham\Documents\GitHub\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\deps\libcore-94a2db40080734a4.rmeta

log.txt

@jyn514
Copy link
Member

jyn514 commented Jul 16, 2022

I was mistaken, the errors I get from adding those two lines are different. Sample error and logs:

Is this with or without calling add_to_sysroot? you can only do one or the other, calling add_to_sysroot and ensure(compile::Std) will lead to errors.

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2022
@jo3bingham
Copy link
Contributor Author

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 1, 2022
@jyn514
Copy link
Member

jyn514 commented Aug 1, 2022

👍 this seems good to me - it works around the error, and it seems exceedingly rare to want to check std tests compile without actually running them (in stage1, no less).

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 1, 2022

📌 Commit c5d661a has been approved by jyn514

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 1, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 2, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#99156 (`codegen_fulfill_obligation` expect erased regions)
 - rust-lang#99293 (only run --all-targets in stage0 for Std)
 - rust-lang#99779 (Fix item info pos and height)
 - rust-lang#99994 (Remove `guess_head_span`)
 - rust-lang#100011 (Use Parser's `restrictions` instead of `let_expr_allowed`)
 - rust-lang#100017 (kmc-solid: Update `Socket::connect_timeout` to be in line with rust-lang#78802)
 - rust-lang#100037 (Update rustc man page to match `rustc --help`)
 - rust-lang#100042 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3357470 into rust-lang:master Aug 2, 2022
@rustbot rustbot added this to the 1.64.0 milestone Aug 2, 2022
@jo3bingham jo3bingham deleted the issue-98720-fix branch August 2, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants