-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix ICE when there is a non-Unicode entry in the incremental crate directory #124112
Conversation
r? @Nadrieril rustbot has assigned @Nadrieril. Use |
Some changes occurred in run-make tests. cc @jieyouxu |
Thanks! @bors r+ rollup |
…rieril Fix ICE when there is a non-Unicode entry in the incremental crate directory Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of `to_string_lossy` + `assert_no_characters_lost` with `to_str`. The added test would cause the compiler to ICE before this PR.
…rieril Fix ICE when there is a non-Unicode entry in the incremental crate directory Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of `to_string_lossy` + `assert_no_characters_lost` with `to_str`. The added test would cause the compiler to ICE before this PR.
I believe this is failing rollups: @bors r- |
I tested my hypothesis and was wrong. @bors r=Nadrieril |
…rieril Fix ICE when there is a non-Unicode entry in the incremental crate directory Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of `to_string_lossy` + `assert_no_characters_lost` with `to_str`. The added test would cause the compiler to ICE before this PR.
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#117919 (Introduce perma-unstable `wasm-c-abi` flag) - rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder) - rust-lang#123752 (Properly handle emojis as literal prefix in macros) - rust-lang#123935 (Don't inline integer literals when they overflow - new attempt) - rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc) - rust-lang#124019 (Use raw-dylib for Windows synchronization functions) - rust-lang#124110 (Fix negating `f16` and `f128` constants) - rust-lang#124112 (Fix ICE when there is a non-Unicode entry in the incremental crate directory) - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation) r? `@ghost` `@rustbot` modify labels: rollup
ed8f351
to
c71cfee
Compare
I've fixed the test failure that was caused by some filesystems not supporting non-Unicode paths. |
c71cfee
to
6b9767d
Compare
The run-make-support library was changed cc @jieyouxu These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
#[cfg(windows)] | ||
let non_unicode: std::ffi::OsString = std::os::windows::ffi::OsStringExt::from_wide(&[0xD800]); | ||
match std::fs::create_dir(tmp_dir().join(&non_unicode)) { | ||
Err(e) if e.raw_os_error() == Some(libc::EILSEQ) => { |
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.
That error code assumes create_dir is implemented using a POSIX API. That isn't true on Windows and may not even be true on Unix OSes (depending on how the create_dir is implemented).
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.
I don't see EILSEQ
referenced anywhere in std
so I don't think there's a portable way to detect this. You can always try to create a file with a unicode path first to ensure the test doesn't silently fail for other permissions reasons.
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.
If we fail here, then surely we also fail in incremental when trying to create a directory with non-Unicode characters? Would that also ICE?
Do we even want to support non-Unicode incremental directory paths, given it is not at all portable (seeing that there doesn't seem to be an easy way to even test this behavior portably)? Would it make more sense to convert the ICE to a fatal error?
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.
Incremental will never create a directory with a non-Unicode name - session directory names have a specific format and are always valid Unicode. The ICE would occur (before this PR) if something else had created a file/directory with a non-Unicode name in the incremental crate directory. When find_source_directory
iterates over the incremental crate directory to find the most recent published session directory, it ignores any entries that do not have names in the expected format (checked with is_session_directory()
etc.). However, before this PR, instead of ignoring entry names with non-Unicode characters in them (as session directories always have valid Unicode names) the compiler would instead ICE in the assert_no_characters_lost()
function.
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.
I've gone with something similar to @Nadrieril's suggestion and checked if creating a directory with a valid Unicode name would succeed if creating a directory with a non-Unicode name failed.
@bors r- |
6b9767d
to
71f751d
Compare
Thanks! @bors r+ |
…eril Fix ICE when there is a non-Unicode entry in the incremental crate directory Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of `to_string_lossy` + `assert_no_characters_lost` with `to_str`. The added test would cause the compiler to ICE before this PR.
💔 Test failed - checks-actions |
Looks unrelated @bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3288583): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.434s -> 671.523s (-0.14%) |
Fix the ICE that occurs when there is a non-Unicode entry in the incremental crate directory by replacing uses of
to_string_lossy
+assert_no_characters_lost
withto_str
. The added test would cause the compiler to ICE before this PR.