Saleem Abdulrasool
83875613ec
Internals: use CInterop.PlatformUnicodeString on Windows ( #34 )
...
The typealias was renamed but the Windows side of the build was not
updated. This prevents building System on Windows.
2021-03-16 19:24:10 -06:00
Michael Ilseman
58e9e1c0c9
Ugly, ugly workaround for Swift 5.3.3 bug
2021-03-15 17:43:14 -06:00
Michael Ilseman
cd4b42e03d
Mocking helper for path strings
2021-03-15 15:18:54 -06:00
Michael Ilseman
8031239cef
Emit withPlatformString as an availability workaround for open
2021-03-15 15:18:51 -06:00
Michael Ilseman
8b989f724f
Do not import CSystem on Darwin
2021-02-27 10:59:54 -07:00
Michael Ilseman
b28263a910
Fixup some merge issues
2021-02-26 12:59:31 -07:00
Michael Ilseman
bae68a5651
Use C type in typealias
2021-02-25 21:49:27 -07:00
Michael Ilseman
b6558a3a90
Normal imports
...
System is not an overlay and will not pull C and platform modules into the
user's namespace. Import constants normally rather than redefining them.
2021-02-25 21:40:25 -07:00
Karoy Lorentey
b9d290dc1e
Add missing @_implementationOnly attribute
2021-02-25 21:14:46 -07:00
Michael Ilseman
0734450867
Fixup compilation failures for some compilers
2021-02-25 21:14:46 -07: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
b63554656d
[gardening] Privatization of Mocking
2021-02-25 21:14:44 -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
Karoy Lorentey
2d24a58a41
Add support for dup/dup2
2021-02-24 13:30:07 -08:00
Michael Ilseman
03c0b7ada5
Fix release builds by making assert into fatalError
2021-02-08 09:21:35 -07:00
Karoy Lorentey
2904f9ead3
Add symbolic names for standard file descriptors
2021-02-05 19:35:18 -08:00
Michael Ilseman and Kyle 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
05e3d04b0c
Drop Component.isSpecialDirectory
...
This API is fully redundant with .kind == .regular and could be a source of
confusion and namespace pollution. Drop it for now, and we can add something
equivalent in the future when we have more component-analysis APIs.
2021-02-02 07:49:42 -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
Michael Ilseman
5d1b2fb985
Folders for FilePath and Platform sources
2020-11-13 16:57:25 -08:00
Saleem Abdulrasool
4ffcc62e9b
Initial port to Windows
...
This adds enough shims and tweaks the types sufficiently to allow
building System on Windows.
2020-11-03 15:03:51 -08:00
Saleem Abdulrasool
ac6ec0b19d
SystemInternals: make WindowsSyscallAdapters build
...
Correct some type errors, missing return type. Add a FIXME comment
regarding large file access.
2020-10-24 12:16:33 -07:00
Saleem Abdulrasool
bf90fedc88
SystemInternals: make Mocking build on Windows
...
Fix some of the type errors and add missing imports.
2020-10-23 14:32:24 -07:00
Michael Ilseman
1eeeaf7200
Initial Windows syscall adapters
2020-10-23 09:07:41 -07:00
Michael Ilseman
5712a28377
Windows TLS mocking support
2020-10-23 09:07:41 -07:00
Michael Ilseman
173c684973
TLS helpers to ease Windows support
2020-10-22 14:42:03 -07:00
Michael Ilseman
d2e26f72f3
Fix memory leak in withMockingEnabled
2020-10-22 10:43:12 -07:00
Michael Ilseman
a8d07f8a04
Leverage conditional compilation to reduce mocking boilerplate
2020-10-22 10:39:09 -07:00
Michael Ilseman
98a1531ea0
Remove mocking infrastructure from non-mocking builds
2020-10-21 16:09:04 -07:00
Michael Ilseman
138c7f1a71
Add Linux support for syscall mocking
2020-10-21 09:40:08 -07:00
Michael Ilseman
9489545fed
Syscall mock testing
...
Adds mocking and tracing infrastructure, test
infrastructure, and trace-based tests.
2020-10-21 09:22:46 -07:00
Michael Ilseman
8ffa04c0a0
Initial version of Swift System
2020-09-25 08:20:58 -07:00