Skip to content

6.4: compare CMAKE_SYSTEM_NAME against string literals#2041

Merged
jmschonfeld merged 1 commit into
release/6.4.xfrom
maxd/6.4-cmake-quotation
Jun 16, 2026
Merged

6.4: compare CMAKE_SYSTEM_NAME against string literals#2041
jmschonfeld merged 1 commit into
release/6.4.xfrom
maxd/6.4-cmake-quotation

Conversation

@MaxDesiatov

Copy link
Copy Markdown
Contributor

Explanation: As part of the bring up of debian13, the platform is using a newer cmake 3.31. cmake 3.31 sets WASI=1 so:

    if(CMAKE_SYSTEM_NAME STREQUAL WASI)

evaluates as "WASI" STREQUAL "1" on cmake 3.31 (which Is false), silently skipping the -D_GNU_SOURCE compile option for WASI targets. This results in

swift-foundation/Sources/FoundationEssentials/Platform.swift:421:16: error: cannot find 'strtod_l' in scope

during toolchain builds.

Debian 12 has Cmake 3.25 which has no WASI variable, so WASI fell through to a literal string and the condition evaluated correctly by comparing against the string literal
Scope: limited to WASI builds;
Risk: low due to limited scope;
Testing: tested in local builds and Debian 13 CI.
Issue: rdar://179825652
Reviewer: @jmschonfeld

@MaxDesiatov MaxDesiatov requested a review from a team as a code owner June 16, 2026 15:38
@MaxDesiatov MaxDesiatov requested a review from jmschonfeld June 16, 2026 15:38
@MaxDesiatov

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@jmschonfeld jmschonfeld merged commit e7d79e0 into release/6.4.x Jun 16, 2026
24 checks passed
@jmschonfeld jmschonfeld deleted the maxd/6.4-cmake-quotation branch June 16, 2026 21:25
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