Skip to content

nix store --realize returns invalid folder #6996

Open
@yawnt

Description

Describe the bug

When I run nix build or nix-store --realize $DRV the returned output path is not valid.
Maybe I'm doing something very wrong, but this is quite puzzling 🤔 . I would really appreciate any guidance! Thanks

Steps To Reproduce

  1. Download https://github.com/yawnt/declarative-nix-flatpak/tree/bug
  2. Run nix build
  3. DRV=$(fgrep -o -H "keyboard.json" /nix/store/*PlexHTPC*drv | uniq | cut -d":" -f 1)
  4. nix-store --realize $DRV
  5. the above command will return a folder in /nix/store, if you try to ls that folder is is missing

Expected behavior

The path returned by nix-store --realize should be the correct install output.

nix-env --version output
nix-env (Nix) 2.11.0

Additional context

Interesting bit is that the path returned by nix-store --realize $DRV exists during the build (I can ls it), but it disappears afterwards.

# during build
tv.plex.PlexHTPC> ++ ls /nix/store/znw930rx83djssg6r2ks0rxjw979czgb-tv.plex.PlexHTPC
tv.plex.PlexHTPC> tv.plex.PlexHTPC

# after
$ ls /nix/store/znw930rx83djssg6r2ks0rxjw979czgb-tv.plex.PlexHTPC                                                                        
ls: cannot access '/nix/store/znw930rx83djssg6r2ks0rxjw979czgb-tv.plex.PlexHTPC': No such file or directory

# but i can find it in another directory in /nix/store
$ ls /nix/store/ykmdh1mkrv7w8pb1w4gg5xzciv737jmg-tv.plex.PlexHTPC:
tv.plex.PlexHTPC

The issue doesn't manifest if I remove patchPhase from the derivation in flake.nix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugca-derivationsDerivations with content addressed outputs

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions