lorri icon indicating copy to clipboard operation
lorri copied to clipboard

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

Open alanpearce opened this issue 11 months ago • 2 comments

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.

alanpearce avatar Nov 16 '24 12:11 alanpearce