-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate extra-filename-with-temp-outputs
and issue-85019-moved-src-dir
run-make
tests to rmake
#127338
Merged
+64
−37
Merged
Migrate extra-filename-with-temp-outputs
and issue-85019-moved-src-dir
run-make
tests to rmake
#127338
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// In order to prevent temporary files from overwriting each other in parallel | ||
// compilation, rustc was changed to mix an extra filename with temporary | ||
// outputs. However, as this is a similar behavior with the codegen flag | ||
// -C extra-filename, this test checks that the manually passed flag | ||
// is not overwritten by this feature, and that the output files | ||
// are named as expected. | ||
// See https://github.com/rust-lang/rust/pull/15686 | ||
|
||
use run_make_support::{ | ||
bin_name, cwd, fs_wrapper, has_prefix, has_suffix, rustc, shallow_find_files, | ||
}; | ||
|
||
fn main() { | ||
rustc().extra_filename("bar").input("foo.rs").arg("-Csave-temps").run(); | ||
let object_files = shallow_find_files(cwd(), |path| { | ||
has_prefix(path, "foobar.foo") && has_suffix(path, "0.rcgu.o") | ||
}); | ||
let object_file = object_files.get(0).unwrap(); | ||
fs_wrapper::remove_file(object_file); | ||
fs_wrapper::remove_file(bin_name("foobar")); | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// A SourceFile created during compilation may have a relative | ||
// path (e.g. if rustc itself is invoked with a relative path). | ||
// When we write out crate metadata, we convert all relative paths | ||
// to absolute paths using the current working directory. | ||
// However, the working directory was previously not included in the crate hash. | ||
// This meant that the crate metadata could change while the crate | ||
// hash remained the same. Among other problems, this could cause a | ||
// fingerprint mismatch ICE, since incremental compilation uses | ||
// the crate metadata hash to determine if a foreign query is green. | ||
// This test checks that we don't get an ICE when the working directory | ||
// (but not the build directory!) changes between compilation | ||
// sessions. | ||
// See https://github.com/rust-lang/rust/issues/85019 | ||
|
||
//@ ignore-none | ||
// Reason: no-std is not supported | ||
//@ ignore-nvptx64-nvidia-cuda | ||
// FIXME: can't find crate for 'std' | ||
|
||
use run_make_support::{fs_wrapper, rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
fs_wrapper::create_dir("incr"); | ||
fs_wrapper::create_dir("first_src"); | ||
fs_wrapper::create_dir("output"); | ||
fs_wrapper::rename("my_lib.rs", "first_src/my_lib.rs"); | ||
fs_wrapper::rename("main.rs", "first_src/main.rs"); | ||
// Build from "first_src" | ||
std::env::set_current_dir("first_src").unwrap(); | ||
rustc().input("my_lib.rs").incremental("incr").crate_type("lib").run(); | ||
rustc().input("main.rs").incremental("incr").extern_("my_lib", rust_lib_name("my_lib")).run(); | ||
std::env::set_current_dir("..").unwrap(); | ||
fs_wrapper::rename("first_src", "second_src"); | ||
std::env::set_current_dir("second_src").unwrap(); | ||
// Build from "second_src" - the output and incremental directory remain identical | ||
rustc().input("my_lib.rs").incremental("incr").crate_type("lib").run(); | ||
rustc().input("main.rs").incremental("incr").extern_("my_lib", rust_lib_name("my_lib")).run(); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: does this addition conflict with any other PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No other PR has
has_suffix
, it's just for this PR.