Andrew Kaster
eb3b1fa54b
Internals: Remove non-breaking spaces from Windows syscall adapter
...
This was causing a warning with Swift 6.0.2
2024-11-21 15:03:28 -07:00
Guillaume Lessard
fbd61a676d
Merge pull request #207 from glessard/merge-1.4.0-into-main
...
Merge 1.4.0 into main
2024-10-18 22:39:45 -07:00
Guillaume Lessard
f21f6a8866
Merge branch 'release/1.4.0' into merge-1.4.0-into-main
...
# Conflicts:
# .gitignore
# .swiftci/5_10_ubuntu2204
# .swiftci/5_8_ubuntu2204
# .swiftci/5_9_ubuntu2204
# .swiftci/nightly_6_0_macos
# .swiftci/nightly_6_0_ubuntu2204
# .swiftci/nightly_main_macos
# .swiftci/nightly_main_ubuntu2204
# .swiftci/nightly_main_windows
# Package.swift
# Sources/System/FileOperations.swift
# Sources/System/FilePath/FilePath.swift
# Sources/System/Internals/WindowsSyscallAdapters.swift
2024-10-17 17:24:38 -07:00
Guillaume Lessard
c8a44d836f
Merge pull request #206 from glessard/1.4.0-readme
...
[1.4.0] Updates to the README file
1.4.0
2024-10-17 16:12:10 -07:00
Guillaume Lessard
b80d743dab
Update README.md
2024-10-17 15:52:41 -07:00
Guillaume Lessard
eeeb81d0cd
[readme] update usage example, reword stability
2024-10-17 15:14:38 -07:00
Guillaume Lessard
234e15320e
Merge pull request #204 from glessard/1.4.0-ci-adjustment
...
[1.4.0] Swift 5.8 is not supported on this branch
2024-10-17 15:01:46 -07:00
Guillaume Lessard
154cbf7c95
Merge pull request #205 from glessard/1.4.0-pipe-correction
...
[windows] expose pipe’s buffer size parameter
2024-10-17 14:57:49 -07:00
Guillaume Lessard
3f4e7cb45c
[windows] expose pipe’s buffer size parameter
2024-10-17 14:31:37 -07:00
Guillaume Lessard
11d481252d
[1.4.0] Updates to the README file
2024-10-17 13:17:08 -07:00
Guillaume Lessard
2e8f58ac41
[1.4.0] Swift 5.8 is not supported on this branch
2024-10-17 08:49:29 -07:00
Guillaume Lessard
5cd7eade6d
Merge pull request #203 from glessard/systemstring-tweaks-1.4.0
...
[1.4.0] SystemString consistency improvements
2024-10-16 23:25:29 -07:00
Guillaume Lessard
b2d4917ebe
Update copyright notices
2024-10-16 23:09:09 -07:00
Guillaume Lessard
d96435c72b
Rename withSystemChars
...
- `withNullTerminatedSystemChars` makes it clear that the null-termination is included. Operations where the null-termination is included should be obvious.
2024-10-16 23:09:09 -07:00
Guillaume Lessard
95784d018f
Fix behaviour of withCodeUnits()
...
- The original implementation includes a trailing zero with the full collection, but the implementation for a slice does not. As a result, given a `let s: SystemString`, `s.string` was not equal to `s[…].string`
2024-10-16 23:09:09 -07:00
Guillaume Lessard
448bef7c38
Test SystemString.string property consistency
2024-10-16 23:09:09 -07:00
Guillaume Lessard
69e737de3d
Generate SystemString.string consistently
...
- SystemString.string and Slice<SystemString>.string should be generated in the same manner. Now they are.
2024-10-16 23:09:09 -07:00
Guillaume Lessard
afeecb6c28
Merge pull request #201 from glessard/32-are-too-few-bits-1.4.0
...
[1.4.0] fix a 32-bit overflow issue
2024-10-16 18:30:16 -07:00
Guillaume Lessard
69eee996ac
Merge pull request #202 from glessard/platform-support-1.4.0
...
[1.4.0] cherry-pick platform support changes
2024-10-16 18:29:59 -07:00
Finagolfin
209dfeacb8
Import new Android overlay
...
Use Bionic module instead where possible
2024-10-16 18:22:35 -07:00
Finagolfin
b2b60a6b94
Android: DIR* is an OpaquePointer in Bionic too
2024-10-16 18:22:19 -07:00
Max Desiatov
e11703d915
Add support for WASILibc module ( #159 )
...
Quoting the [wasi.dev landing page](https://wasi.dev ):
> The WebAssembly System Interface (WASI) is a group of standard API specifications for software compiled to the W3C WebAssembly (Wasm) standard. WASI is designed to provide a secure standard interface for applications that can be compiled to Wasm from any language, and that may run anywhere—from browsers to clouds to embedded devices.
Currently support for WASI in Swift is based on [`wasi-libc`](https://github.com/WebAssembly/wasi-libc ).
Adding support for `wasi-libc` mostly amounted to excluding unsupported errnos, adding TLS dictionary storage shim for single-threaded environment, and adding constants in C headers for macros that Clang importer currently doesn't support.
Co-authored-by: Guillaume Lessard <guillaume.lessard@apple.com >
# Conflicts:
# Sources/System/FileOperations.swift
# Sources/System/Internals/Syscalls.swift
2024-10-16 18:22:19 -07:00
Guillaume Lessard
8df901cb24
fix a 32-bit overflow issue
...
- ensures compatibility with watchOS
2024-10-16 17:57:36 -07:00
Guillaume Lessard
938fda53e2
Merge pull request #200 from glessard/private-aeic-init-removal-1.4.0
...
[1.4.0] backport #191
2024-10-16 17:41:50 -07:00
Guillaume Lessard
e7ffa45882
Remove private-and-@_aEIC initializers
...
These were just passthroughs.
2024-10-16 17:38:24 -07:00
Guillaume Lessard
607542a559
Merge pull request #198 from glessard/1.4.0-backport-158&176
2024-10-16 17:28:28 -07:00
Guillaume Lessard
b9e4d2b2ba
Remove more accidentally public functions
2024-10-16 17:03:59 -07:00
Guillaume Lessard
473b493ab0
Merge pull request #199 from glessard/1.4.0-backport-193
...
Add support for macCatalyst
2024-10-16 14:15:25 -07:00
George Barnett
9eb1f34cbf
Add support for macCatalyst
...
Building swift-system for macCatalyst fails as there is no import of the
Darwin module.
# Conflicts:
# Package.swift
2024-10-16 14:00:47 -07:00
Guillaume Lessard
7a18b4bf34
Merge pull request #193 from glbrntt/mac-catalyst
...
Add support for macCatalyst
2024-10-16 13:57:03 -07:00
Alastair Houghton
6c64372b85
[Windows] Add a comment to explain the O_RDONLY/O_WRONLY/O_RDWR logic.
...
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.
2024-10-14 16:01:01 -07:00
Alastair Houghton
3a4e2f8071
[Windows] Fix tests.
...
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`.
2024-10-14 16:01:01 -07:00
Alastair Houghton
53471ce33b
[Windows] Fix a problem with opening files read only.
...
`_O_RDONLY` is zero, so we can't test for it by AND-ing.
2024-10-14 16:01:01 -07:00
Alastair Houghton
f1d7eb52c6
Remove accidentally public functions.
...
These can't be new API as they haven't been reviewed.
2024-10-14 16:01:01 -07:00
Alastair Houghton
cf7530848e
[Linux] Glibc's DIR doesn't get imported into Swift.
...
Swift ends up with OpaquePointer instead of a typed pointer.
rdar://125087707
2024-10-14 15:59:36 -07:00
Alastair Houghton
5ae5d5a3af
Refactor FilePathTemp, add tests for permission code.
...
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
2024-10-14 15:59:36 -07:00
Alastair Houghton and Karoy Lorentey
bcc7f6d569
Update Sources/System/FilePath/FilePathTemp.swift
...
Co-authored-by: Karoy Lorentey <klorentey@apple.com >
2024-10-14 15:59:36 -07:00
Alastair Houghton
e293300430
Map mode bits to Windows ACLs.
...
This adds support for mapping POSIX-style mode bits to Windows ACLs when
calling `open()` or `mkdir()`.
rdar://125087707
2024-10-14 15:59:36 -07:00
Alastair Houghton
4cafcc96f6
Changes after comments from Saleem.
...
Use idiomatic Swift notation, not `Optional<Bool>`.
Prefer Win32 APIs to UCRT APIs.
rdar://125087707
2024-10-14 15:59:36 -07:00
Alastair Houghton
85de4e51e2
Use the proper temporary directory on Darwin.
...
It seems we can get the temporary directory from confstr().
rdar://125087707
2024-10-14 15:59:36 -07:00
Alastair Houghton
d4e2b09c37
Fix swift-system to work on Windows.
...
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
2024-10-14 15:59:36 -07:00
Guillaume Lessard
5ea5b2e89a
Merge pull request #197 from lorentey/merge-1.3.0→1.4.0
...
Merge release/1.3.0 to release/1.4.0
2024-10-14 11:02:40 -07:00
Karoy Lorentey
8564f96d1f
Merge branch 'release/1.3.0' into release/1.4.0
...
# Conflicts:
# .gitignore
# .swiftci/5_10_ubuntu2204
# .swiftci/5_8_ubuntu2204
# .swiftci/5_9_ubuntu2204
# .swiftci/nightly_6_0_macos
# .swiftci/nightly_6_0_ubuntu2204
# .swiftci/nightly_main_macos
# .swiftci/nightly_main_ubuntu2204
# .swiftci/nightly_main_windows
# Package.swift
# Sources/System/FilePath/FilePath.swift
# Sources/System/Internals/CInterop.swift
2024-09-19 16:50:34 -07:00
Karoy Lorentey
b85a788897
Merge pull request #196 from lorentey/metadata-updates
...
[1.4] Metadata updates
2024-09-19 15:31:34 -07:00
Karoy Lorentey
88a60e08b3
Update README
...
- Clarify swift-system’s stance on cross-platform abstractions. Stop using the term “multi-platform”.
- Expand source stability section.
- Add a section on our branching strategy.
- Link to the Code of Conduct document.
2024-09-19 13:01:48 -07:00
Karoy Lorentey
4c612a1e29
Bump required toolchain version to 5.9. Sanitize Package manifest
...
- Don’t define _CRT_SECURE_NO_WARNINGS outside Windows
- Let all targets share the same settings
2024-09-19 12:57:57 -07:00
Karoy Lorentey
603c451818
Add code of conduct
2024-09-19 12:49:08 -07:00
George Barnett
2662793bd6
Add support for macCatalyst
...
Building swift-system for macCatalyst fails as there is no import of the
Darwin module.
2024-08-19 10:20:12 +01:00
Guillaume Lessard
d581098eeb
Merge pull request #191 from glessard/private-aeic-init-removal
...
Remove private-and-@_aEIC initializers
2024-07-31 16:56:38 -07:00
Guillaume Lessard
edbc9e4fdc
Remove private-and-@_aEIC initializers
...
These were just passthroughs.
2024-07-31 16:30:25 -07:00