Skip to content

Include vendored sources in the rust-src component#156196

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
bjorn3:vendor_stdlib
May 18, 2026
Merged

Include vendored sources in the rust-src component#156196
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
bjorn3:vendor_stdlib

Conversation

@bjorn3
Copy link
Copy Markdown
Member

@bjorn3 bjorn3 commented May 5, 2026

In the future this can be used by build-std, but until then it is still useful for allowing rust-analyzer to work offline.

This increases the unpacked size by 24MB (from 116MB to 140MB) and the compressed size by only 2MB (from 18MB to 20MB)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 5, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 5, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789

@bjorn3
Copy link
Copy Markdown
Member Author

bjorn3 commented May 5, 2026

After this change rust-analyzer will use the vendored standard library sources out of the box, no need to modify rust-analyzer or change any config.

In the future this can be used by build-std, but until then it is still
useful for allowing rust-analyzer to work offline.

This increases the unpacked size by 24MB (from 116MB to 140MB) and the
compressed size by only 2MB (from 18MB to 20MB)
@Fabian-Gruenbichler
Copy link
Copy Markdown
Contributor

gave this a spin, looks good to me and would allow us to undo a manual workaround we will probably soon add to the Debian rust-src package for improved build-std support.

@Mark-Simulacrum
Copy link
Copy Markdown
Member

@bors r+ rollup=iffy

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

📌 Commit 8714345 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 May 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 10, 2026
…acrum

Include vendored sources in the rust-src component

In the future this can be used by build-std, but until then it is still useful for allowing rust-analyzer to work offline.

This increases the unpacked size by 24MB (from 116MB to 140MB) and the compressed size by only 2MB (from 18MB to 20MB)
rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #156196 (Include vendored sources in the rust-src component)
 - #156357 (tests: ip*_properties: avoid parsing the IP over and over again)
 - #156389 (prepare fs tests for miri)
 - #153975 (remove forever-deprecated and hidden `f64` methods)
 - #156147 (Update ICU4X to 2.2)
 - #156375 (kernel_copy tests: properly join background threads)
 - #156282 (Update `sysinfo` version to `0.39.0`)
 - #156392 (Improve doc comments for f32::ceil() and f32::floor())
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
Include vendored sources in the rust-src component

In the future this can be used by build-std, but until then it is still useful for allowing rust-analyzer to work offline.

This increases the unpacked size by 24MB (from 116MB to 140MB) and the compressed size by only 2MB (from 18MB to 20MB)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 10, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

💔 Test for a6ba4ae failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
#156415 (comment)

@rust-bors rust-bors Bot 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 May 11, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 11, 2026

This PR was contained in a rollup (#156415), which was unapproved.

View changes since this unapproval

@bjorn3
Copy link
Copy Markdown
Member Author

bjorn3 commented May 11, 2026

@bors try job=x86_64-gnu-distcheck

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 11, 2026
Include vendored sources in the rust-src component


try-job: x86_64-gnu-distcheck
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 11, 2026

☀️ Try build successful (CI)
Build commit: 7ac2e07 (7ac2e07fae0be7c367133f5f2c43284173f6b277, parent: 64a965e9013a9d14e83c4d370af26f6be6bf96fb)

@bjorn3
Copy link
Copy Markdown
Member Author

bjorn3 commented May 12, 2026

I've verified this still works with rust-analyzer.

@rustbot ready

@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 May 12, 2026
@Mark-Simulacrum
Copy link
Copy Markdown
Member

@bors r+ rollup=iffy

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 17, 2026

📌 Commit 57a1291 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 May 17, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
…acrum

Include vendored sources in the rust-src component

In the future this can be used by build-std, but until then it is still useful for allowing rust-analyzer to work offline.

This increases the unpacked size by 24MB (from 116MB to 140MB) and the compressed size by only 2MB (from 18MB to 20MB)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 17, 2026
…acrum

Include vendored sources in the rust-src component

In the future this can be used by build-std, but until then it is still useful for allowing rust-analyzer to work offline.

This increases the unpacked size by 24MB (from 116MB to 140MB) and the compressed size by only 2MB (from 18MB to 20MB)
rust-bors Bot pushed a commit that referenced this pull request May 18, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156196 (Include vendored sources in the rust-src component)
 - #155870 (Fix cross-compiling `macos-deployment-target-warning` test)
 - #156492 (remove/update various cfg(miri))
 - #156676 (Preserve spans when hiding do_not_recommend impls)
 - #155313 (doc(core::cmp::Eq): fix definition of symmetry)
 - #156234 (implement `into_array` for `Vec<T>`)
 - #156488 (Fix missing period in Iterator product doc comment)
 - #156572 (std: replace "safe" with "sound" in safety documentation)
 - #156624 (c ffi document fixes for c_short.md)
 - #156638 (library: Fix std compilation for espidf target in unix::process)
 - #156647 (Change division to multiplication in floating-point midpoint)
 - #156668 (Fix typo in `format_into` docs: signed -> unsigned)
 - #156677 (change `other uses of const` to `raw pointers` in const keyword docs)
@rust-bors rust-bors Bot merged commit c30d903 into rust-lang:main May 18, 2026
11 checks passed
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 18, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#156196 (Include vendored sources in the rust-src component)
 - rust-lang/rust#155870 (Fix cross-compiling `macos-deployment-target-warning` test)
 - rust-lang/rust#156492 (remove/update various cfg(miri))
 - rust-lang/rust#156676 (Preserve spans when hiding do_not_recommend impls)
 - rust-lang/rust#155313 (doc(core::cmp::Eq): fix definition of symmetry)
 - rust-lang/rust#156234 (implement `into_array` for `Vec<T>`)
 - rust-lang/rust#156488 (Fix missing period in Iterator product doc comment)
 - rust-lang/rust#156572 (std: replace "safe" with "sound" in safety documentation)
 - rust-lang/rust#156624 (c ffi document fixes for c_short.md)
 - rust-lang/rust#156638 (library: Fix std compilation for espidf target in unix::process)
 - rust-lang/rust#156647 (Change division to multiplication in floating-point midpoint)
 - rust-lang/rust#156668 (Fix typo in `format_into` docs: signed -> unsigned)
 - rust-lang/rust#156677 (change `other uses of const` to `raw pointers` in const keyword docs)
@bjorn3 bjorn3 deleted the vendor_stdlib branch May 19, 2026 12:06
@ehuss ehuss added this to the 1.97.0 milestone May 28, 2026
Comment on lines +1214 to +1226
// Vendor all Cargo dependencies
let vendor = builder.ensure(Vendor {
sync_args: vec![],
versioned_dirs: true,
root_dir: dst_src.clone(),
output_dir: None,
only_library_workspace: true,
});

let library_cargo_config_dir = dst_src.join("library").join(".cargo");
builder.create_dir(&library_cargo_config_dir);
builder.create(&library_cargo_config_dir.join("config.toml"), &vendor.config_library);

Copy link
Copy Markdown
Contributor

@lambdageek lambdageek May 29, 2026

Choose a reason for hiding this comment

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

Sorry I'm late to the party. Would it be reasonable to wrap this in something like if builder.config.dist_vendor { ... } so that it respects the --set dist.vendor=false bootstrap option similar to what's done for PlainSourceTarball

if builder.config.dist_vendor {

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

dist.vendor currently does not affect any components that would be shipped to the end user as opposed to only be used for building rustc yourself. If the rust-src component also looked at dist.vendor, then a distro setting dist.vendor=false to avoid having to keep all non-Linux deps in the source tarball from which they build rustc would break offline rust-analyzer (and in the future offline -Zbuild-std) for their users.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense, thanks

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.

8 participants