Skip to content

[6.3][CMake] Avoid 'swiftc -parse' with stdin to check compiler capability#3291

Merged
rintaro merged 1 commit intoswiftlang:release/6.3from
rintaro:6.3-cmake-swift-compiler-capability-stdin
Mar 6, 2026
Merged

[6.3][CMake] Avoid 'swiftc -parse' with stdin to check compiler capability#3291
rintaro merged 1 commit intoswiftlang:release/6.3from
rintaro:6.3-cmake-swift-compiler-capability-stdin

Conversation

@rintaro
Copy link
Copy Markdown
Member

@rintaro rintaro commented Mar 3, 2026

Cherry-pick #3290 into release/6.3

  • Explanation: Previously, we checked the host compiler's capabilities by invoking: swiftc -parse - with a dummy input via stdin. However, when the host compiler is built with assertions enabled, this triggers an assertion failure, causing all capability checks to fail. Although this is technically a compiler bug, this change works around the issue by using a regular file input instead swiftc -parse dummy.swift
  • Scope: swift-syntax libraries in the compiler
  • Risk: Low. The macOS toolchain has already been built with correct capabilities, because the host compiler is not assertion enabled.
  • Testing: Passes the existing test-suite
  • Issue: rdar://171655848
  • Reviewer: Hamish Knight (@hamishknight)

When the host compiler is built with assertions, `swiftc -parse -` hits
an assertion failure, which fails the capability checks.

(cherry picked from commit cdb8ae3)
@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented Mar 3, 2026

@swift-ci Please test

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented Mar 4, 2026

@swift-ci Please test macOS

@rintaro
Copy link
Copy Markdown
Member Author

rintaro commented Mar 4, 2026

@swift-ci Please test Linux

@rintaro rintaro merged commit 2b59c0c into swiftlang:release/6.3 Mar 6, 2026
36 checks passed
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