Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build version 8.1.2 due to a missing libsodium library. #5528

Open
andrejpodzimek opened this issue Nov 5, 2023 · 9 comments
Open
Labels

Comments

@andrejpodzimek
Copy link

andrejpodzimek commented Nov 5, 2023

The usual wisdom like “just install libsodium” does not work any more (on ArchLinux).

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...
Error: 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.

Tried all combinations of with/without…

package cardano-crypto-praos
  flags: -external-libsodium-vrf

…and with 3 libsodium variants, (1) just libsodium from ArchLinux (which has always been installed on my system), (2) libsodium-git from AUR and (3) the same libsodium-git package, just with input-output-hk/libsodium used instead of jedisct1/libsodium while building it. It just doesn’t work. (Of course I’ve tried rm -Rf ~/.{cabal,ghcup} and all sorts of “hard resets”.) The full PKGBUILD I’m using is here.

8.1.2 aside, I also tried 8.6.0-pre to see if there’s any difference. Nope. The same problem everywhere.

Originally posted by @andrejpodzimek in #5378 (comment)

@andrejpodzimek
Copy link
Author

andrejpodzimek commented Nov 5, 2023

Digging a bit further, I tried to build 8.1.1, but that fails the same way. Given that builds used to work in July, including 8.1.2, something must have changed in ArchLinux and/or the whole build system / ghc / cabal.

(I iried cabal 3.4.0.0 and 3.6.2.0, but that failed already in the configure stage (due to unordered-containers), so it’s probably hopelessly incompatible with 8.1.2. Only cabal 3.8.1.0 makes it past the initial configuration.)

Next I looked at the history of libsodium.pc from backups:

older libsodium.pcnewer libsodium.pcchanges
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libsodium
Version: 1.0.18
Description: A modern...

Libs: -L${libdir} -lsodium
Libs.private:  -pthread 
Cflags: -I${includedir}
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libsodium
Version: 1.0.19
Description: A modern...

Libs: -L${libdir} -lsodium
Libs.private: -lpthread -pthread 
Cflags: -I${includedir}






<<< diff (expected)



<<< diff (surprising)

As already mentioned, I tried three different variants of libsodium. All fail the same way. I tried to modify the libsodium.pc to remove the -lpthread , which had been the olnly difference, Version aside, but again, this has no effect on the build failure.

Last pkgconf update (to version 1.8.1) happened in March, so pkgconf is (also) not to blame.

That leaves me out of ideas. What and where determines that libsodium-any is unavailable? Why is some -any suffix (nowhere else to be found) even in the error message? Why did it build just fine back in July?

@arrowd
Copy link
Contributor

arrowd commented Nov 6, 2023

Can you try 3.10? I remember some pkg-config bug in ether 3.6 or 3.8

@andrejpodzimek
Copy link
Author

3.10.1.0 just works! 😮 I should have tried that instead of older versions! IIRC that version wasn’t mentioned in the build howtos. It works with regular libsodium from ArchLinux, no modifications.

This is the successful PKGBUILD.

@stefanobieler
Copy link

stefanobieler commented Dec 4, 2023

@andrejpodzimek I tried with cabal v 3.10.1.0 and wasn't able to get it to compile. sort of at a loss. commented in this issue as well #5561

Copy link

github-actions bot commented Jan 4, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

@github-actions github-actions bot added the Stale label Jan 4, 2024
@brunjlar
Copy link
Contributor

I am suddenly facing the same problem...

Build worked just fine until yesterday. Then I updated my Arch system this morning, and now it no longer works.
Weirdly, the update seems not to have touched libsodium or pkgconf or cabal.

@carbolymer
Copy link
Contributor

@brunjlar are you able to provide an error log with -v from cabal as well as pkg-config --list-all and pkg-config --version?

@crocodile-dentist
Copy link
Contributor

crocodile-dentist commented Mar 15, 2024

I think I'm running into the same problem as well, when I build with --verbose flag I get the following hint:

(...)
Running: /usr/bin/pkg-config --version
Running: /usr/bin/pkg-config --variable pc_path pkg-config
Running: /usr/bin/pkg-config --version
Running: /usr/bin/pkg-config --list-all
Failed to query pkg-config, Cabal will continue without solving for pkg-config
constraints: output of /usr/bin/pkg-config: hGetContents: invalid argument
(invalid byte sequence)
(...)

This is on arch, I've used cabal 3.10.2.1 and 3.10.1.0

Maybe it's related to this?

I've installed latest cabal
ghcup install cabal -u https://github.com/haskell/cabal/releases/download/cabal-head/cabal-head-Linux-x86_64.tar.gz head
and this fixed this issue.

@carbolymer
Copy link
Contributor

@crocodile-dentist smells like it. Can you post pkg-config --version and pkg-config --list-all?
See part "Possible issue with pkg-config:" in https://github.com/input-output-hk/cardano-node-wiki/wiki/install#system-dependencies-installation .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants