最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论