11 Commits
Author SHA1 Message Date
Rauhul Varma 9a1530813e Replace bespoke availability system
Removes the script based availability system with the experimental
availability macro feature.
2025-07-30 08:40:08 -07:00
Stephen Canon 4c96faa6d8 Insure that FilePath and SystemString's invariants are enforced when decoding. 2024-07-17 12:14:43 -04: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
Karoy Lorentey bb6ab43e44 Update availability declarations 2023-03-01 18:10:40 -08:00
Karoy Lorentey c0e8ef346b Update package with changes from recent ABI stable releases
This brings the contents of this package up to date with versions of the ABI stable `System` module that shipped in recent iOS/macOS releases.

Most changes only touch internal implementation details, but some ABI-related fixes also affect the public API. There are no source-incompatible changes.

- ABI stability fixes (un-deprecate CModeT, don't use PlatformChar in inlinable contexts that need to deploy to iOS 14)
- New utilities: `_RawBuffer`, `Array<String>._withCStringArray`, `_withOptionalUnsafePointerOrNull`, `_withStackBuffer`, `system_memset`
- Prefer using explicit optionals to implicitly-unwrapped ones
- Add support for wildcard matching in mocking tests
- A bunch of new availability annotations. (I expect there will be more of these coming in future PRs.)
2021-12-21 17:50:21 -08:00
Michael Ilseman d7611ca8ad Internalize SystemInternals
Scrap the separate module SystemInternals and instead have it be a
subdirectory. Adjust all access control accordingly. One day, when Swift gets
proper submodules or supermodules (i.e. resilience domains), we can reinstate
it. For now, a separate module makes binary distribution much more
complicated.
2021-02-25 21:14:46 -07:00
Michael Ilseman 7b33caf850 Add commented out availability.
Add it for public APIs, though we will likely have to add it for internal
stuff too as a compiler workaround.
2021-02-25 21:11:15 -07:00
Michael IlsemanandKyle Macomber d24083e1be Integrate API review
Fix bug in _modify and add better testing. Change lexicallyNormal to
lexicallyNormalized() to match "ed" rule.

Fix up some comments and remove some dead code

Co-authored-by: Kyle Macomber <kmacomber@apple.com>
2021-02-04 16:34:20 -07:00
Michael Ilseman 2167575e66 Add FilePath Syntactic Operations API
Add the proposed non-file-system-interacting FilePath operations, Component,
Root, and ComponentView.

Proposal: https://forums.swift.org/t/api-review-filepath-syntactic-apis-version-2/44197

This change includes API/ABI additions and deprecations.
2021-02-01 08:42:44 -07:00
Michael Ilseman 920ef3085d Add PlatformString and Windows support
Add CInterop namespace and PlatformChar/PlatformEncoding typealiases for
narrow/wide characters.

Change Windows syscalls to use wide-character variants. Add full Windows root
parser to error-correct malformed roots and correctly normalize roots and
post-root portions of the path.

Add platformString APIs as replacements for cString APIs.

Add internal SystemString as backing storage type for FilePath.

Add Windows path mocking support.

This change includes API/ABI additions and deprecations.
2021-02-01 08:20:05 -07:00
Michael Ilseman 79eed1f99d Enforce at construction/mutation that FilePath's separators are normalized 2020-11-13 17:28:05 -08:00