20 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
Saleem Abdulrasool
88d6a8d619
FoundationEssentials: make build on Android (#705)
This adjusts the API usage to account for differences on Android. The
biggest source of difference is the nullability, particularly in the
`fts` APIs. Unfortunately, `MMAP_FAILED` is not imported by the clang
importer due to the casting involved so we manually inline the constant
at the single site.
2024-07-01 16:44: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
e473ab75be
FoundationEssentials: fix up linkOrCopyFile on Windows (#675)
Adjust the Windows path for copying (or linking) files. This adds the
missing recursion in the copy (the documentation for `CopyFile2` was not
clear that the recursive copy is not performed).
2024-06-12 09:26:03 -07:00
Saleem Abdulrasool
21ed596f06
FoundationEssentials: adjust error code thrown (#671)
Rather than relaying the underlying system error, replace the error with
the expected error code. This repairs the test case expectation of the
thrown error.
2024-06-12 08:37:16 -07:00
Saleem Abdulrasool
9371cbf702
FoundationEssentials: correct callbacks for moveItem(atPath:toPath:) (#661)
In the case that the destination exists, we should check for continue
after error. If the source does not exist, simply do nothing.

Furthermore, adjust the test to ensure that we are using the path
spelling rather than the FSR.

Take the opportunity to correct an error in the tests where we would not
check the correct captured item set.
2024-06-06 13:54:46 -07:00
Saleem Abdulrasool
38d2d4e7a8
FoundationEssentials: silence a warning (#662)
Convert a `var` to `let` as it was originally. This variable is no
longer mutated and causes a warning.
2024-06-06 09:52:59 -07:00
Saleem Abdulrasool
413b15cbd8
FoundationEssentials: tweak removeFile(_:with:) on Windows (#659)
Ensure that we call the callbacks at the appropriate time. Change the
indentation and encapsulating scope to avoid a double callback.
2024-06-05 13:31:20 -07:00
Jeremy Schonfeld
418fe5bf96
Eliminate removefile shims fixing release mode build (#655)
* (128703942) Eliminate removefile shims

* state -> _
2024-06-04 20:03:35 -07:00
Saleem Abdulrasool
2e26c64cc4
FoundationEssentials: correct the entry spelling for iteration (#653)
When running the test suite we would hit an infinite loop due to the use
of the relative path rather than the absolute path for accessing the
attributes of the file entry.
2024-06-04 09:57:02 -07:00
Saleem Abdulrasool
d1ace948b5
(128078378) FoundationEssentials: correct error handling for item removal (#610)
The condition of the error check was inverted as it was meant to be a
`guard` statement. This was resulting in an infinite loop. With this we
now pass a few additional tests and the test suite no longer hangs.
2024-05-14 13:40:54 -07:00
Jeremy Schonfeld
727bd07830
Utilize URL in FileManager (#589)
* Use URL in FileManager

* Fix warnings

* Fix build failures on Linux

* Remove Locale_ICU warning fix
2024-05-07 15:55:08 -07:00
Saleem Abdulrasool
6ff08b28b8
FoundationEssentials: repair the Windows build after tweaks (#570)
The changes to repair the macOS/Linux build adversely impacted the
Windows build. Accommodate the API and logic changes for Windows.
2024-04-30 08:00:13 -07:00
Saleem Abdulrasool
aabac27b21
FoundationEssentials: implement file operations (#566)
This adds an initial implementation for file operations on Windows. With
this, `FileManager` should at least build on Windows, which unblocks
future work as well as brings us closer to enabling
`FoundationEssentials` on Windows.
2024-04-29 15:34:46 -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
e5211f2926
(122981400) Standardize on using internal import 2024-03-06 13:42:02 -08:00
Jeremy Schonfeld
beeea05206
(123438249) FileManager.removeItem does not throw error when encountering long paths
* (123438249) FileManager.removeItem does not throw error when encoutering long paths

The change makes swift-foundation FileManager.removeItem properly throw
on removefile(3) errors.

* Conform POSIXError to Error

* Clean up warnings and produce more detailed test failures

* Fix macOS CI failure
2024-02-28 13:33:55 -08:00
Jeremy Schonfeld
12d6069721
(123104044) Consolidate/standardize file-based error reporting
* Consolidate/standardize file-based error reporting

* Fix build failures

* Fix test failures
2024-02-16 16:50:16 -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