Skip to content

Do not write files atomically in WASI - #1315

Merged
rintaro merged 1 commit into
swiftlang:mainfrom
kkebo:do-not-write-atomically-in-wasi
Oct 26, 2026
Merged

rintaro merged 1 commit into
swiftlang:mainfrom
kkebo:do-not-write-atomically-in-wasi

Conversation

@kkebo

@kkebo kkebo commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

swift-format doesn't support the WebAssembly System Interface (WASI) yet, but this change is just preparation for future support for WASI.

In Swift's Foundation, atomic file writing isn't available on WASI since it uses a temporary directory and WASI doesn't have such a concept.

Therefore, I made changes to ensure that it isn't used on platforms that don't support atomic writing, such as WASI.

I've verified that swift test succeeds for wasm32-unknown-wasip1 in my fork's CI. The fork includes this PR's changes.

swift-format doesn't support the WebAssembly System Interface (WASI)
yet, but this change is just preparation for future support for WASI. In
Swift's Foundation, atomic file writing isn't available on WASI since it
uses a temporary directory and WASI doesn't have such a concept.

Therefore, I made changes to ensure that it isn't used on platforms that
don't support atomic writing, such as WASI.
@rintaro
rintaro merged commit 9a37afb into swiftlang:main Oct 26, 2026
36 of 41 checks passed
@kkebo
kkebo deleted the do-not-write-atomically-in-wasi branch October 27, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants