Repository navigation
Fall back to a real temporary directory when TMPDIR and TMP are unset - #521
Merged
Merged
Conversation
fzhinkin
self-requested a review
October 30, 2026 15:02
Collaborator
|
Sorry for the long time for the reply. In general, the change makes sense. I'll double check the behavior, update docs and will merge it everything is OK. |
Collaborator
|
I switched Windows version to using |
fzhinkin
approved these changes
Nov 4, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On the Linux, Android Native and MinGW targets
SystemTemporaryDirectoryisPath("")when neitherTMPDIRnorTMPis set, which is the normal state of a container, a systemd unit or a CI runner. Every path built from it then resolves against the filesystem root: with both variables unset,:kotlinx-io-core:linuxX64Testfails 19 tests withFailed to open /<name> with Permission denied, andSmokeFileTest.checkTmpDirfails onexists(SystemTemporaryDirectory).The shared
nativeNonAppleactual is replaced by one per source set:unixfalls back to/tmp,mingwfalls back toGetTempPathA, which consultsTMP,TEMP,USERPROFILEand the Windows directory in turn. Lookup order for a set variable is unchanged.Verified on develop (
5b94edd1):env -u TMPDIR -u TMP ./gradlew :kotlinx-io-core:linuxX64Testfails 19 of 1115 before, exits 0 after;compileKotlinMingwX64andcheckLegacyAbipass. The MinGW change is compiled here, not run.