numtide / devshell

Per project developer environments
https://numtide.github.io/devshell/
MIT License
1.16k stars 86 forks source link

Shell when included with `packagesFrom` stops building #315

Open zmrocze opened 1 month ago

zmrocze commented 1 month ago

Describe the bug

Given:

devshells.default.devshell = {
  name = "Haskell shell";
  packagesFrom = [ config.devShells.haskell ];
}

The default shell fails to build eventhough the original haskell shell builds. The default shell is empty otherwise and doesn't define any additional commands or dependencies.

Steps To Reproduce

Reproduction exists in the flake: https://github.com/zmrocze/reproduce-haskell.nix-template-shell-doesnt-build. Run:

nix develop github:zmrocze/reproduce-haskell.nix-template-shell-doesnt-build#default

and observe a failed build with:

error: collision between `/nix/store/xvfiswlgj9m2v5xhx1i09rsny9w6470n-vector-lib-vector-0.13.1.0/package.conf.d/package.cache' and `/nix/store/5mln06qzjihh3fp7na9ghz51rnni55gx-containers-lib-containers-0.6.5.1/package.conf.d/package.cache'

Then change default to haskell and observe a success, eventhough I expect shells to be the same.

Expected behavior

I expect the default shell to functionally the same as the haskell shell from which it originates. I wouldn't expect an error of this kind.

zmrocze commented 1 month ago

ties in with #311

elland commented 1 month ago

this happens for me on aarch64-darwin while it doesn't happen on x86_64-linux. here's where you can find the code: https://github.com/MangoIV/cabal-audit/pull/29/commits/bc82249379011b0ac0229d470bf50ad76c18e5a7

not using the devShell generated by the haskell shellFor function via devshell fixes the problem...