-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation with Xcode >= 16.0 #5
Conversation
Same happens in swift-transformers repo https://swiftpackageindex.com/builds/F6095453-30D2-4175-8FBF-E28D9AD440FE it fails to compile because seems like swift 6 has |
Another solution would be to wrap regex literals in |
Thank you, I'll review it tonight. |
Adding [email protected] only solved the build issue, it didn't really make Jinja support Swift 6, right? |
yes, that's correct, it makes Jinja compile with >= Xcode 16.0, I'll update the PR title |
Perhaps we could do it this way? #if compiler(>=5.7)
#if hasFeature(BareSlashRegexLiterals)
let regex = /.../
#else
let regex = #/.../#
#endif
#else
let regex = try NSRegularExpression(pattern: "...")
#endif |
Looks good, however:
|
Sure, you can directly use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
I came across the issue when my package (which indirectly depends on
Jinja
) was built on swiftpackageindex.comThe build resulted in error, more info here:
https://swiftpackageindex.com/builds/EF6D0DF9-542C-47AE-9D1A-D16C8790BF71
Looks like the easiest fix is to provide a separate
Package.swift
for Swift 6.0. To repro it locally you can try to build it from command line using:Without
[email protected]
this should give an error, with it, it should build.