haskell - Stack tried to find libgmp then failed, even with no dependencies at all - Stack Overflow

I use nix-darwin and have enabled nix in ~.stackconfig.yaml.Earlier today I did a sudo nix-collect-g

I use nix-darwin and have enabled nix in ~/.stack/config.yaml. Earlier today I did a sudo nix-collect-garbage -d then many things begin to break.

Minimum reproducible example:

stack new mwe
cd mwe
stack build
mwe> configure (lib + exe)
dyld[39413]: Library not loaded: /nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
  Referenced from: <0F2264AA-4505-36E1-A379-2BC393A601C5> /Users/futar/.stack/setup-exe-cache/aarch64-osx-nix/Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.6.6
  Reason: tried: '/nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib' (no such file), '/nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib' (no such file), '/usr/local/lib/libgmp.10.dylib' (no such file), '/usr/lib/libgmp.10.dylib' (no such file, not in dyld cache)

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package mwe-0.1.0.0 (scroll up to its section to see the error) using:
       ...
       Process exited with code: ExitFailure (-6)

A problem that I have never seen before this garbage collection.

Adding gmp as a nix package in stack.yaml does not help and result in the same error message. Neither will nix-shell -p gmp.

nix:
  enable: true
  packages:
    - gmp

I do have gmp-with-cxx here. Why can't stack find it? Why a wrong hash was used?

% ls /nix/store/*-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
/nix/store/lm1rva8c2649y4lys3d406s9ldicv8qv-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib

I use nix-darwin and have enabled nix in ~/.stack/config.yaml. Earlier today I did a sudo nix-collect-garbage -d then many things begin to break.

Minimum reproducible example:

stack new mwe
cd mwe
stack build
mwe> configure (lib + exe)
dyld[39413]: Library not loaded: /nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
  Referenced from: <0F2264AA-4505-36E1-A379-2BC393A601C5> /Users/futar/.stack/setup-exe-cache/aarch64-osx-nix/Cabal-simple_CKvAmRb3_3.10.3.0_ghc-9.6.6
  Reason: tried: '/nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib' (no such file), '/nix/store/lac8fhiz0pmif1bmrkkry3w4slc9wg47-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib' (no such file), '/usr/local/lib/libgmp.10.dylib' (no such file), '/usr/lib/libgmp.10.dylib' (no such file, not in dyld cache)

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package mwe-0.1.0.0 (scroll up to its section to see the error) using:
       ...
       Process exited with code: ExitFailure (-6)

A problem that I have never seen before this garbage collection.

Adding gmp as a nix package in stack.yaml does not help and result in the same error message. Neither will nix-shell -p gmp.

nix:
  enable: true
  packages:
    - gmp

I do have gmp-with-cxx here. Why can't stack find it? Why a wrong hash was used?

% ls /nix/store/*-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
/nix/store/lm1rva8c2649y4lys3d406s9ldicv8qv-gmp-with-cxx-6.3.0/lib/libgmp.10.dylib
Share Improve this question edited Nov 20, 2024 at 22:03 Futarimiti asked Nov 20, 2024 at 21:54 FutarimitiFutarimiti 6855 silver badges20 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Deleted ~/.stack/setup-exe-cache, stack clean --full and then stack build works. Not sure if I have to do this every time after nix-collect-garbage.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742325980a4422758.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信