Improve windows file handling and switch to libnative for rustc#12584
Merged
bors merged 4 commits intorust-lang:masterfrom Feb 28, 2014
Merged
Improve windows file handling and switch to libnative for rustc#12584bors merged 4 commits intorust-lang:masterfrom
bors merged 4 commits intorust-lang:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Are these necessary in file_unix.rs?
This weeds out a bunch of warnings building stdtest on windows, and it also adds a check! macro to the io::fs tests to help diagnose errors that are cropping up on windows platforms as well. cc rust-lang#12516
This commit splits the file implementation into file_unix and file_win32. The two implementations have diverged to the point that they share almost 0 code at this point, so it's easier to maintain as separate files. The other major change accompanied with this commit is that file::open is no longer based on libc's open function on windows, but rather windows's CreateFile function. This fixes dealing with binary files on windows (test added in previous commit). This also changes the read/write functions to use ReadFile and WriteFile instead of libc's read/write. Closes rust-lang#12406
The compiler itself doesn't necessarily need any features of green threading such as spawning tasks and lots of I/O, so libnative is slightly more appropriate for rustc to use itself. This should also help the rusti bot which is currently incompatible with libuv.
This recognizes the EISDIR error code on both windows and unix platforms to provide a more descriptive error condition.
bors
added a commit
that referenced
this pull request
Feb 27, 2014
These commits fix handling of binary files on windows by using the raw `CreateFile` apis directly, also splitting out the windows/unix implementations to their own files because everything was configured between the two platforms. With this fix in place, this also switches `rustc` to using libnative instead of libgreen. I have confirmed that this PR passes through try on all bots.
Contributor
|
cc @thestinger, theoretically rusti can now use master directly. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2022
fix: attribute macros not being properly diagnosed Closes rust-lang/rust-analyzer#12582
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These commits fix handling of binary files on windows by using the raw
CreateFileapis directly, also splitting out the windows/unix implementations to their own files because everything was configured between the two platforms.With this fix in place, this also switches
rustcto using libnative instead of libgreen. I have confirmed that this PR passes through try on all bots.