Skip to content

swift test is not supported with Swift SDK for Wasm in Swift 6.2 development snapshots #9113

@MaxDesiatov

Description

@MaxDesiatov

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

With swift-DEVELOPMENT-SNAPSHOT-2025-09-07-a_wasm and earlier snapshots swift test is not function.

Expected behavior

swift test runs as well with Swift SDKs for Wasm as it does for host platforms.

Actual behavior

Multiple errors are printed, one of them is a crash:

Error: Trap: unreachable
    0: $s10Foundation6BundleC05_mainB033_6273FB07A96EB35BCC520B3A80F5C3CDLL_WZ
    1: swift_once
    2: $s10Foundation6BundleC4mainACvgZ
    3: $s6XCTest11XCTMainMisc_9arguments9observersAA19TestSuiteOrExitCodeOSayAA0A4CaseCm04testK5Class_SaySS_yAHKctG8allTeststG_SaySSGSayAA0A11Observation_pGSgtF
    4: $s6XCTest7XCTMain_9arguments9observerss5Int32VSayAA0A4CaseCm04testF5Class_SaySS_yAHKctG8allTeststG_SaySSGSayAA0A11Observation_pGSgtYaFTY0_
    5: swift::runJobInEstablishedExecutorContext(swift::Job*)
    6: swift_job_run
    7: $ss19CooperativeExecutorC8runUntilyySbyXEKF05$ss19aB17C3runyyKFSbyXEfU_Tf1cn_n
    8: $ss19CooperativeExecutorCs07RunLoopB0ssACP3runyyKFTW
    9: swift_task_asyncMainDrainQueueImpl
    10: swift_task_asyncMainDrainQueue
    11: main
    12: __main_void
    13: _start
    14: unknown

Steps to reproduce

Run swift test --swift-sdk "$(swiftc -print-target-info | jq -r '.swiftCompilerTag')_wasm" on any package that has a test target.

Swift Package Manager version/commit hash

b6a3d95

Swift & OS version (output of swift --version ; uname -a)

Apple Swift version 6.2-dev (LLVM 664ae58e84fa81a, Swift 44bd40dd5c2767b)
Target: arm64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions