[rust project] update path to std lib crates The standard lib crates have been moved to a new location within the toolchain. This updates the paths in rust-project.json to accomodate. Change-Id: I656c71bbb0c233370a4ce13332f9192deb08a176 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/9500 Commit-Queue: Aaron Wood <aaronwood@google.com> Reviewed-by: Tyler Mandry <tmandry@google.com>
diff --git a/src/gn/rust_project_writer.cc b/src/gn/rust_project_writer.cc index 7bd0561..2e17eb4 100644 --- a/src/gn/rust_project_writer.cc +++ b/src/gn/rust_project_writer.cc
@@ -221,7 +221,7 @@ build_settings->GetFullPath(build_settings->build_dir()); auto crate_path = FilePathToUTF8(rebased_out_dir) + std::string(current_sysroot) + - "/lib/rustlib/src/rust/src/lib" + std::string(crate) + "/lib.rs"; + "/lib/rustlib/src/rust/library/" + std::string(crate) + "/src/lib.rs"; Crate sysroot_crate = Crate(SourceFile(crate_path), crate_index, std::string(crate), "2018");
diff --git a/src/gn/rust_project_writer_helpers_unittest.cc b/src/gn/rust_project_writer_helpers_unittest.cc index 286b4c2..2685492 100644 --- a/src/gn/rust_project_writer_helpers_unittest.cc +++ b/src/gn/rust_project_writer_helpers_unittest.cc
@@ -102,34 +102,33 @@ const char expected_json[] = "{\n" " \"roots\": [\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liballoc/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liballoc_jemalloc/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liballoc_system/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libbuild_helper/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libcollections/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libcompiler_builtins/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libcore/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libgetopts/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liblibc/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libpanic_abort/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libpanic_unwind/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libproc_macro/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_asan/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_lsan/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_msan/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_tsan/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_unicode/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libstd/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libstd_unicode/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libsyntax/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libtest/\",\n" - " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libunwind/\"\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/alloc/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/alloc_jemalloc/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/alloc_system/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/build_helper/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/collections/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/compiler_builtins/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/core/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/getopts/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/libc/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/panic_abort/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/panic_unwind/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/proc_macro/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_asan/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_lsan/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_msan/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_tsan/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_unicode/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/std/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/std_unicode/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/syntax/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/test/src/\",\n" + " \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/unwind/src/\"\n" " ],\n" " \"crates\": [\n" " {\n" " \"crate_id\": 0,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libcore/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/core/src/lib.rs\",\n" " \"label\": \"core\",\n" " \"deps\": [\n" " ],\n" @@ -140,8 +139,7 @@ " },\n" " {\n" " \"crate_id\": 1,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liballoc/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/alloc/src/lib.rs\",\n" " \"label\": \"alloc\",\n" " \"deps\": [\n" " {\n" @@ -156,9 +154,7 @@ " },\n" " {\n" " \"crate_id\": 2,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libpanic_abort/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/panic_abort/src/lib.rs\",\n" " \"label\": \"panic_abort\",\n" " \"deps\": [\n" " ],\n" @@ -169,8 +165,7 @@ " },\n" " {\n" " \"crate_id\": 3,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libunwind/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/unwind/src/lib.rs\",\n" " \"label\": \"unwind\",\n" " \"deps\": [\n" " ],\n" @@ -181,8 +176,7 @@ " },\n" " {\n" " \"crate_id\": 4,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libstd/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/std/src/lib.rs\",\n" " \"label\": \"std\",\n" " \"deps\": [\n" " {\n" @@ -209,9 +203,7 @@ " },\n" " {\n" " \"crate_id\": 5,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libcollections/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/collections/src/lib.rs\",\n" " \"label\": \"collections\",\n" " \"deps\": [\n" " ],\n" @@ -222,8 +214,7 @@ " },\n" " {\n" " \"crate_id\": 6,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liblibc/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/libc/src/lib.rs\",\n" " \"label\": \"libc\",\n" " \"deps\": [\n" " ],\n" @@ -234,9 +225,7 @@ " },\n" " {\n" " \"crate_id\": 7,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libpanic_unwind/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/panic_unwind/src/lib.rs\",\n" " \"label\": \"panic_unwind\",\n" " \"deps\": [\n" " ],\n" @@ -247,9 +236,7 @@ " },\n" " {\n" " \"crate_id\": 8,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libproc_macro/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/proc_macro/src/lib.rs\",\n" " \"label\": \"proc_macro\",\n" " \"deps\": [\n" " ],\n" @@ -260,9 +247,7 @@ " },\n" " {\n" " \"crate_id\": 9,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_unicode/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_unicode/src/lib.rs\",\n" " \"label\": \"rustc_unicode\",\n" " \"deps\": [\n" " ],\n" @@ -273,9 +258,7 @@ " },\n" " {\n" " \"crate_id\": 10,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libstd_unicode/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/std_unicode/src/lib.rs\",\n" " \"label\": \"std_unicode\",\n" " \"deps\": [\n" " ],\n" @@ -286,8 +269,7 @@ " },\n" " {\n" " \"crate_id\": 11,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libtest/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/test/src/lib.rs\",\n" " \"label\": \"test\",\n" " \"deps\": [\n" " ],\n" @@ -298,9 +280,7 @@ " },\n" " {\n" " \"crate_id\": 12,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liballoc_jemalloc/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/alloc_jemalloc/src/lib.rs\",\n" " \"label\": \"alloc_jemalloc\",\n" " \"deps\": [\n" " ],\n" @@ -311,9 +291,7 @@ " },\n" " {\n" " \"crate_id\": 13,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/liballoc_system/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/alloc_system/src/lib.rs\",\n" " \"label\": \"alloc_system\",\n" " \"deps\": [\n" " ],\n" @@ -324,9 +302,7 @@ " },\n" " {\n" " \"crate_id\": 14,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libcompiler_builtins/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/compiler_builtins/src/lib.rs\",\n" " \"label\": \"compiler_builtins\",\n" " \"deps\": [\n" " ],\n" @@ -337,9 +313,7 @@ " },\n" " {\n" " \"crate_id\": 15,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libgetopts/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/getopts/src/lib.rs\",\n" " \"label\": \"getopts\",\n" " \"deps\": [\n" " ],\n" @@ -350,9 +324,7 @@ " },\n" " {\n" " \"crate_id\": 16,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libbuild_helper/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/build_helper/src/lib.rs\",\n" " \"label\": \"build_helper\",\n" " \"deps\": [\n" " ],\n" @@ -363,9 +335,7 @@ " },\n" " {\n" " \"crate_id\": 17,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_asan/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_asan/src/lib.rs\",\n" " \"label\": \"rustc_asan\",\n" " \"deps\": [\n" " ],\n" @@ -376,9 +346,7 @@ " },\n" " {\n" " \"crate_id\": 18,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_lsan/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_lsan/src/lib.rs\",\n" " \"label\": \"rustc_lsan\",\n" " \"deps\": [\n" " ],\n" @@ -389,9 +357,7 @@ " },\n" " {\n" " \"crate_id\": 19,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_msan/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_msan/src/lib.rs\",\n" " \"label\": \"rustc_msan\",\n" " \"deps\": [\n" " ],\n" @@ -402,9 +368,7 @@ " },\n" " {\n" " \"crate_id\": 20,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/librustc_tsan/" - "lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/rustc_tsan/src/lib.rs\",\n" " \"label\": \"rustc_tsan\",\n" " \"deps\": [\n" " ],\n" @@ -415,8 +379,7 @@ " },\n" " {\n" " \"crate_id\": 21,\n" - " \"root_module\": " - "\"/root/out/Debug/sysroot/lib/rustlib/src/rust/src/libsyntax/lib.rs\",\n" + " \"root_module\": \"/root/out/Debug/sysroot/lib/rustlib/src/rust/library/syntax/src/lib.rs\",\n" " \"label\": \"syntax\",\n" " \"deps\": [\n" " ],\n"