Skip to content

Consider returning /private/tmp instead of /tmp on macOS with std::env::temp_dir() #99608

Closed
@poliorcetics

Description

@poliorcetics

The first is a regular directory, the second is a symlink to the first. This can lead to software failing in strange and unexpected ways (especially during testing, with the tempfile crate or similar) if symlinks are forbidden, e.g. I recently encountered the case with SQLite

Since /tmp -> /private/tmp software that was already working correctly should not start to fail unexpectedly. Software that was failing/had to workaround this will start working correctly.

macos-12.4 $ /bin/ls -la /tmp
lrwxr-xr-x@ 1 root  wheel  11  9 mai 23:30 /tmp -> private/tmp

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-macosOperating system: macOST-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions