From 769ac7cc91cefaffe8a11e6edda6cb6e96a20cb8 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 29 Jul 2020 12:20:51 +0900 Subject: [PATCH 1/2] Fix libraries paths following upstream --- src/cargo/core/compiler/standard_lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cargo/core/compiler/standard_lib.rs b/src/cargo/core/compiler/standard_lib.rs index a83650f33da..ed3dd77336c 100644 --- a/src/cargo/core/compiler/standard_lib.rs +++ b/src/cargo/core/compiler/standard_lib.rs @@ -46,7 +46,7 @@ pub fn resolve_std<'cfg>( let patches = to_patch .iter() .map(|&name| { - let source_path = SourceId::for_path(&src_path.join("src").join("tools").join(name))?; + let source_path = SourceId::for_path(&src_path.join("library").join(name))?; let dep = Dependency::parse_no_deprecated(name, None, source_path)?; Ok(dep) }) @@ -55,10 +55,10 @@ pub fn resolve_std<'cfg>( let mut patch = HashMap::new(); patch.insert(crates_io_url, patches); let members = vec![ - String::from("src/libstd"), - String::from("src/libcore"), - String::from("src/liballoc"), - String::from("src/libtest"), + String::from("library/std"), + String::from("library/core"), + String::from("library/alloc"), + String::from("library/test"), ]; let ws_config = crate::core::WorkspaceConfig::Root(crate::core::WorkspaceRootConfig::new( &src_path, @@ -85,7 +85,7 @@ pub fn resolve_std<'cfg>( // other crates need to alter their features, this should be fine, for // now. Perhaps in the future features will be decoupled from the resolver // and it will be easier to control feature selection. - let current_manifest = src_path.join("src/libtest/Cargo.toml"); + let current_manifest = src_path.join("library/test/Cargo.toml"); // TODO: Consider doing something to enforce --locked? Or to prevent the // lock file from being written, such as setting ephemeral. let mut std_ws = Workspace::new_virtual(src_path, current_manifest, virtual_manifest, config)?; From 7c77fedabb921e5d7530642cef458ef7d258d60b Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 29 Jul 2020 12:41:43 +0900 Subject: [PATCH 2/2] Fix mock-std as well --- tests/testsuite/mock-std/Cargo.toml | 10 +++++----- .../{src/liballoc => library/alloc}/Cargo.toml | 3 --- .../{src/liballoc => library/alloc/src}/lib.rs | 0 .../compiler_builtins}/Cargo.toml | 3 --- .../compiler_builtins/src}/lib.rs | 0 .../mock-std/{src/libcore => library/core}/Cargo.toml | 3 --- .../mock-std/{src/libcore => library/core/src}/lib.rs | 0 .../panic_unwind}/Cargo.toml | 3 --- .../panic_unwind/src}/lib.rs | 0 .../libproc_macro => library/proc_macro}/Cargo.toml | 3 --- .../libproc_macro => library/proc_macro/src}/lib.rs | 0 .../rustc-std-workspace-alloc/Cargo.toml | 2 +- .../rustc-std-workspace-alloc/lib.rs | 0 .../rustc-std-workspace-core/Cargo.toml | 2 +- .../tools => library}/rustc-std-workspace-core/lib.rs | 0 .../rustc-std-workspace-std/Cargo.toml | 2 +- .../tools => library}/rustc-std-workspace-std/lib.rs | 0 .../mock-std/{src/libstd => library/std}/Cargo.toml | 3 --- .../mock-std/{src/libstd => library/std/src}/lib.rs | 0 .../mock-std/{src/libtest => library/test}/Cargo.toml | 11 ++++------- .../mock-std/{src/libtest => library/test/src}/lib.rs | 0 21 files changed, 12 insertions(+), 33 deletions(-) rename tests/testsuite/mock-std/{src/liballoc => library/alloc}/Cargo.toml (89%) rename tests/testsuite/mock-std/{src/liballoc => library/alloc/src}/lib.rs (100%) rename tests/testsuite/mock-std/{src/libcompiler_builtins => library/compiler_builtins}/Cargo.toml (84%) rename tests/testsuite/mock-std/{src/libcompiler_builtins => library/compiler_builtins/src}/lib.rs (100%) rename tests/testsuite/mock-std/{src/libcore => library/core}/Cargo.toml (82%) rename tests/testsuite/mock-std/{src/libcore => library/core/src}/lib.rs (100%) rename tests/testsuite/mock-std/{src/libpanic_unwind => library/panic_unwind}/Cargo.toml (83%) rename tests/testsuite/mock-std/{src/libpanic_unwind => library/panic_unwind/src}/lib.rs (100%) rename tests/testsuite/mock-std/{src/libproc_macro => library/proc_macro}/Cargo.toml (83%) rename tests/testsuite/mock-std/{src/libproc_macro => library/proc_macro/src}/lib.rs (100%) rename tests/testsuite/mock-std/{src/tools => library}/rustc-std-workspace-alloc/Cargo.toml (82%) rename tests/testsuite/mock-std/{src/tools => library}/rustc-std-workspace-alloc/lib.rs (100%) rename tests/testsuite/mock-std/{src/tools => library}/rustc-std-workspace-core/Cargo.toml (83%) rename tests/testsuite/mock-std/{src/tools => library}/rustc-std-workspace-core/lib.rs (100%) rename tests/testsuite/mock-std/{src/tools => library}/rustc-std-workspace-std/Cargo.toml (84%) rename tests/testsuite/mock-std/{src/tools => library}/rustc-std-workspace-std/lib.rs (100%) rename tests/testsuite/mock-std/{src/libstd => library/std}/Cargo.toml (90%) rename tests/testsuite/mock-std/{src/libstd => library/std/src}/lib.rs (100%) rename tests/testsuite/mock-std/{src/libtest => library/test}/Cargo.toml (58%) rename tests/testsuite/mock-std/{src/libtest => library/test/src}/lib.rs (100%) diff --git a/tests/testsuite/mock-std/Cargo.toml b/tests/testsuite/mock-std/Cargo.toml index 3cc10acb2e4..a69aa4b88fa 100644 --- a/tests/testsuite/mock-std/Cargo.toml +++ b/tests/testsuite/mock-std/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ - "src/liballoc", - "src/libcore", - "src/libproc_macro", - "src/libstd", - "src/libtest", + "library/alloc", + "library/core", + "library/proc_macro", + "library/std", + "library/test", ] diff --git a/tests/testsuite/mock-std/src/liballoc/Cargo.toml b/tests/testsuite/mock-std/library/alloc/Cargo.toml similarity index 89% rename from tests/testsuite/mock-std/src/liballoc/Cargo.toml rename to tests/testsuite/mock-std/library/alloc/Cargo.toml index 23034673665..dc965abffac 100644 --- a/tests/testsuite/mock-std/src/liballoc/Cargo.toml +++ b/tests/testsuite/mock-std/library/alloc/Cargo.toml @@ -4,8 +4,5 @@ version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" -[lib] -path = "lib.rs" - [dependencies] registry-dep-using-core = { version = "*", features = ['mockbuild'] } diff --git a/tests/testsuite/mock-std/src/liballoc/lib.rs b/tests/testsuite/mock-std/library/alloc/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/liballoc/lib.rs rename to tests/testsuite/mock-std/library/alloc/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml b/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml similarity index 84% rename from tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml rename to tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml index 1bb02f9907c..d1df281d6d0 100644 --- a/tests/testsuite/mock-std/src/libcompiler_builtins/Cargo.toml +++ b/tests/testsuite/mock-std/library/compiler_builtins/Cargo.toml @@ -3,6 +3,3 @@ name = "compiler_builtins" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libcompiler_builtins/lib.rs b/tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libcompiler_builtins/lib.rs rename to tests/testsuite/mock-std/library/compiler_builtins/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libcore/Cargo.toml b/tests/testsuite/mock-std/library/core/Cargo.toml similarity index 82% rename from tests/testsuite/mock-std/src/libcore/Cargo.toml rename to tests/testsuite/mock-std/library/core/Cargo.toml index b448bdb085d..3f7de53db06 100644 --- a/tests/testsuite/mock-std/src/libcore/Cargo.toml +++ b/tests/testsuite/mock-std/library/core/Cargo.toml @@ -3,6 +3,3 @@ name = "core" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libcore/lib.rs b/tests/testsuite/mock-std/library/core/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libcore/lib.rs rename to tests/testsuite/mock-std/library/core/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml b/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml similarity index 83% rename from tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml rename to tests/testsuite/mock-std/library/panic_unwind/Cargo.toml index 9dc111d29f0..e7beb923fcb 100644 --- a/tests/testsuite/mock-std/src/libpanic_unwind/Cargo.toml +++ b/tests/testsuite/mock-std/library/panic_unwind/Cargo.toml @@ -3,6 +3,3 @@ name = "panic_unwind" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libpanic_unwind/lib.rs b/tests/testsuite/mock-std/library/panic_unwind/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libpanic_unwind/lib.rs rename to tests/testsuite/mock-std/library/panic_unwind/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libproc_macro/Cargo.toml b/tests/testsuite/mock-std/library/proc_macro/Cargo.toml similarity index 83% rename from tests/testsuite/mock-std/src/libproc_macro/Cargo.toml rename to tests/testsuite/mock-std/library/proc_macro/Cargo.toml index c400a4a51c0..939a113b20b 100644 --- a/tests/testsuite/mock-std/src/libproc_macro/Cargo.toml +++ b/tests/testsuite/mock-std/library/proc_macro/Cargo.toml @@ -3,6 +3,3 @@ name = "proc_macro" version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" - -[lib] -path = "lib.rs" diff --git a/tests/testsuite/mock-std/src/libproc_macro/lib.rs b/tests/testsuite/mock-std/library/proc_macro/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libproc_macro/lib.rs rename to tests/testsuite/mock-std/library/proc_macro/src/lib.rs diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml similarity index 82% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml rename to tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml index 18fc7004259..6b86f22ca5c 100644 --- a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/Cargo.toml +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "lib.rs" [dependencies] -alloc = { path = "../../liballoc" } +alloc = { path = "../alloc" } diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-alloc/lib.rs rename to tests/testsuite/mock-std/library/rustc-std-workspace-alloc/lib.rs diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml similarity index 83% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml rename to tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml index 39d704fd995..8d1921600aa 100644 --- a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/Cargo.toml +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-core/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "lib.rs" [dependencies] -core = { path = "../../libcore" } +core = { path = "../core" } diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-core/lib.rs rename to tests/testsuite/mock-std/library/rustc-std-workspace-core/lib.rs diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml b/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml similarity index 84% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml rename to tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml index 9cf5530ae15..91572b8158f 100644 --- a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/Cargo.toml +++ b/tests/testsuite/mock-std/library/rustc-std-workspace-std/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" path = "lib.rs" [dependencies] -std = { path = "../../libstd" } +std = { path = "../std" } diff --git a/tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/lib.rs b/tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/tools/rustc-std-workspace-std/lib.rs rename to tests/testsuite/mock-std/library/rustc-std-workspace-std/lib.rs diff --git a/tests/testsuite/mock-std/src/libstd/Cargo.toml b/tests/testsuite/mock-std/library/std/Cargo.toml similarity index 90% rename from tests/testsuite/mock-std/src/libstd/Cargo.toml rename to tests/testsuite/mock-std/library/std/Cargo.toml index 17ecd8efca4..d2cfdea3986 100644 --- a/tests/testsuite/mock-std/src/libstd/Cargo.toml +++ b/tests/testsuite/mock-std/library/std/Cargo.toml @@ -4,9 +4,6 @@ version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" -[lib] -path = "lib.rs" - [dependencies] registry-dep-using-alloc = { version = "*", features = ['mockbuild'] } diff --git a/tests/testsuite/mock-std/src/libstd/lib.rs b/tests/testsuite/mock-std/library/std/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libstd/lib.rs rename to tests/testsuite/mock-std/library/std/src/lib.rs diff --git a/tests/testsuite/mock-std/src/libtest/Cargo.toml b/tests/testsuite/mock-std/library/test/Cargo.toml similarity index 58% rename from tests/testsuite/mock-std/src/libtest/Cargo.toml rename to tests/testsuite/mock-std/library/test/Cargo.toml index 078e91289d1..299db7bfd49 100644 --- a/tests/testsuite/mock-std/src/libtest/Cargo.toml +++ b/tests/testsuite/mock-std/library/test/Cargo.toml @@ -4,14 +4,11 @@ version = "0.1.0" authors = ["Alex Crichton "] edition = "2018" -[lib] -path = "lib.rs" - [dependencies] -proc_macro = { path = "../libproc_macro" } -std = { path = "../libstd" } -panic_unwind = { path = "../libpanic_unwind" } -compiler_builtins = { path = "../libcompiler_builtins" } +proc_macro = { path = "../proc_macro" } +std = { path = "../std" } +panic_unwind = { path = "../panic_unwind" } +compiler_builtins = { path = "../compiler_builtins" } registry-dep-using-std = { version = "*", features = ['mockbuild'] } [features] diff --git a/tests/testsuite/mock-std/src/libtest/lib.rs b/tests/testsuite/mock-std/library/test/src/lib.rs similarity index 100% rename from tests/testsuite/mock-std/src/libtest/lib.rs rename to tests/testsuite/mock-std/library/test/src/lib.rs