Skip to content

Commit 6fb3433

Browse files
committed
Auto merge of #8558 - JohnTitor:fix-build-std, r=alexcrichton
build-std: Fix libraries paths following upstream Fixes #8557
2 parents 0d79ba6 + 7c77fed commit 6fb3433

File tree

22 files changed

+18
-39
lines changed

22 files changed

+18
-39
lines changed

src/cargo/core/compiler/standard_lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn resolve_std<'cfg>(
4646
let patches = to_patch
4747
.iter()
4848
.map(|&name| {
49-
let source_path = SourceId::for_path(&src_path.join("src").join("tools").join(name))?;
49+
let source_path = SourceId::for_path(&src_path.join("library").join(name))?;
5050
let dep = Dependency::parse_no_deprecated(name, None, source_path)?;
5151
Ok(dep)
5252
})
@@ -55,10 +55,10 @@ pub fn resolve_std<'cfg>(
5555
let mut patch = HashMap::new();
5656
patch.insert(crates_io_url, patches);
5757
let members = vec![
58-
String::from("src/libstd"),
59-
String::from("src/libcore"),
60-
String::from("src/liballoc"),
61-
String::from("src/libtest"),
58+
String::from("library/std"),
59+
String::from("library/core"),
60+
String::from("library/alloc"),
61+
String::from("library/test"),
6262
];
6363
let ws_config = crate::core::WorkspaceConfig::Root(crate::core::WorkspaceRootConfig::new(
6464
&src_path,
@@ -85,7 +85,7 @@ pub fn resolve_std<'cfg>(
8585
// other crates need to alter their features, this should be fine, for
8686
// now. Perhaps in the future features will be decoupled from the resolver
8787
// and it will be easier to control feature selection.
88-
let current_manifest = src_path.join("src/libtest/Cargo.toml");
88+
let current_manifest = src_path.join("library/test/Cargo.toml");
8989
// TODO: Consider doing something to enforce --locked? Or to prevent the
9090
// lock file from being written, such as setting ephemeral.
9191
let mut std_ws = Workspace::new_virtual(src_path, current_manifest, virtual_manifest, config)?;

tests/testsuite/mock-std/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[workspace]
22
members = [
3-
"src/liballoc",
4-
"src/libcore",
5-
"src/libproc_macro",
6-
"src/libstd",
7-
"src/libtest",
3+
"library/alloc",
4+
"library/core",
5+
"library/proc_macro",
6+
"library/std",
7+
"library/test",
88
]

tests/testsuite/mock-std/src/liballoc/Cargo.toml renamed to tests/testsuite/mock-std/library/alloc/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@ version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
66

7-
[lib]
8-
path = "lib.rs"
9-
107
[dependencies]
118
registry-dep-using-core = { version = "*", features = ['mockbuild'] }

tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml renamed to tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ name = "compiler_builtins"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
6-
7-
[lib]
8-
path = "lib.rs"

tests/testsuite/mock-std/src/libcore/Cargo.toml renamed to tests/testsuite/mock-std/library/core/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ name = "core"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
6-
7-
[lib]
8-
path = "lib.rs"

tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml renamed to tests/testsuite/mock-std/library/panic_unwind/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ name = "panic_unwind"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
6-
7-
[lib]
8-
path = "lib.rs"

tests/testsuite/mock-std/src/libproc_macro/Cargo.toml renamed to tests/testsuite/mock-std/library/proc_macro/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ name = "proc_macro"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
6-
7-
[lib]
8-
path = "lib.rs"

tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml renamed to tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ edition = "2018"
88
path = "lib.rs"
99

1010
[dependencies]
11-
alloc = { path = "../../liballoc" }
11+
alloc = { path = "../alloc" }

tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml renamed to tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ edition = "2018"
88
path = "lib.rs"
99

1010
[dependencies]
11-
core = { path = "../../libcore" }
11+
core = { path = "../core" }

tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml renamed to tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ edition = "2018"
88
path = "lib.rs"
99

1010
[dependencies]
11-
std = { path = "../../libstd" }
11+
std = { path = "../std" }

tests/testsuite/mock-std/src/libstd/Cargo.toml renamed to tests/testsuite/mock-std/library/std/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
66

7-
[lib]
8-
path = "lib.rs"
9-
107
[dependencies]
118
registry-dep-using-alloc = { version = "*", features = ['mockbuild'] }
129

tests/testsuite/mock-std/src/libtest/Cargo.toml renamed to tests/testsuite/mock-std/library/test/Cargo.toml

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
edition = "2018"
66

7-
[lib]
8-
path = "lib.rs"
9-
107
[dependencies]
11-
proc_macro = { path = "../libproc_macro" }
12-
std = { path = "../libstd" }
13-
panic_unwind = { path = "../libpanic_unwind" }
14-
compiler_builtins = { path = "../libcompiler_builtins" }
8+
proc_macro = { path = "../proc_macro" }
9+
std = { path = "../std" }
10+
panic_unwind = { path = "../panic_unwind" }
11+
compiler_builtins = { path = "../compiler_builtins" }
1512
registry-dep-using-std = { version = "*", features = ['mockbuild'] }
1613

1714
[features]

0 commit comments

Comments
 (0)