Skip to content

[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
merged 12 commits into from
Oct 17, 2024

Conversation

glessard
Copy link
Contributor

Back-port pull requests #158 and #176 to the 1.4.0 branch.

These contain many fixes for Windows, including the pipe syscall.

al45tair and others added 11 commits October 14, 2024 15:59
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
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.
@glessard glessard force-pushed the 1.4.0-backport-158&176 branch from e06f111 to b9e4d2b Compare October 17, 2024 00:04
@glessard glessard merged commit 607542a into apple:release/1.4.0 Oct 17, 2024
@glessard glessard deleted the 1.4.0-backport-158&176 branch October 17, 2024 00:29
@glessard glessard changed the title 1.4.0 backport 158&176 [1.4.0] backport 158&176 Oct 17, 2024
@glessard glessard changed the title [1.4.0] backport 158&176 [1.4.0] cherry-pick #158 & #176 Oct 17, 2024
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.

3 participants