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

Nix mangles TMPDIR path even when absolute on MacOSl #6214

Closed
jakubgs opened this issue Mar 7, 2022 · 1 comment
Closed

Nix mangles TMPDIR path even when absolute on MacOSl #6214

jakubgs opened this issue Mar 7, 2022 · 1 comment
Labels

Comments

@jakubgs
Copy link

jakubgs commented Mar 7, 2022

Describe the bug

I'm runnign 2.6.0 on MacOS and I'm seeing some strange behavior when setting TMPDIR.
Specifically, it appears Nix prefixes my absolute path with /private/, ignores slashes and creates an invalid path.

Steps To Reproduce

  1. Crate simplest default.nix derivation:
echo '{ test = "TEST"; }' > default.nix
  1. Make sure no TMPDIR is set
unset TMPDIR
  1. Attempt to build the derivation. Without error this time.
nix-build --no-out-link
  1. Set TMPDIR to some absolute path.
export TMPDIR=/tmp/test
mkdir -p $TMPDIR
  1. Attempt to build the derivation.
nix-build --no-out-link
  1. See error
error: getting status of '/private/tmptest': No such file or directory

Expected behavior

I'd expect Nix to use my TMPDIR as-is, without trying to modify it, but if it's trying to modify it to prefix it with /private it should at least do it correctly.

nix-env --version output

nix-env (Nix) 2.6.0
@jakubgs jakubgs added the bug label Mar 7, 2022
@jakubgs
Copy link
Author

jakubgs commented Mar 7, 2022

But as I typed it out I realized there is 2.6.1 which fixes this issue. And I think I even know which commit did it:

  • 32a7724 - canonPath: fix missing slash when resolving links

So I mostly opened this just for documentation. In case anyone else encounters it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant