Skip to content

relax swift-syntax version constraint to allow 603#714

Merged
kateinoigakukun merged 2 commits intoswiftwasm:mainfrom
untitled-in-brackets:chore/relax-swift-syntax-constraint
Apr 9, 2026
Merged

relax swift-syntax version constraint to allow 603#714
kateinoigakukun merged 2 commits intoswiftwasm:mainfrom
untitled-in-brackets:chore/relax-swift-syntax-constraint

Conversation

@diederich
Copy link
Copy Markdown
Contributor

Packages are updating to 603 and this can fail the dependency solver.

@kateinoigakukun kateinoigakukun enabled auto-merge (squash) April 9, 2026 09:14
auto-merge was automatically disabled April 9, 2026 09:27

Head branch was pushed to by a user without write access

@diederich
Copy link
Copy Markdown
Contributor Author

Thanks for the quick accept! 🙏
Just sneaked in another commit after I saw CI testing against the different swift-syntax versions.

@diederich
Copy link
Copy Markdown
Contributor Author

And... that failed :-D

Saw there's 2 formatting only diffs it seems?

  -    _swift_js_push_i32((__bjs_elem_ret as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())}
  +    _swift_js_push_i32((__bjs_elem_ret as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())
  +    }

(and one more)

@kateinoigakukun
Copy link
Copy Markdown
Member

@krodak Would you mind fixing the protocol array code gen to use the proper CodeBlockItemSyntax unit so that the formatter can format it correctly?

private func lowerProtocolArrayStatements(
accessor: String,
varPrefix: String
) -> [CodeBlockItemSyntax] {
var statements: [CodeBlockItemSyntax] = []
let elemVar = "__bjs_elem_\(varPrefix)"
statements.append("for \(raw: elemVar) in \(raw: accessor) {")
statements.append(
" _swift_js_push_i32((\(raw: elemVar) as! _BridgedSwiftProtocolExportable).bridgeJSLowerAsProtocolReturn())"
)
statements.append("}")
statements.append("_swift_js_push_i32(Int32(\(raw: accessor).count))")
return statements

@krodak
Copy link
Copy Markdown
Member

krodak commented Apr 9, 2026

@kateinoigakukun sure, I'll start right on it

@diederich
Copy link
Copy Markdown
Contributor Author

diederich commented Apr 9, 2026

Thank you! 🙏

I just found something else related while trying to get my dependencies back in order 😅
This repo seems to be using package swift versioning the "other way around". I think the idea is to keep Package.swift (plain) as the most recent, then Package@swift-x.x.swift as the older versions.

Should we flip them around? (alternatively I can bump swift-syntax in both Package.swift files, or only in the newer, 6.2 version)

Edit:

see:

Note
Support for having a versioned manifest file with a newer tools version was required when the feature was first introduced because prior versions of the package manager were not aware of the concept and only knew to look for the unversioned Package.swift. This is still supported, but there have been many Swift releases since the feature was introduced. It is a best practice to have Package.swift declare the newest-supported tools version and for versioned manifest files to only specify older versions.

(via https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/swiftversionspecificpackaging/#Version-specific-Manifest-Selection)

@kateinoigakukun
Copy link
Copy Markdown
Member

Should we flip them around? (alternatively I can bump swift-syntax in both Package.swift files, or only in the newer, 6.2 version)

Oh, yes. Would be better to flip

@diederich
Copy link
Copy Markdown
Contributor Author

Should we flip them around? (alternatively I can bump swift-syntax in both Package.swift files, or only in the newer, 6.2 version)

Oh, yes. Would be better to flip

-> #715

@krodak
Copy link
Copy Markdown
Member

krodak commented Apr 9, 2026

Can't push to untitled-in-brackets/JavaScriptKit directly so opened PR with a fix: untitled-in-brackets#1

EDIT: Actually included fix in #716 , should work after this branch rebase on newest main

Packages are updating to 603 and this can fail the dependency solver.
@diederich diederich force-pushed the chore/relax-swift-syntax-constraint branch from 72a33d7 to 0a66372 Compare April 9, 2026 12:18
@diederich
Copy link
Copy Markdown
Contributor Author

Thanks @krodak ! 🙏
Rebased!

@diederich
Copy link
Copy Markdown
Contributor Author

Screenshot 2026-04-09 at 14 38 05 🤩 🙏

@kateinoigakukun kateinoigakukun merged commit 0d6544f into swiftwasm:main Apr 9, 2026
13 checks passed
@kateinoigakukun
Copy link
Copy Markdown
Member

Thanks!

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.

3 participants