nix-community / comma

Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]
1.09k stars 48 forks source link

Comma tries to create a directory in /nix/store #62

Open PaulGrandperrin opened 1 year ago

PaulGrandperrin commented 1 year ago

Hi, I'm running comma from nixos-23.05 and I get this error:

NIX_PATH= , distrobox                                                                                        
error: creating directory '/nix/store/849qs729ij1x7vg454851frzyb0riz5c-comma-with-db-1.6.0/share/cache/nix': Read-only file system
Artturin commented 1 year ago

comma doesn't create any directories.

The more appropriate repo to report this in should be nix-index but only if you've tested the newest version of nix-index, which you can do by using the flake in https://github.com/nix-community/nix-index-database which is where comma-with-db comes from.

Artturin commented 1 year ago

Cc @Mic92

Mic92 commented 1 year ago

Does the error goes away if you set XDG_CACHE_HOME to some writable directory?

Mic92 commented 1 year ago

Hang on. This issue should get resolved when upgrading to nix-index 0.1.6: https://github.com/nix-community/nix-index-database/blob/9d2bcc47110b3b6217dfebd6761ba20bc78aedf2/nix-index-wrapper.nix#L24

Mic92 commented 1 year ago

Stable is on 0.1.5, so you would need to get it from unstable, backport it yourself or upgrade to nixos unstable.

Artturin commented 1 year ago

Then https://github.com/nix-community/nix-index-database/blob/9d2bcc47110b3b6217dfebd6761ba20bc78aedf2/comma-wrapper.nix#L28 is wrong? And should be checking nix-index version

Mic92 commented 1 year ago

This is the nix-index version: https://github.com/nix-community/nix-index-database/blob/9d2bcc47110b3b6217dfebd6761ba20bc78aedf2/comma-wrapper.nix#L25

Mic92 commented 1 year ago

This is what the wrapper looks like:

#! /nix/store/vqvj60h076bhqj6977caz0pfxs6543nb-bash-5.2-p15/bin/bash -e
export NIX_INDEX_DATABASE='/nix/store/mdpqxk0k4mgisd4p4r3haha4szk347kh-nix-index-with-db-0.1.7/share/cache/nix-index'
exec "/nix/store/g5w2prb7nml7kwvnn6572z3h8hq39cs8-nix-index-0.1.7/bin/nix-locate"  "$@"