0

for some reason i'm unable to compile cabal projects related to cardano projects on this system. not sure what could of changed recently as aside from recent system updates i haven't changed much. or anything at all for that matter related to haskell or cardano development.

I first noticed it when i was unable to build the atlas examples. however now i'm getting this error even when trying to compile the cardano-node/cli repo by running the cabal build all command.

❯ cabal build all
Warning: Requested index-state 2023-07-21T13:00:00Z is newer than
'cardano-haskell-packages'! Falling back to older state
(2023-07-21T12:48:43Z).
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: cardano-cli (user goal)
[__0] rejecting: cardano-cli-8.3.2.0, cardano-cli-8.3.1.0,
cardano-cli-8.3.0.0, cardano-cli-8.2.1, cardano-cli-8.2.0 (constraint from
user target requires ==8.1.2)
[__0] trying: cardano-cli-8.1.2
[__1] trying: ouroboros-consensus-protocol-0.5.0.4 (dependency of cardano-cli)
[__2] trying: cardano-crypto-tests-2.1.2.0 (dependency of
ouroboros-consensus-protocol)
[__3] next goal: cardano-crypto-praos (dependency of cardano-crypto-tests)
[__3] rejecting: cardano-crypto-praos-2.1.2.0, cardano-crypto-praos-2.1.1.2,
cardano-crypto-praos-2.1.1.1, cardano-crypto-praos-2.1.1.0,
cardano-crypto-praos-2.1.0.0, cardano-crypto-praos-2.0.0.1,
cardano-crypto-praos-2.0.0.0.1, cardano-crypto-praos-2.0.0 (conflict:
pkg-config package libsodium-any, not found in the pkg-config database)
[__3] fail (backjumping, conflict set: cardano-crypto-praos,
cardano-crypto-tests)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cardano-crypto-praos,
cardano-crypto-tests, ouroboros-consensus-protocol, cardano-cli
Try running with --minimize-conflict-set to improve the error message

versions of ghc / cabal and environment variables.

❯ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
❯ cabal --version
cabal-install version 3.6.2.1
compiled using version 3.6.2.0 of the Cabal library 
❯ printenv | grep -i _path
LD_LIBRARY_PATH=/usr/local/lib
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
❯ pkg-config --list-all | grep -i libsodium
libsodium                      libsodium - A modern and easy-to-use crypto library
❯ tree /usr/local/lib
/usr/local/lib
├── libblst.a
├── libsecp256k1.a
├── libsecp256k1.la
├── libsecp256k1.so -> libsecp256k1.so.0.0.0
├── libsecp256k1.so.0 -> libsecp256k1.so.0.0.0
├── libsecp256k1.so.0.0.0
├── libsodium.a
├── libsodium.la
├── libsodium.so -> libsodium.so.23.3.0
├── libsodium.so.23 -> libsodium.so.23.3.0
├── libsodium.so.23.3.0
└── pkgconfig
    ├── libblst.pc
    ├── libsecp256k1.pc
    └── libsodium.pc

libsodium.pc

❯ cat /usr/local/lib/pkgconfig/libsodium.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libsodium
Version: 1.0.18
Description: A modern and easy-to-use crypto library

Libs: -L${libdir} -lsodium
Libs.private:  -pthread 
Cflags: -I${includedir}
1
  • I am getting the same issue on nixOS. libsodium is marked as broken in nixpkgs Commented Apr 23 at 7:29

1 Answer 1

0

Got it to compile successfully again. If you are using fedora 39 then you are going to be stuck using pkg-config version 1.9.5 (or at least that was the version i had at the time of this post) In the repos i wasn't able to downgrade or upgrade. so i went to the pkg-config repo where i was able to checkout the 2.0 tag and build, compile and install pkg-config. confirmed that the version was 2.0 and went back to the cardano-node repo and ran cabal build all and it is compiling successfully again. hope this is helpful to someone.

Not the answer you're looking for? Browse other questions tagged or ask your own question.