Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Sources/Commands/SwiftTestCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,9 @@ final class TestRunner {
args.append(runnerPath.pathString)
args.append(contentsOf: runner.extraCLIOptions)
args.append(testPath.relative(to: localFileSystem.currentWorkingDirectory!).pathString)
if runner.path?.components.last == "wasmkit" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a more robust way to check for WasmKit?

Copy link
Contributor Author

@MaxDesiatov MaxDesiatov Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Yes, it feels somewhat icky to check for a path component, but test runners from toolsets and Swift SDKs provide no other identification. Given that's all we have, why wouldn't we consider this simple and robust enough?

args.append("--")
Copy link
Contributor

@kkebo kkebo Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasmkit expects executable arguments to be passed after -- delimiter.

That has been fixed by swiftwasm/WasmKit#175, and the fix has been shipped as 0.1.4. So if you're going to merge swiftlang/swift#80820, you don't need to add the -- delimiter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great point, thanks!

}
args.append(contentsOf: self.additionalArguments)
} else {
#if os(macOS)
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageModel/SwiftSDKs/SwiftSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ extension SwiftSDK {
) throws -> [SwiftSDK] {
let wasmKitProperties = Toolset.ToolProperties(
path: hostToolchainBinDir.appending("wasmkit"),
extraCLIOptions: ["run"]
extraCLIOptions: ["run", "--dir", "."]
)

switch semanticVersion.schemaVersion {
Expand Down