nix-community / nix-bundle

Bundle Nix derivations to run anywhere! [maintainer=@matthewbauer, @Artturin]
MIT License
658 stars 47 forks source link

Unable to bundle drv with name set instead of pname #115

Open kgtkr opened 1 month ago

kgtkr commented 1 month ago

my-package is a drv with name set instead of pname (e.g. a package created with writeShellApplication)

$ nix bundle .#my-package
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating the derivation attribute 'name'

         at /nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source/pkgs/stdenv/generic/make-derivation.nix:336:7:

          335|     // (optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          336|       name =
             |       ^
          337|         let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'pname' missing

       at /nix/store/rg7wfg8l79ashynpxywci4jaz92315w4-source/default.nix:18:45:

           17|     stdenv.mkDerivation {
           18|       name = if drvToBundle != null then "${drvToBundle.pname}-arx" else "arx";
             |                                             ^
           19|       passthru = {
       Did you mean name?
michaelvanstraten commented 3 weeks ago

Same problem here.