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

Omit stdarch test crates from the rust-src component #94907

Merged
merged 1 commit into from
Mar 13, 2022

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Mar 13, 2022

These crates aren't necessary for building the standard library. This saves 30MB of disk space.

Fixes #94906

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 13, 2022
@bjorn3
Copy link
Member Author

bjorn3 commented Mar 13, 2022

@bors try

Just to be able to do a sanity check that -Zbuild-std doesn't break with this.

@bors
Copy link
Contributor

bors commented Mar 13, 2022

⌛ Trying commit 027d019c0e2a78fe9dd2b162dd9c3d0b8015ee83 with merge 549b2d65748f5d0c931bafbc58b53389ac8318d7...

@Mark-Simulacrum
Copy link
Member

try build is done (549b2d65748f5d0c931bafbc58b53389ac8318d7), and r=me presuming -Zbuild-std works for you, ideally with commits squashed.

@Mark-Simulacrum Mark-Simulacrum 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 Mar 13, 2022
These crates aren't necessary for building the standard library. This
saves 30MB of disk space.

Fixes rust-lang#94906
@bjorn3 bjorn3 force-pushed the smaller_rust_src_component branch from 0c95b2d to cd5e75a Compare March 13, 2022 16:42
@bjorn3
Copy link
Member Author

bjorn3 commented Mar 13, 2022

cargo +549b2d65748f5d0c931bafbc58b53389ac8318d7 run -Zbuild-std=std --target x86_64-unknown-linux-gnu works for me. Squashed.

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Mar 13, 2022

📌 Commit cd5e75a has been approved by Mark-Simulacrum

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 13, 2022
@bjorn3
Copy link
Member Author

bjorn3 commented Mar 13, 2022

The new src directory is 27MB vs 57MB before this change.

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 13, 2022
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#93292 (Implement `BITS` constant for non-zero integers)
 - rust-lang#94777 (Update armv7-unknown-linux-uclibceabi platform support page.)
 - rust-lang#94816 (Add `Atomic*::get_mut_slice`)
 - rust-lang#94844 (Reduce rustbuild bloat caused by serde_derive)
 - rust-lang#94907 (Omit stdarch test crates from the rust-src component)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c7030d3 into rust-lang:master Mar 13, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 13, 2022
@bjorn3 bjorn3 deleted the smaller_rust_src_component branch March 14, 2022 11:00
@@ -821,6 +821,11 @@ impl Step for Src {
// not needed and contains symlinks which rustup currently
// chokes on when unpacking.
"library/backtrace/crates",
// these are 30MB combined and aren't necessary for building
// the standard library.
"library/stdarch/crates/Cargo.toml",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been

"library/stdarch/Cargo.toml",

I think. In Rust 1.61.0, rust-src includes src/rust/library/stdarch/Cargo.toml, which includes

[workspace]
members = [
  "crates/stdarch-verify"

This didn't show up when testing with -Zbuild-std since the standard list of crates to include when building std does not include stdarch, but it will show up if a user explicitly requests stdarch. Or, perhaps more importantly, because of #95736, many editors (like IntelliJ) won't treat the root of rust-src as a workspace, and will instead recurse into all the sub-crates directly, which then includes stdarch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, my bad.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed #97228 with a fix 👍

jonhoo pushed a commit to jonhoo/rust that referenced this pull request May 20, 2022
The path `library/stdarch/crates/Cargo.toml` does not exist.

This was introduced in rust-lang#94907.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 22, 2022
Omit stdarch workspace from rust-src

The path `library/stdarch/crates/Cargo.toml` does not exist.

In Rust 1.61.0, `rust-src` still includes `src/rust/library/stdarch/Cargo.toml` (but not `stdarch-verify`), which includes
```toml
[workspace]
members = [
  "crates/stdarch-verify"
```

This didn't show up when testing with `-Zbuild-std` in rust-lang#94907 since the [standard list of crates](https://github.com/rust-lang/cargo/blob/f624095e1c98228a74a165ddb702078c0dd8b81e/src/cargo/core/compiler/standard_lib.rs#L26-L30) to include when building `std` does not include `stdarch`, but it will show up if a user explicitly requests `stdarch`. Or, perhaps more importantly, because of rust-lang#95736, many editors (like IntelliJ) won't treat the root of `rust-src` as a workspace, and will instead recurse into all the sub-crates directly, which then includes `stdarch`.

Also related to rust-lang#94906.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude stdarch/crates/{stdarch-verify,intrinsic-test} from rust-src component
6 participants