You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent Apple build lanes from leaving SwiftPM TemporaryDirectory.* markers and lock files in the Darwin user temp directory.
Xcode 26.2 / Swift 6.2.3 retained these artifacts even after successful swift build and xcodebuild build-for-testing commands. The affected build-lane invocations now run with an owned TMPDIR that is removed deterministically while preserving exit codes and forwarding termination signals. Production runner launches remain unchanged.
Adds regression coverage for successful and failing child processes and pins the macOS-helper and XCTest build lanes to the cleanup wrapper. Four files changed; scope stayed within Apple build/test tooling.
Before the fix, isolated successful runs retained six marker directories plus four locks for pnpm build:macos-helper, and two markers plus one lock for pnpm build:xcuitest:ios. After the fix, both commands succeeded with empty outer probe directories.
The regression was observed failing 3/3 before implementation and passing 3/3 afterward. pnpm test:smoke, the full Node integration lane, and pnpm check:affected --run passed; the affected aggregate covered formatting, lint, typecheck, layering, Fallow, package verification, build, changed-line coverage, integration progress, and replay compatibility.
P1: scripts/swift-toolchain-tmpdir.ts deletes the owned TMPDIR before the toolchain child has exited on SIGINT/SIGTERM. The handler calls child.kill(signal) and immediately process.exit(...); the exit hook removes the directory while xcodebuild/Swift or descendants may still be flushing, and the existing tests cover only normal exit 0/17. Forward the signal once, await child close/wait before cleanup and exit (with a bounded forced-kill policy if needed), and add a delayed-SIGTERM regression proving TMPDIR remains until the child exits.
Re-reviewed exact head e91b651: all CI is green, and the Apple build-lane evidence is adequate for this tooling-only change. One P1 still blocks readiness.
The signal fix waits for and force-kills only the direct swift/xcodebuild child. A spawned compiler/build descendant can outlive that parent; once the direct child closes, the wrapper exits and deletes its owned TMPDIR underneath the surviving descendant. The new delayed-shutdown test exercises only one child, so it cannot catch this production shape.
Please launch the toolchain under an owned process group, forward and escalate signals to that group, retain TMPDIR until the group is quiescent with a bounded policy, and add a red/green regression where the direct child exits on SIGTERM while a delayed descendant continues to use/check TMPDIR.
Re-reviewed exact head 348cf8c4: the descendant/process-group P1 is fixed. The wrapper creates an owned process group, forwards and escalates signals to the group, waits boundedly for group quiescence before exit-hook cleanup, and the delayed-descendant regression is non-vacuous—it fails if only the direct child is signaled or TMPDIR is deleted after that child exits. Code review is clean and this is ready for human review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ready-for-humanValid work that needs human implementation, judgment, or maintainer merge
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent Apple build lanes from leaving SwiftPM
TemporaryDirectory.*markers and lock files in the Darwin user temp directory.Xcode 26.2 / Swift 6.2.3 retained these artifacts even after successful
swift buildandxcodebuild build-for-testingcommands. The affected build-lane invocations now run with an ownedTMPDIRthat is removed deterministically while preserving exit codes and forwarding termination signals. Production runner launches remain unchanged.Adds regression coverage for successful and failing child processes and pins the macOS-helper and XCTest build lanes to the cleanup wrapper. Four files changed; scope stayed within Apple build/test tooling.
Follow-up to #1595.
Validation
Before the fix, isolated successful runs retained six marker directories plus four locks for
pnpm build:macos-helper, and two markers plus one lock forpnpm build:xcuitest:ios. After the fix, both commands succeeded with empty outer probe directories.The regression was observed failing 3/3 before implementation and passing 3/3 afterward.
pnpm test:smoke, the full Node integration lane, andpnpm check:affected --runpassed; the affected aggregate covered formatting, lint, typecheck, layering, Fallow, package verification, build, changed-line coverage, integration progress, and replay compatibility.