21 Commits

Author SHA1 Message Date
Yuta Saito
0b3974d351
Guard out user/group related code on WASI (#783)
* Guard out user/group related code on WASI

This change guards out the user/group related code on WASI, as WASI does
not have the concept of users or groups.

* Throw explicit unsupported error if trying to set user or group on WASI

Instead of implicitly ignoring user-given values, we should throw
exception to make it clear that those values cannot be set on WASI.
2024-08-01 09:23:13 -07:00
Jeremy Schonfeld
75a3f5a047
[Windows] Standardize slashes before path processing (#731)
* Standardize backslashes before string path processing on Windows

* Call _standardizingSlashes() from normalizedPath(with:)

* Return self when possible on non-Windows
2024-07-15 09:51:58 -07:00
Jeremy Schonfeld
c3fc214351
(130296407) Gracefully handle confstr failures (#728) 2024-07-11 16:28:47 -07:00
Saleem Abdulrasool
a7692238a8
FoundationEssentials: initial pass to add Android support (#704)
This adds the necessary guards and includes for the Android modules.
While the module does not compile currently due to nullability
differences (and in some cases missing declarations), this at least
brings the module to a point where we can start working on the errors
and differences to create a maintainable codebase for Android.
2024-06-26 16:00:37 -07:00
Charles Hu
60506f3af4
Renamed _CShims to _FoundationCShims (#656)
Rationale: _CShims will effectivly become semi-public in the toolchain. We add the Foundation prefix to make it less generic.
2024-06-21 16:18:38 -07:00
Saleem Abdulrasool
08d50c1caa
FoundationEssentials: correct path canonicalisation handling on Windows (#639)
* FoundationEssentials: correct path canonicalisation handling on Windows

Strip the extended path prefix for bypassing the Win32 API layer. This
is guaranteed to be prefixed on strings as per the documentation.

* Update Sources/FoundationEssentials/String/String+Path.swift

Co-authored-by: Jeremy Schonfeld <1004103+jmschonfeld@users.noreply.github.com>

---------

Co-authored-by: Jeremy Schonfeld <1004103+jmschonfeld@users.noreply.github.com>
2024-05-30 13:12:47 -07:00
Charles Hu
b762e818f5
Improve String+Path performance by removing Regex (#612)
Reimplement `String._transmutingCompressingSlashes` and `pathHasDotDot` without using Regex. Reimplementing this method without Regex allows us to:
- Reduce the additional frames at launch since the Swift rewrite (Regex parsing brings in tons of frames)
- Not having to load additional dylib (`libswift_StringProcessing)
2024-05-15 13:00:05 -07:00
Jonathan Flat
e991656bd0
URL.init(filePath:) should resolve against the base URL before checking if the file is a directory (#606) 2024-05-13 17:22:28 -07:00
Jonathan Flat
4a526630f8
Support Windows URL paths in FoundationEssentials (#602) 2024-05-13 19:22:08 +00:00
Jonathan Flat
361efcf5fe
Port URL and URLComponents to swift-foundation (#586) 2024-05-06 09:51:18 -07:00
Saleem Abdulrasool
f299bde9df
FoundationEssentials: implement some path utilities on Windows (#547)
Add an implementation for querying the user's home directory and for
resolving symbolic links on Windows.
2024-04-17 14:26:00 -07:00
Saleem Abdulrasool
9491cce69c
FoundationEssentials: add some missing imports for Windows (#520)
This allows us to get further into building FoundationEssentials once
again on Windows. Much of the file system work has resulted in this
module no longer being viable on Windows and will need to be replaced to
allow building on Windows which does not have the `fts` APIs.
2024-03-29 14:19:23 -07:00
Jeremy Schonfeld
544ec6c816
(123714904) Ensure stable home directory for processes calling seteuid
* (123714904) Ensure stable home directory for processes calling seteuid

* (123714904) Add comments
2024-03-21 13:16:19 -07:00
Jeremy Schonfeld
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Jeremy Schonfeld
61835133f8
(123525912) FileManager should standardize home directory paths (#452) 2024-03-06 11:47:21 -08:00
Jeremy Schonfeld
0e23938f4b
(123636178) Resolving symlinks can remove prefix from path 2024-02-26 12:58:09 -08:00
Jeremy Schonfeld
5b06c5d5ac
(123102499) FileManager's setAttributes:forItemAtPath: is unnecessarily slow
* (123102499) Swift implementation of setAttributes:forItemAtPath: is slower than the old ObjC implementation

* Move relevant key list to static array

* Fix build failure
2024-02-20 11:46:54 -08:00
Jeremy Schonfeld
b8ef4ce99c
(122106445) Exclude some paths from automount standardization
* (122106445) Exclude some paths from automount standardization

* Fix linux build failure
2024-02-19 13:04:07 -08:00
Jeremy Schonfeld
33856a556d
(120741818) Port FileManager to swift-foundation
* (120741818) Port FileManager to swift-foundation

* (120741818) Fix linux test failures

* (120741818) Fix build failures
2024-02-09 15:03:43 -08:00
Jonathan Flat
f907600758
(121150146) String.lastPathComponent should return last non-empty component
Co-authored-by: Jonathan Flat <jflat@apple.com>
2024-02-07 14:13:53 -08:00
Tony Parker
4499edd7b1
Implement Data reading and writing (#377)
* Implement Data reading and writing

* Use swift-foundation-local for dependency name in benchmark
2024-01-17 13:04:41 -08:00