-
Notifications
You must be signed in to change notification settings - Fork 10.5k
5.10 compiler emits syntax error on code in #if(compiler>=6.0) block under specific conditions #79285
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
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
† libswiftSyntax
Archive • Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax
parser
Area → compiler: The legacy C++ parser
Comments
Related GitHub Issue on why we are seeing assertion on release toolchain |
AHC workaround by shuffling whitespace: swift-server/async-http-client#810 |
weissi
added a commit
to swift-server/async-http-client
that referenced
this issue
Feb 11, 2025
Specifically Swift 5.10 _on Intel on Ubuntu Noble (24.04)_ has a crazy bug which leads to compilation failures in a `#if compiler(>=6.0)` block: swiftlang/swift#79285 . This workaround fixes the compilation by _changing the whitespace_. Thanks @gwynne for finding this workaround! --------- Co-authored-by: Johannes Weiss <johannes@jweiss.io>
FranzBusch
added a commit
to apple/swift-metrics
that referenced
this issue
Mar 18, 2025
Specifically Swift 5.10 on Intel on Ubuntu Noble (24.04) has a crazy bug which leads to compilation failures in a #if compiler(>=6.0) block: swiftlang/swift#79285 . This workaround fixes the compilation by changing the whitespace.
FranzBusch
added a commit
to apple/swift-metrics
that referenced
this issue
Mar 18, 2025
Specifically Swift 5.10 on Intel on Ubuntu Noble (24.04) has a crazy bug which leads to compilation failures in a #if compiler(>=6.0) block: swiftlang/swift#79285 . This workaround fixes the compilation by changing the whitespace.
czechboy0
pushed a commit
to apple/swift-metrics
that referenced
this issue
Mar 18, 2025
Specifically Swift 5.10 on Intel on Ubuntu Noble (24.04) has a crazy bug which leads to compilation failures in a #if compiler(>=6.0) block: swiftlang/swift#79285 . This workaround fixes the compilation by changing the whitespace. Fixes #166
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
† libswiftSyntax
Archive • Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax
parser
Area → compiler: The legacy C++ parser
Description
When run in the
swift:5.10-noble
Docker image forx86_64
, the compiler emits a nonsensical syntax error for code enclosed in a#if compiler(>=6.0)
block which usessending
in a specific way (see reproduction below). The complete compiler output for the given repro is:This issue does not occur if run on any other OS (including any other version of Ubuntu), nor does it appear to occur on
arm64
, even in Noble.This bug appears when using the
5.10.1-RELEASE
compiler onx86_64
Ubuntu Noble (24.04) to build AsyncHTTPClient as of the 1.25.0 release, in the file StructuredConcurrencyHelpers.swift. See also async-http-client#809.Reproduction
Expected behavior
This code should compile as written.
It is worth noting that even a trivial modification of whitespace is sufficient to eliminate the build failure. For example, this version of the same code (a single newline has been removed) builds correctly:
Environment
Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional information
No response
The text was updated successfully, but these errors were encountered: