Guillaume Lessard
a34201439c
Merge pull request #220 from glessard/1.4.2
...
[1.4.x] Support for FreeBSD and OpenBSD
2025-02-18 15:35:23 -08:00
Guillaume Lessard
12573bfb88
Merge branch 'main' into 1.4.2
2025-02-17 17:03:43 -08:00
Guillaume Lessard
3a1b4a8e05
Merge pull request #219 from glessard/1.4.1
...
[1.4.x] Use GetTempPathW for better compatibility
2025-02-17 14:04:33 -08:00
Guillaume Lessard
d9b03016dc
Merge pull request #218 from glessard/1.4.1
...
[1.4.x] Use GetTempPathW for better compatibility
2025-02-17 11:52:53 -08:00
xuty
f18ed75481
Use GetTempPathW for better compatibility
2025-02-17 11:43:11 -08:00
Guillaume Lessard
b1b7b60a55
Merge pull request #215 from 3405691582/openbsd
...
OpenBSD support.
2025-02-10 14:41:18 -08:00
Guillaume Lessard
2228d64644
Merge pull request #213 from Steelskin/fabrice/cmake-install-paths
...
[cmake] Install libraries in standard directories
2025-02-07 11:00:22 -08:00
3405691582
3b053e055b
ManagedBuffer.capacity is unavailable on OpenBSD.
...
`.capacity` is backed by malloc introspection (`malloc_size`), which is
not available on all platforms. The workaround is straightforward here,
thankfully: instead, use the minimum capacity already specified.
2025-02-04 19:44:35 -05:00
3405691582
90702d6d15
Typealias system_DIRPtr for OpenBSD.
2025-02-04 19:44:32 -05:00
Guillaume Lessard
849d005b2b
Merge pull request #211 from ShaftUI/temp-path-w
...
[Windows] Use GetTempPathW in _getTemporaryDirectory for better compatibility
2025-01-30 15:00:27 -08:00
Guillaume Lessard
8790e47013
Merge pull request #214 from michael-yuji/freebsd-wip
...
Add FreeBSD errno and open options
2025-01-29 15:50:13 -08:00
Guillaume Lessard
f27874d762
Merge pull request #209 from ADKaster/install-interface
...
CSystem: Set build and install interfaces on included headers
2025-01-28 13:49:12 -08:00
Michael Chiu
df7341ee2b
fix cmake x86_64 build
2025-01-26 21:29:19 -08:00
Michael Chiu
4d735a6631
Add FreeBSD errnos and open options
2025-01-26 21:29:13 -08:00
Fabrice de Gans
bebd7c146e
[cmake] Install libraries in standard directories
...
Previously, libs were installed under `lib/swift/${os}`. They should be
installed in the default library directory for the relevant target
system.
In addition, swiftmodules were installed in the older layout format.
This changes to use the standard modern layout format for swiftmodules.
2025-01-23 11:45:17 -08:00
michael-yuji
4fa2a719c5
Merge pull request #212 from michael-yuji/freebsd-wip
...
Guard errnos not available on FreeBSD
2025-01-17 21:52:07 -08:00
Michael Chiu
0d824eee86
refactor ifdef in test
2025-01-17 15:06:28 -08:00
Michael Chiu
eb566de2d3
Fix tests on FreeBSD
2025-01-17 14:43:40 -08:00
Michael Chiu
a4fb6cb206
Keep order consistent
2025-01-17 14:43:34 -08:00
Michael Chiu
7e73a336fb
Guard errnos not available on FreeBSD
2025-01-17 14:30:51 -08:00
xuty
85b83fddb1
Use GetTempPathW for better compatibility
2024-12-17 15:13:15 +08:00
Guillaume Lessard
61a2af5e8b
Merge pull request #210 from ADKaster/remove-nbsp
...
Internals: Remove non-breaking spaces from Windows syscall adapter
2024-11-22 19:38:54 -05:00
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
Andrew Kaster
f1393b76f3
CSystem: Set build and install interfaces on included headers
2024-11-21 14:48:57 -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
7a18b4bf34
Merge pull request #193 from glbrntt/mac-catalyst
...
Add support for macCatalyst
2024-10-16 13:57:03 -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
Stephen Canon
9c42c54644
Merge pull request #189 from stephentyrone/enforce-file-path-invariants-in-decode
...
Ensure that FilePath and SystemString's invariants are enforced when …
2024-07-17 14:49:19 -04:00
Stephen Canon
3841a7531f
Add some notes explaining what invariants are violated.
2024-07-17 13:49:15 -04:00
Stephen Canon
3b43b391b5
Add some comments and remove leftover WIP noise.
2024-07-17 12:49:37 -04:00
Stephen Canon
c64775ef71
Another invariant to check
2024-07-17 12:25:34 -04:00
Stephen Canon
4c96faa6d8
Insure that FilePath and SystemString's invariants are enforced when decoding.
2024-07-17 12:14:43 -04:00
Guillaume Lessard
19e7f0fdd4
Merge pull request #187 from finagolfin/droid
...
Import new Android overlay
2024-07-08 17:20:28 -07:00
Finagolfin
02811ea6b4
Import new Android overlay
...
Use Bionic module instead where possible
2024-07-08 17:53:39 +05:30
Guillaume Lessard
2ce971a831
Merge pull request #155 from glessard/system-string-api-consistency
...
SystemString api consistency improvements
2024-07-05 14:26:21 -07:00
Guillaume Lessard
80788529b5
Merge pull request #170 from glessard/platform-flags
...
Make a platform-specific flag explicitly platform-specific
2024-07-05 14:24:12 -07:00
Guillaume Lessard
05fb1f1142
Merge pull request #178 from apple/dev/merge-1.3.0-back-to-main
...
[gardening] Merge the release/1.3.0 branch back into main
2024-07-03 16:22:44 -07:00
Guillaume Lessard
8d2dda76fa
Merge pull request #186 from futurejones/add-riscv64-support
...
add support for riscv64
2024-06-18 16:21:38 -07:00
Neil Jones
c1789e0525
add support for riscv64
2024-06-18 10:45:08 +09:00
Yuta Saito
318d2159d1
Merge pull request #182 from kateinoigakukun/katei/suppress-cmakelists-warning
...
Suppress unhandled CMakeLists.txt warning by SwiftPM
2024-06-06 03:08:41 +09:00
Yuta Saito
9c17c8562d
Suppress unhandled CMakeLists.txt warning by SwiftPM
2024-06-03 02:15:29 +00:00
Guillaume Lessard
0d6be7ac22
Merge branch 'release/1.3.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/Internals/CInterop.swift
# Sources/System/Internals/Constants.swift
# Sources/System/Internals/Exports.swift
# Sources/System/Internals/Syscalls.swift
# Tests/SystemTests/FileOperationsTest.swift
2024-05-16 11:51:10 -07:00
Guillaume Lessard
b642f54526
Merge pull request #175 from glessard/32-are-too-few-bits
...
fix a 32-bit overflow issue
2024-05-14 11:32:44 -07:00
Alastair Houghton
36987d6d37
Merge pull request #176 from al45tair/remove-unintended-public
...
Remove unintentional public functions and fix a couple of Windows issues.
2024-05-14 14:52:12 +01:00
Alastair Houghton
082adfe732
[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-05-14 14:42:57 +01:00
Alastair Houghton
abc0a6d26f
[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-05-13 15:13:31 +01:00
Alastair Houghton
c3559ecd61
[Windows] Fix a problem with opening files read only.
...
`_O_RDONLY` is zero, so we can't test for it by AND-ing.
2024-05-13 14:18:17 +01:00
Alastair Houghton
8e09ede76d
Remove accidentally public functions.
...
These can't be new API as they haven't been reviewed.
2024-05-13 11:19:43 +01:00
Guillaume Lessard
25c4b1ad75
fix a 32-bit overflow issue
...
- ensures compatibility with watchOS
2024-05-12 14:07:11 -07:00
Karoy Lorentey
aac7f54e89
Merge pull request #174 from lorentey/codeowners
...
Add CODEOWNERS
2024-05-10 17:17:48 -07:00
Karoy Lorentey
a6fd8ba9ba
Add CODEOWNERS
2024-05-10 17:06:59 -07:00
Mishal Shah
3433699e6e
[CI] Remove support for Swift 5.7
2024-05-10 16:32:21 -07:00
Guillaume Lessard
d8c0e24651
Merge pull request #169 from glessard/manifest-fix
...
Improved compatibility for visionOS support
2024-05-10 15:42:15 -07:00
Guillaume Lessard
63b05e24e8
Improved compatibility for visionOS support
2024-05-10 15:37:04 -07:00
Guillaume Lessard
b0e2a510ed
Make a platform-specific flag explicitly platform-specific
2024-05-10 15:28:43 -07:00
Guillaume Lessard
cf5e688e70
Merge pull request #162 from finagolfin/droid
...
Android: DIR* is an OpaquePointer in Bionic too
2024-05-09 09:31:47 -07:00
Guillaume Lessard
93d600b5c9
Merge pull request #161 from jmschonfeld/string-init-ambiguity
...
Disfavor String.init(platformString: UnsafePointer<CChar>)
2024-05-09 09:26:56 -07:00
Finagolfin
7fe8e6cfc2
Android: DIR* is an OpaquePointer in Bionic too
2024-05-09 19:29:36 +05:30
Mishal Shah
84077b3b4b
Add Swift CI Support
2024-05-08 15:21:09 -07:00
Alastair Houghton
027c936a26
Merge pull request #158 from al45tair/eng/PR-125087707
...
Fix swift-system to work on Windows.
2024-05-08 16:13:21 +01:00
Alastair Houghton
f5ad5e57fb
[Linux] Glibc's DIR doesn't get imported into Swift.
...
Swift ends up with OpaquePointer instead of a typed pointer.
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
2357d6932c
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-05-08 16:09:56 +01:00
Alastair Houghton and Karoy Lorentey
33773a8eb9
Update Sources/System/FilePath/FilePathTemp.swift
...
Co-authored-by: Karoy Lorentey <klorentey@apple.com >
2024-05-08 16:09:56 +01:00
Alastair Houghton
21638a06b1
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-05-08 16:09:56 +01:00
Alastair Houghton
ec7d406cd4
Changes after comments from Saleem.
...
Use idiomatic Swift notation, not `Optional<Bool>`.
Prefer Win32 APIs to UCRT APIs.
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
c6456a9c03
Use the proper temporary directory on Darwin.
...
It seems we can get the temporary directory from confstr().
rdar://125087707
2024-05-08 16:09:56 +01:00
Alastair Houghton
cfd3f9da90
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-05-08 16:09:54 +01:00
Max Desiatov and Guillaume Lessard
40b6b0ef8c
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 >
2024-04-30 17:11:39 +01:00
Guillaume Lessard
6609a401b9
Update copyright notices
2024-03-08 12:16:44 -08:00
Guillaume Lessard
17e9790792
Rename withSystemChars
...
- `withNullTerminatedSystemChars` makes it clear that the null-termination is included. Operations where the null-termination is included should be obvious.
2024-03-08 12:16:43 -08:00
Guillaume Lessard
def7b1a70c
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-03-08 12:13:04 -08:00
Guillaume Lessard
c86758849a
Test SystemString.string property consistency
2024-03-08 12:13:04 -08:00
Guillaume Lessard
afb7fa4eef
Generate SystemString.string consistently
...
- SystemString.string and Slice<SystemString>.string should be generated in the same manner. Now they are.
2024-03-08 12:13:04 -08:00