-
Notifications
You must be signed in to change notification settings - Fork 119
[1.4.0] cherry-pick #158 & #176 #198
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
Merged
glessard
merged 12 commits into
apple:release/1.4.0
from
glessard:1.4.0-backport-158&176
Oct 17, 2024
Merged
[1.4.0] cherry-pick #158 & #176 #198
glessard
merged 12 commits into
apple:release/1.4.0
from
glessard:1.4.0-backport-158&176
Oct 17, 2024
Conversation
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
The swift-system tests were not passing, for various reasons, mostly to do with path related confusion. As part of this, add a function to create a temporary directory, as that was one of the problems. Also add Windows support for pipe() and ftruncate(), which was missing. rdar://125087707
It seems we can get the temporary directory from confstr(). rdar://125087707
Use idiomatic Swift notation, not `Optional<Bool>`. Prefer Win32 APIs to UCRT APIs. rdar://125087707
This adds support for mapping POSIX-style mode bits to Windows ACLs when calling `open()` or `mkdir()`. rdar://125087707
Co-authored-by: Karoy Lorentey <[email protected]>
Broke `FilePathTemp.swift` into separate files for POSIX and Windows. Added tests for permissions code on Windows. Added leading underscores to some function names. Made some other functions `fileprivate`. rdar://125087707
Swift ends up with OpaquePointer instead of a typed pointer. rdar://125087707
These can't be new API as they haven't been reviewed.
`_O_RDONLY` is zero, so we can't test for it by AND-ing.
We need to use `@testable` when importing `SystemPackage` in order to let us test the `internal` functions. Also, use `NUL` instead of `/dev/null`, and generate random bytes in a file instead of reading from `/dev/random`.
The values of these flags on Windows do not overlap, and more particularly, `O_RDONLY` is actually zero on Windows, which means we cannot test for it by AND-ing.
e06f111
to
b9e4d2b
Compare
lorentey
approved these changes
Oct 17, 2024
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.
Back-port pull requests #158 and #176 to the 1.4.0 branch.
These contain many fixes for Windows, including the
pipe
syscall.