Skip to content

Task.sleep is not available in Embedded Swift for Wasm #84058

@MaxDesiatov

Description

@MaxDesiatov

Description

No response

Reproduction

Install Swift SDKs for Wasm for a corresponding swift.org toolchain and try to build this code

import _Concurrency
@main struct Main {
  static func main() async {
    await Task.sleep(1234)
  }
}

It fails to build with error: 'sleep' is unavailable: unavailable in embedded Swift

Expected behavior

Code builds and works.

Environment

Apple Swift version 6.2-dev (LLVM 720e920f24c166e, Swift a5fa3edf54e72fa)
Target: arm64-apple-macosx15.0
Build config: +assertions

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConcurrencуArea → standard library: The `Concurrency` module under the standard library umbrellaWASIWebAssembly System Interface supportWebAssemblyPlatform: WebAssemblybugA deviation from expected or documented behavior. Also: expected but undesirable behavior.embeddedEmbedded Swift

    Type

    No type

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions