poetry2nix icon indicating copy to clipboard operation
poetry2nix copied to clipboard

attribute 'pkg-config' missing after adding tensorflow via poetry in shell

Open KirinDave opened this issue 4 months ago • 1 comments

Describe the issue

After initializing a fresh directory on a fresh VM with installation of nix, within the flake directory, I type nix develop poetry add tensorflow tensorflow-probability exit

Subsequent attempts to run nix develop or nix build fail with the following error:

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/81xi4i2cng65w7a2dnidq62m1avli2gm-source/pkgs/stdenv/generic/make-derivation.nix:354:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'nix-shell'
         at /nix/store/81xi4i2cng65w7a2dnidq62m1avli2gm-source/pkgs/stdenv/generic/make-derivation.nix:398:7:
          397|       depsBuildBuild              = elemAt (elemAt dependencies 0) 0;
          398|       nativeBuildInputs           = elemAt (elemAt dependencies 0) 1;
             |       ^
          399|       depsBuildTarget             = elemAt (elemAt dependencies 0) 2;

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

       error: attribute 'pkg-config' missing
       at /nix/store/0pjr31l2hr6jiafi9wiyny5gszylw7c2-source/overrides/default.nix:975:32:
          974|                 (old.buildInputs or [ ])
          975|                 ++ [ pkgs.hdf5 self.pkg-config ]
             |                                ^
          976|                 ++ lib.optional mpiSupport mpi
       Did you mean pkgconfig?

Additional context

I managed to reproduce this on a NixOS vm as well as an ubuntu VM with just nix. I think this may be a missed edge case of #1446?

My apologies if this is obvious, I'm new to nix and so I lack the experience to debug this further or understand if it's obviously covered in your edgecase document.

KirinDave avatar Mar 15 '24 03:03 KirinDave

Hi ! I am facing the same issue with the package sdbus.

RenjiSann avatar Mar 25 '24 21:03 RenjiSann

There's pkgconfig which is old alias for pkg-config. But there's also pkgconfig-the-python-package... I think these self.pkg-config refer to the python package set which only has self.pkgconfig-the-python-package... so perhaps the #1446 was just wrong changing these..?

Fuuzetsu avatar Apr 08 '24 02:04 Fuuzetsu

I'm relatively new to nix as well. Is there a workaround to this until the PR makes it through?

weberbr avatar Apr 18 '24 20:04 weberbr