Skip to content

Conversation

@jmschonfeld
Copy link
Contributor

When _amkrtemp is available (FOUNDATION_FRAMEWORK cases) we should use this before trying mktemp to create the temporary file location to preserve characteristics of the final destination like sandbox extensions. This patch adds a new use of _amkrtemp first and falls back to the existing mktemp if that fails to preserve existing behavior for failure cases. It also adds some infrastructure to include a debug description in file path errors so we can indicate the original _amkrtemp failure if both _amkrtemp and mktemp fail.

@jmschonfeld jmschonfeld requested a review from kperryua August 21, 2025 18:30
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test Windows platform

@jmschonfeld jmschonfeld merged commit 1734c7b into swiftlang:main Aug 21, 2025
19 checks passed
@jmschonfeld jmschonfeld deleted the temp-dir-improvement branch August 21, 2025 20:53
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.

2 participants