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

error: path '/var' is a symlink on darwin in projects with flakes #138

Open
alanpearce opened this issue Nov 16, 2024 · 1 comment
Open

Comments

@alanpearce
Copy link

Describe the bug

To Reproduce
Steps to reproduce the behavior:

  1. Use macOS
  2. Check the default value of $TMPDIR
$ echo $TMPDIR
/var/folders/pc/qbb_zqd968z2j9wwkvtg7vv00000gn/T/
$ realpath $TMPDIR
/private/var/folders/pc/qbb_zqd968z2j9wwkvtg7vv00000gn/T
  1. Try to use lorri watch in a project with a flake (e.g. LnL7/nix-darwin)
Nov 16 12:02:36.796 ERRO Exit {
    cmd: "cd \"/Users/alan/projects/github.com/lnl7/nix-darwin\" && \"nix\" \"store\" \"add-file\" \"/var/folders/pc/qbb_zqd968z2j9wwkvtg7vv00000gn/T/.tmpKSQpFz/bash-export\"",
    status: Some(
        1,
    ),
    logs: [
        LogLine(
            "Text(\"error: path \'/var\' is a symlink\")",
        ),
    ],
}

Expected behavior
lorri should resolve links before calling nix store

Metadata

$ lorri info
Nov 16 12:06:54.730 ERRO error: either --shell-file or --flake is required
$ lorri info --flake .
Project Shell File: /Users/alan/projects/github.com/lnl7/nix-darwin/flake.nix
Project Garbage Collector Root: GC roots do not exist. Has the project been built with lorri yet?

General:
Lorri User GC Root Dir: /Users/alan/Library/Caches/com.github.nix-community.lorri.lorri.lorri/gc_roots
Lorri Daemon Socket: /Users/alan/Library/Caches/com.github.nix-community.lorri.lorri.lorri/daemon.socket
Lorri Daemon Status: `lorri daemon` is running
$ uname -a
Darwin marvin 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:06:57 PDT 2024; root:xnu-11215.41.3~3/RELEASE_ARM64_T6041 arm64

Additional context

I have no idea where macOS sets $TMPDIR, otherwise I'd consider changing that.

@jokatzke
Copy link

I also just ran into this problem. My work-around was to add export TMPDIR=$(readlink -f "$TMPDIR") to my .envrc files, just before evaluating lorri.

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

No branches or pull requests

2 participants