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

path: flake reference has some weird behavior #11567

Open
bryanhonof opened this issue Sep 23, 2024 · 0 comments
Open

path: flake reference has some weird behavior #11567

bryanhonof opened this issue Sep 23, 2024 · 0 comments
Labels

Comments

@bryanhonof
Copy link
Member

bryanhonof commented Sep 23, 2024

Describe the bug

When using the path: flake reference to point to flakes inside a git repo, it has some odd behavior.

Steps To Reproduce

$ pushd "$(mktemp -d)"
/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS ~
$ git init
Initialized empty Git repository in /private/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS/.git/
$ nix flake init
wrote: /private/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS/flake.nix
$ nix build path:.
error (ignored): error: end of string reached
error:
       … while fetching the input 'path:.'

       error: file '/private/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS/.git/fsmonitor--daemon.ipc' has an unsupported type
$ # Or
$ nix build path:$PWD
error (ignored): error: end of string reached
error:
       … while fetching the input 'path:/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS'

       error: path '/var' is a symlink
$ nix build "path:$PWD/"
error (ignored): error: end of string reached
error:
       … while fetching the input 'path:/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS/'

       error: path '/var' is a symlink
$ nix build "path:$(realpath $PWD)/"
error (ignored): error: end of string reached
error:
       … while fetching the input 'path:/private/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS/'

       error: file '/private/var/folders/vw/ksgd_r_j51704dss486tzpmc0000gn/T/tmp.aMK4pdtqNS/.git/fsmonitor--daemon.ipc' has an unsupported type

Expected behavior

I would expect Nix to ignore paths that it can't read, or understand, instead of throwing an error.

nix-env --version output

$ nix-env --version
nix-env (Nix) 2.24.6

Additional context

I'm trying to use path: to get around the whole git+file: using HEAD as ref by default.
I'd like to not have to git add . every time I want to evaluate my flake when I'm iterating over it, hence trying to use path:.

Priorities

Add 👍 to issues you find important.

@bryanhonof bryanhonof added the bug label Sep 23, 2024
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