<p>Got it to compile successfully again. If you are using <code>fedora 39</code> then you are going to be stuck using <code>pkg-config version 1.9.5</code> (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 <code>pkg-config</code> <a href="https://github.com/pkgconf/pkgconf" rel="nofollow noreferrer">repo</a> where i was able to checkout the <code>2.0 tag</code> and build, compile and install <code>pkg-config</code>. confirmed that the version was <code>2.0</code> and went back to the <code>cardano-node</code> repo and ran <code>cabal build all</code> and it is compiling successfully again. hope this is helpful to someone.</p>

CC BY-SA 4.0
2023-12-04T19:49:56.663Z
2023-12-04T19:49:56.663Z
Kunikos
<p>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.</p>
<p>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 <code>cabal build all</code> command.</p>
<pre><code>❯ 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
</code></pre>
<p>versions of ghc / cabal and environment variables.</p>
<pre><code>❯ 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 -&gt; libsecp256k1.so.0.0.0
├── libsecp256k1.so.0 -&gt; libsecp256k1.so.0.0.0
├── libsecp256k1.so.0.0.0
├── libsodium.a
├── libsodium.la
├── libsodium.so -&gt; libsodium.so.23.3.0
├── libsodium.so.23 -&gt; libsodium.so.23.3.0
├── libsodium.so.23.3.0
└── pkgconfig
    ├── libblst.pc
    ├── libsecp256k1.pc
    └── libsodium.pc
</code></pre>
<p>libsodium.pc</p>
<pre><code>❯ 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}
</code></pre>

CC BY-SA 4.0
2024-04-23T07:29:36.590Z
I am getting the same issue on nixOS.
libsodium is marked as broken in nixpkgs
user1202538
<cardano-cli><cardano-node><haskell><cabal><ghc>
Cardano Node Compiler Error libsodium Fedora
# Cardano Node Compiler Error libsodium Fedora

(Asked by: username_0 on 2023-12-03)

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}

**Tags:** cardano-cli, cardano-node, haskell, cabal, ghc
> **Comments:**
> **username_1**: I am getting the same issue on nixOS. libsodium is marked as broken in nixpkgs  

---

## 1 answers

### Answer by username_0 on 2023-12-04. Score: 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](https://github.com/pkgconf/pkgconf) 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.


---

