about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBernardo Meurer Costa <bernardo@meurer.org>2024-03-22 17:30:41 +0000
committerBernardo Meurer Costa <bernardo@meurer.org>2024-03-22 17:30:43 +0000
commit25d06013db110db4ef4af46e9fded81b8adc03d6 (patch)
tree5fbbc9d19b75acc86125f9efaef4ac6eebe045f8 /src
parent1447f9d38ca388ca178a544534b3cff72945fa1e (diff)
downloadrust-25d06013db110db4ef4af46e9fded81b8adc03d6.tar.gz
rust-25d06013db110db4ef4af46e9fded81b8adc03d6.zip
fix(bootstrap/dist): use versioned dirs when vendoring
Currently, if you attempt to run ui tests in a vendored build, you will
see this failure

```
---- [ui] tests/ui/issues/issue-21763.rs stdout ----
diff of stderr:

8          = note: required because it appears within the type `(Rc<()>, Rc<()>)`
9          = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
10      note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
-         --> $HASHBROWN_SRC_LOCATION
+         --> /rust/deps/hashbrown/src/map.rs:190:12
12      note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
13        --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
14      note: required by a bound in `foo`
```

This happend because the code that attempts to remap
`HASHBROWN_SRC_LOCATION` expects it to be under `hashbrown-$version`,
which is the case in a normal cargo registry, but not when vendor, where
by default crates may not have the version in their directory name.

This change passes `--versioned-dirs` to `cargo vendor` to enforce that
every crate includes the version in the subdir name, which fixes the ui
test and brings `--enable-vendor` builds closer to normal ones.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/dist.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 012d64e5344..d9c7032d0db 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -1003,6 +1003,7 @@ impl Step for PlainSourceTarball {
             // Vendor all Cargo dependencies
             let mut cmd = Command::new(&builder.initial_cargo);
             cmd.arg("vendor")
+                .arg("--versioned-dirs")
                 .arg("--sync")
                 .arg(builder.src.join("./src/tools/cargo/Cargo.toml"))
                 .arg("--sync")