Skip to content

PackageToJS: Derive WASI and shared memory support from wasm imports - #807

Draft
kateinoigakukun wants to merge 2 commits into
mainfrom
yt/rework-swiftbuild-support
Draft

PackageToJS: Derive WASI and shared memory support from wasm imports#807
kateinoigakukun wants to merge 2 commits into
mainfrom
yt/rework-swiftbuild-support

Conversation

@kateinoigakukun

Copy link
Copy Markdown
Member

The SwiftBuild backend's build directory doesn't encode the target triple, so detect the traits derived from it by parsing the imports of the product binary instead. The imports are now parsed as a part of the packaging build graph.

The SwiftBuild backend's build directory doesn't encode the target triple, so
detect the traits derived from it by parsing the imports of the product binary
instead. The imports are now parsed as a part of the packaging build graph.
@kateinoigakukun
kateinoigakukun force-pushed the yt/rework-swiftbuild-support branch from 3f6620f to 9b9828e Compare August 18, 2026 12:24
```
$ echo "@preconcurrency import var Foundation.stderr" | swiftly run +main-snapshot-2026-08-11 swiftc  - -o /dev/null
<stdin>:1:28: error: ambiguous name 'stderr' in module 'Foundation'
1 | @preconcurrency import var Foundation.stderr
  |                            `- error: ambiguous name 'stderr' in module 'Foundation'
2 |

Glibc.stderr:1:32: note: found this candidate
1 | nonisolated(unsafe) public var stderr: UnsafeMutablePointer<FILE>! { get }
  |                                `- note: found this candidate

/usr/include/stdio.h:151:14: note: found this candidate
149 | extern FILE *stdin;               /* Standard input stream.  */
150 | extern FILE *stdout;              /* Standard output stream.  */
151 | extern FILE *stderr;              /* Standard error output stream.  */
    |              `- note: found this candidate
152 | /* C89/C99 say they're macros.  Make them happy.  */
153 | #define stdin stdin
```

swiftlang/swift#89891
@kateinoigakukun
kateinoigakukun force-pushed the yt/rework-swiftbuild-support branch from 0a9d143 to 9544834 Compare August 18, 2026 13:10
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