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

Slightly optimize cargo vendor #8937

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

alexcrichton
Copy link
Member

I've noticed recently that cargo vendor feels really sluggish and
slow, and apparently this is primarily because we delete the registry
caches and re-extract all the tarballs. This commit implements one
possible optimization without changing this, however, which is that
currently we both copy a file and checksum it, but that ends up reading
all the contents twice. Those two functions are now folded into one,
shaving about 3s locally from Cargo's own vendor times.

I've noticed recently that `cargo vendor` feels really sluggish and
slow, and apparently this is primarily because we delete the registry
caches and re-extract all the tarballs. This commit implements one
possible optimization without changing this, however, which is that
currently we both copy a file and checksum it, but that ends up reading
all the contents twice. Those two functions are now folded into one,
shaving about 3s locally from Cargo's own vendor times.
@rust-highfive
Copy link

r? @Eh2406

(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 Dec 3, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Dec 3, 2020

Seams good.

@ehuss
Copy link
Contributor

ehuss commented Dec 4, 2020

@bors r=Eh2406

@bors
Copy link
Contributor

bors commented Dec 4, 2020

📌 Commit 01f1c01 has been approved by Eh2406

@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 Dec 4, 2020
@bors
Copy link
Contributor

bors commented Dec 4, 2020

⌛ Testing commit 01f1c01 with merge 5c40b7f...

@bors
Copy link
Contributor

bors commented Dec 4, 2020

☀️ Test successful - checks-actions
Approved by: Eh2406
Pushing 5c40b7f to master...

@bors bors merged commit 5c40b7f into rust-lang:master Dec 4, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 8, 2020
Update cargo

10 commits in 63d0fe43449adcb316d34d98a982b597faca4178..d274fcf862b89264fa2c6b917b15230705257317
2020-12-02 01:44:30 +0000 to 2020-12-07 23:08:44 +0000
- Clarify cargo manifest edition field docs (rust-lang/cargo#8953)
- Run rustdoc doctests relative to the workspace (rust-lang/cargo#8954)
- Workaround fs issue in `cargo publish`. (rust-lang/cargo#8950)
- Fix panic with -Zbuild-std and no roots. (rust-lang/cargo#8942)
- Slightly optimize `cargo vendor` (rust-lang/cargo#8937)
- Fixes rust-lang/cargo#8783 , cargo new fails without a author name or email (rust-lang/cargo#8912)
- Fix test escaping __CARGO_TEST_ROOT (rust-lang/cargo#8929)
- Add period to allowed feature name characters. (rust-lang/cargo#8932)
- faq: small fixes (rust-lang/cargo#8931)
- Fix semver documentation tests. (rust-lang/cargo#8930)
bors added a commit that referenced this pull request Feb 4, 2021
[BETA] Revert "Slightly optimize `cargo vendor`"

This reverts #8937, which seems to have caused a permission issue.

cc #9127
bors added a commit that referenced this pull request Feb 4, 2021
Fix permission issue with `cargo vendor`.

I think there was an unintended regression in #8937 where the vendored output does not retain the original permissions.

Fixes #9127.
danieldk added a commit to danieldk/nixpkgs that referenced this pull request May 8, 2021
Rust 1.50.0 incorporated a Cargo change (rust-lang/cargo#8937) in
which cargo vendor erroneously changed permissions of vendored
crates. This was fixed in Rust
1.51.0 (rust-lang/cargo#9131). Unfortunately, this means that all
cargoSha256/cargoHashes produced during the Rust 1.50.0 cycle are
potentially broken.

This change updates cargoSha256/cargoHash tree-wide.

Fixes NixOS#121994.
jonringer pushed a commit to NixOS/nixpkgs that referenced this pull request May 8, 2021
Rust 1.50.0 incorporated a Cargo change (rust-lang/cargo#8937) in
which cargo vendor erroneously changed permissions of vendored
crates. This was fixed in Rust
1.51.0 (rust-lang/cargo#9131). Unfortunately, this means that all
cargoSha256/cargoHashes produced during the Rust 1.50.0 cycle are
potentially broken.

This change updates cargoSha256/cargoHash tree-wide.

Fixes #121994.
@ehuss ehuss added this to the 1.50.0 milestone Feb 6, 2022
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.

5 participants