Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b35e899

Browse files
committedJul 12, 2024
rewrite and rename issue-85019-moved-src-dir to rmake
1 parent 19b19a0 commit b35e899

File tree

6 files changed

+38
-31
lines changed

6 files changed

+38
-31
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ run-make/issue-69368/Makefile
6565
run-make/issue-83045/Makefile
6666
run-make/issue-83112-incr-test-moved-file/Makefile
6767
run-make/issue-84395-lto-embed-bitcode/Makefile
68-
run-make/issue-85019-moved-src-dir/Makefile
6968
run-make/issue-85401-static-mir/Makefile
7069
run-make/issue-88756-default-output/Makefile
7170
run-make/issue-97463-abi-param-passing/Makefile

‎tests/run-make/extra-filename-with-temp-outputs/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// are named as expected.
77
// See https://github.com/rust-lang/rust/pull/15686
88

9-
//FIXME(Oneirical): ignore-cross-compile
10-
119
use run_make_support::{
1210
bin_name, cwd, fs_wrapper, has_prefix, has_suffix, rustc, shallow_find_files,
1311
};

‎tests/run-make/issue-85019-moved-src-dir/Makefile

-28
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// A SourceFile created during compilation may have a relative
2+
// path (e.g. if rustc itself is invoked with a relative path).
3+
// When we write out crate metadata, we convert all relative paths
4+
// to absolute paths using the current working directory.
5+
// However, the working directory was previously not included in the crate hash.
6+
// This meant that the crate metadata could change while the crate
7+
// hash remained the same. Among other problems, this could cause a
8+
// fingerprint mismatch ICE, since incremental compilation uses
9+
// the crate metadata hash to determine if a foreign query is green.
10+
// This test checks that we don't get an ICE when the working directory
11+
// (but not the build directory!) changes between compilation
12+
// sessions.
13+
// See https://github.com/rust-lang/rust/issues/85019
14+
15+
//@ ignore-none
16+
// Reason: no-std is not supported
17+
//@ ignore-nvptx64-nvidia-cuda
18+
// FIXME: can't find crate for 'std'
19+
20+
use run_make_support::{fs_wrapper, rust_lib_name, rustc};
21+
22+
fn main() {
23+
fs_wrapper::create_dir("incr");
24+
fs_wrapper::create_dir("first_src");
25+
fs_wrapper::create_dir("output");
26+
fs_wrapper::rename("my_lib.rs", "first_src/my_lib.rs");
27+
fs_wrapper::rename("main.rs", "first_src/main.rs");
28+
// Build from "first_src"
29+
std::env::set_current_dir("first_src").unwrap();
30+
rustc().input("my_lib.rs").incremental("incr").crate_type("lib").run();
31+
rustc().input("main.rs").incremental("incr").extern_("my_lib", rust_lib_name("my_lib")).run();
32+
std::env::set_current_dir("..").unwrap();
33+
fs_wrapper::rename("first_src", "second_src");
34+
std::env::set_current_dir("second_src").unwrap();
35+
// Build from "second_src" - the output and incremental directory remain identical
36+
rustc().input("my_lib.rs").incremental("incr").crate_type("lib").run();
37+
rustc().input("main.rs").incremental("incr").extern_("my_lib", rust_lib_name("my_lib")).run();
38+
}

0 commit comments

Comments
 (0)
Failed to load comments.