Skip to content

test(wasi): enable absolute symlink tests#97

Draft
kkebo wants to merge 3 commits into
wasm32-wasifrom
enable-symlink-tests
Draft

test(wasi): enable absolute symlink tests#97
kkebo wants to merge 3 commits into
wasm32-wasifrom
enable-symlink-tests

Conversation

@kkebo
Copy link
Copy Markdown
Owner

@kkebo kkebo commented Oct 3, 2024

No description provided.

@kkebo kkebo self-assigned this Oct 3, 2024
@kkebo kkebo force-pushed the enable-symlink-tests branch from cb0d434 to bdeb322 Compare October 3, 2024 19:10
@kkebo kkebo changed the title test(FileIteratorTests): enable tests related to symlink test(wasi): enable tests related to symlink Oct 3, 2024
@kkebo kkebo force-pushed the enable-symlink-tests branch 4 times, most recently from ea10895 to dee2289 Compare October 5, 2024 23:11
@kkebo
Copy link
Copy Markdown
Owner Author

kkebo commented Oct 8, 2024

Features we need:

  1. symlink() can create absolute symlinks
  2. readlink() can read absolute symlinks
  3. readdir() can return absolute symlinks
  4. call stack size can be increased

Runtimes comparison:

wasmtime Wasmer WasmKit WasmEdge
1. symlink() ❌ (relative only) ❌ (relative only) ❌?
2. readlink() ❌ (relative only) ❌ (relative only)
3. readdir() ❌ (relative only)
4. call stack size ❌?

Related issues:

@kkebo kkebo force-pushed the enable-symlink-tests branch 2 times, most recently from 9487f1b to cb531a7 Compare October 10, 2024 12:31
@kkebo
Copy link
Copy Markdown
Owner Author

kkebo commented Oct 19, 2024

I'm going to create another PR #116 to enable relative symlink tests while leaving absolute symlink tests disabled. This PR will focus on absolute symlink tests.

@kkebo kkebo changed the title test(wasi): enable tests related to symlink test(wasi): enable absolute symlink tests Oct 19, 2024
@kkebo kkebo force-pushed the enable-symlink-tests branch from cb531a7 to 1c57532 Compare October 19, 2024 19:02
@kkebo kkebo marked this pull request as draft October 19, 2024 19:02
@kkebo kkebo force-pushed the enable-symlink-tests branch from 1c57532 to 5447da0 Compare October 18, 2025 11:40
@kkebo kkebo force-pushed the enable-symlink-tests branch 2 times, most recently from d9af3b7 to 956adb7 Compare January 18, 2026 16:02
@kkebo kkebo force-pushed the enable-symlink-tests branch from 956adb7 to 2ab2893 Compare March 3, 2026 14:00
@kkebo
Copy link
Copy Markdown
Owner Author

kkebo commented Mar 3, 2026

I've confirmed that all tests successfully passed when executed on the latest WasmKit. 🎉

@kkebo kkebo force-pushed the enable-symlink-tests branch from 1f3b89a to 04668c6 Compare March 3, 2026 16:34
@kkebo
Copy link
Copy Markdown
Owner Author

kkebo commented Mar 3, 2026

Now the Tests/ differences between upstream/main and enable-symlnk-tests are almost zero.

diff --git a/Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift b/Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift
index 1727c52..3c70593 100644
--- a/Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift
+++ b/Tests/SwiftFormatTests/Utilities/FileIteratorTests.swift
@@ -69,6 +69,12 @@ final class FileIteratorTests: XCTestCase {
   }
 
   override func tearDownWithError() throws {
+    #if os(WASI)  // https://github.com/swiftlang/swift-foundation/pull/1786
+    let iter = FileManager.default.enumerator(at: tmpdir, includingPropertiesForKeys: nil)!
+    for url in iter.reversed().compactMap({ $0 as? URL }) {
+      try FileManager.default.removeItem(at: url)
+    }
+    #endif
     try FileManager.default.removeItem(at: tmpdir)
   }

@kkebo kkebo force-pushed the enable-symlink-tests branch from 04668c6 to b95c581 Compare March 10, 2026 14:26
@kkebo
Copy link
Copy Markdown
Owner Author

kkebo commented May 5, 2026

This PR should revert 3725ed5 too.

@kkebo kkebo force-pushed the enable-symlink-tests branch from b95c581 to 0bdb431 Compare May 5, 2026 09:58
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.

1 participant