Skip to content
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

Improve windows file handling and switch to libnative for rustc #12584

Merged
merged 4 commits into from
Feb 28, 2014

Conversation

alexcrichton
Copy link
Member

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.

}
}

#[ignore(cfg(windows))] // apparently windows doesn't like tmpfile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@bors bors closed this Feb 28, 2014
@bors bors merged commit 8c157ed into rust-lang:master Feb 28, 2014
@huonw
Copy link
Member

huonw commented Feb 28, 2014

cc @thestinger, theoretically rusti can now use master directly.

@alexcrichton alexcrichton deleted the windows-files branch February 28, 2014 09:10
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants