Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devbox: unset TMPDIR in shell/run environment #691

Merged
merged 1 commit into from
Feb 25, 2023
Merged

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Feb 25, 2023

Summary

Nix sets TMPDIR to its own path when building an environment and then prints it with print-dev-env. Devbox "leaks" TMPDIR, meaning it takes the TMPDIR from the parent shell and overwrites the Nix TMPDIR. However, this doesn't work when TMPDIR isn't set in the parent shell, which is the case in WSL and Docker.

This is a quick fix for just TMPDIR. We should double check the other variables that nix develop unsets when there's more time to test.

How was it tested?

$ unset TMPDIR
$ devbox shell
$ echo $TMPDIR
<nothing set>

Nix sets TMPDIR to its own path when building an environment and then
prints it with `print-dev-env`. Devbox "leaks" TMPDIR, meaning it takes
the TMPDIR from the parent shell and overwrites the Nix TMPDIR. However,
this doesn't work when TMPDIR isn't set in the parent shell, which is
the case in WSL and Docker.

This is a quick fix for just TMPDIR. We should double check the other
variables that `nix develop` unsets when there's more time to test.
Copy link
Contributor

@loreto loreto left a comment

Choose a reason for hiding this comment

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

LGTM

@gcurtis gcurtis merged commit c4de4dc into main Feb 25, 2023
@gcurtis gcurtis deleted the gcurtis/tmpdir-fix branch February 25, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants