Skip to content

Commit

Permalink
Auto merge of #128534 - bjorn3:split_stdlib_workspace, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Move the standard library to a separate workspace

This ensures that the Cargo.lock packaged for it in the rust-src component is up-to-date, allowing rust-analyzer to run cargo metadata on the standard library even when the rust-src component is stored in a read-only location as is necessary for loading crates.io dependencies of the standard library.

This also simplifies tidy's license check for runtime dependencies as it can now look at all entries in library/Cargo.lock without having to filter for just the dependencies of runtime crates. In addition this allows removing an exception in check_runtime_license_exceptions that was necessary due to the compiler enabling a feature on the object crate which pulls in a dependency not allowed for the standard library.

While cargo workspaces normally enable dependencies of multiple targets to be reused, for the standard library we do not want this reusing to prevent conflicts between dependencies of the sysroot and of tools that are built using this sysroot. For this reason we already use an unstable cargo feature to ensure that any dependencies which would otherwise be shared get a different -Cmetadata argument as well as using separate build dirs.

This doesn't change the situation around vendoring. We already have several cargo workspaces that need to be vendored. Adding another one doesn't change much.

There are also no cargo profiles that are shared between the root workspace and the library workspace anyway, so it doesn't add any extra work when changing cargo profiles.
  • Loading branch information
bors committed Aug 4, 2024
2 parents ab1527f + 178886e commit 176e545
Show file tree
Hide file tree
Showing 17 changed files with 615 additions and 404 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ build/
/dist/
/unicode-downloads
/target
/library/target
/src/bootstrap/target
/src/tools/x/target
# Created by default with `src/ci/docker/run.sh`
Expand Down
Loading

0 comments on commit 176e545

Please sign in to comment.