Skip to content

Fix pipe2 detection for Apple deployment targets - #134028

Merged
lewing merged 4 commits into
mainfrom
lewing-fix-xcode-pipe2-detection
Sep 16, 2026
Merged

lewing merged 4 commits into
mainfrom
lewing-fix-xcode-pipe2-detection

Conversation

@lewing

@lewing lewing commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Replace the CoreCLR PAL's symbol-only pipe2 check with a call-site compile probe. On Apple hosts, availability diagnostics are treated as errors so APIs unavailable at the configured deployment target are rejected.

Use a distinct probe result to avoid shared or preloaded HAVE_PIPE2 cache entries skipping this PAL-specific check.

Validation

  • ./build.sh clr+libs+host
  • Reproduced the original Xcode 27 failure with a fresh artifacts/obj/coreclr/browser.wasm.Release configuration using ./build.sh clr -os browser -arch wasm -c Release
  • Re-ran the same fresh build after the fix: passed with the macOS host configuration selecting HAVE_PIPE2=0 and compiling threadsusp.cpp
  • Confirmed the browser/Emscripten configuration continues to select HAVE_PIPE2=1

Resolves #134024

Note

This pull request was generated with the assistance of GitHub Copilot.

Use a compile probe that calls pipe2 and treats Apple availability diagnostics as errors, while keeping the result independent from shared feature caches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 16, 2026 04:18
@github-actions github-actions Bot added the area-PAL-coreclr only for closed issues label Sep 16, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@lewing
lewing requested a review from akoeplinger September 16, 2026 04:20
Use a PAL-specific probe variable so browser cache regeneration cannot preseed the host deployment-target check.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No blocking issues were identified.

Review tier: Lite
Findings: None

What changed in this PR

Fixes CoreCLR PAL pipe2 detection for Apple deployment targets using a call-site compile probe.

Changes:

  • Replaces symbol-only detection with deployment-aware compilation.
  • Treats unavailable Apple APIs as errors.
  • Preserves fallback behavior for unsupported targets.
File Summary
src/​coreclr/​pal/​src/​configure.cmake Adds deployment-aware pipe2 feature detection.

Copilot AI review requested due to automatic review settings September 16, 2026 04:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The probe result must be propagated so debug-pal cannot use a stale HAVE_PIPE2 value.

Get a fresh assessment by requesting another Copilot review.

Review tier: Lite
Findings: 1 High severity

Open (1)

Comment thread src/coreclr/pal/src/configure.cmake
Comment thread src/coreclr/pal/src/configure.cmake
Publish the deployment-aware result to the CMake cache so sibling directories such as debug-pal cannot observe the stale preloaded value.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 16, 2026 04:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The cached probe may become stale when Apple SDK, deployment target, or compiler flags change.

Review tier: Lite
Findings: None

Resolved since last review (1)

Keep the PAL-specific cache key and Apple availability diagnostic while using the existing CMake helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 16, 2026 05:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical configure-order and stale-cache issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review tier: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)

Comment thread src/coreclr/pal/src/configure.cmake
Comment thread src/coreclr/pal/src/configure.cmake
@jkotas
jkotas requested a review from jkoritzinsky September 16, 2026 05:17
@lewing
lewing enabled auto-merge (squash) September 16, 2026 05:57
@lewing
lewing disabled auto-merge September 16, 2026 14:35
@lewing
lewing merged commit 34590a4 into main Sep 16, 2026
111 checks passed
@lewing
lewing deleted the lewing-fix-xcode-pipe2-detection branch September 16, 2026 14:36

set(PREVIOUS_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CLR_CMAKE_HOST_APPLE)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can do this more globally rather than just for this symbol, opened #134073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-PAL-coreclr only for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xcode 27 pipe2 detection breaks macOS host builds targeting macOS 14

5 participants