Commit 36d4c73
Fix missing comma in @_expose attribute for SwiftSyntax602 (#555)
* Fix missing comma in @_expose attribute for SwiftSyntax602
The SwiftSyntax602 code path in `buildExposeAttributes` was using array
literal syntax to construct `LabeledExprListSyntax`, which doesn't set
`trailingComma` on the AST nodes. This resulted in malformed attributes:
`@_expose(wasm "name")` instead of `@_expose(wasm, "name")`.
The fix uses the result builder syntax with explicit `.with(\.trailingComma,
.commaToken())` to ensure the comma is present in the generated code.
Also adds a dedicated `bridgejs-test` CI job that tests BridgeJS with
multiple Swift/SwiftSyntax version combinations to ensure both code paths
(pre-602 and 602+) are exercised:
- Swift 6.0.3 with SwiftSyntax 600.0.1
- Swift 6.1.2 with SwiftSyntax 601.0.1
- Swift 6.2 with SwiftSyntax 602.0.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Rename CI job to test-bridgejs-against-swift-versions
* Simplify CI: let SPM resolve SwiftSyntax version naturally
Remove sed-based version pinning that caused linker errors on Swift 6.2.
Swift 6.2 ships with prebuilt SwiftSyntax 602.0.0, and forcing an exact
version caused duplicate symbol errors during linking.
Each Swift version naturally resolves to compatible SwiftSyntax:
- Swift 6.0.x → SwiftSyntax 600.x
- Swift 6.1.x → SwiftSyntax 601.x
- Swift 6.2.x → SwiftSyntax 602.x
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Remove Swift 6.0.3 from test matrix
The codebase uses trailing commas in argument lists (BridgeJSToolInternal.swift)
which requires Swift 6.1+. Testing with 6.1.2 and 6.2 covers both SwiftSyntax
code paths (non-602 and 602).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Force SwiftSyntax 602.x for Swift 6.2 CI job
On Swift 6.2, SPM resolves to SwiftSyntax 600.0.1 by default (per Package.swift),
which doesn't have the SwiftSyntax602 module. Use sed to temporarily force
SwiftSyntax 602.x so we actually test the SwiftSyntax602 code path.
This also may avoid the prebuilt binary linker conflicts that occur with
SwiftSyntax 600.0.1 on Swift 6.2.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Disable experimental SwiftSyntax prebuilts for BridgeJS tests
* Override swift-syntax version via environment variable
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>1 parent d4c16e4 commit 36d4c73
File tree
3 files changed
+35
-5
lines changed- .github/workflows
- Plugins/BridgeJS
- Sources/BridgeJSCore
3 files changed
+35
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
70 | 97 | | |
71 | 98 | | |
72 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
767 | 768 | | |
768 | 769 | | |
769 | 770 | | |
| |||
0 commit comments