astro / nix-openwrt-imagebuilder

Build OpenWRT images in Nix derivations
MIT License
129 stars 16 forks source link

Unable to build with "bash" package #36

Closed joe2xyz closed 9 months ago

joe2xyz commented 9 months ago

Dear Astro and other maintainers,

Thank you for the amazing builder.

I found a strange issue and that is when I add bash:

packages = [ "bash" ]

then I get

error:
       … while calling the 'derivationStrict' builtin

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

       … while evaluating derivation 'openwrt-23.05.2-ipq806x-generic-netgear_r7800'
         whose name attribute is located at /nix/store/1dklh99pdzxcxmrxz3i63rb3pa832yik-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'configurePhase' of derivation 'openwrt-23.05.2-ipq806x-generic-netgear_r7800'

         at /nix/store/3qmllgziy0j99yr1g37yfmxj6sxrx6qq-source/builder.nix:67:3:

           66|
           67|   configurePhase =
             |   ^
           68|     let

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

       error: attribute 'libncursesw6' missing

       at /nix/store/3qmllgziy0j99yr1g37yfmxj6sxrx6qq-source/files.nix:180:20:

          179|             with_new_dep = current_deps // { ${new_dep} = true; };
          180|             deps = packages.${new_dep}.depends;
             |                    ^
          181|           in
       Did you mean libncurses6?

Only bash is causing the problem. For example packages = [ "rsync" ] works just fine but packages = [ "bash" "rsync" ] fails.

Thank you.

astro commented 9 months ago

Thank you for your report. The problem was not recognizing multiple names in a package's provides field.

@tomjnixon You wrote the original code. Please verify this change.

tomjnixon commented 9 months ago

Makes sense to me, thanks for fixing it.

Unfortunately I no longer use this though -- I sometimes want to build openwrt myself, so it proved easier and more consistent to build imagebuilders containing all of my required packages, and then build those into images with a much simpler nix setup (based on the builder in this repository without the package handling).

Sorry for contributing a load of complex code then leaving you to it! That wasn't what i intended at all.

astro commented 9 months ago

Sorry for contributing a load of complex code then leaving you to it! That wasn't what i intended at all.

bash wouldn't be installable without your work, and obviously there are users.

joe2xyz commented 9 months ago

I works! Thank you!