IntersectMBO / cardano-db-sync

A component that follows the Cardano chain and stores blocks and transactions in PostgreSQL
Apache License 2.0
293 stars 161 forks source link

Cabal build fails #1366

Closed reitcircles closed 1 year ago

reitcircles commented 1 year ago

OS Your OS:4.15.0-163-generic #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Versions The db-sync version (eg cardano-db-sync --version): This is what we are trying to compile PostgreSQL version:

Build/Install Method The method you use to build or install cardano-db-sync: cabal build

Run method The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none):

Additional context Add any other context about the problem here.

Problem Report Please do not include screenshots or images, but instead cut and paste any relevant log messages or errors.

projects/cardano-db-sync$ cabal build all
Warning: Requested index-state 2022-11-11T00:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state (2022-11-10T22:18:27Z).
Warning: Requested index-state 2022-11-12T20:00:00Z is newer than
'cardano-haskell-packages'! Falling back to older state
(2022-11-11T00:24:50Z).
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cardano-api-1.36.0 (user goal)
[__1] next goal: base (dependency of cardano-api)
[__1] rejecting: base-4.16.4.0/installed-4.16.4.0 (conflict: cardano-api =>
base>=4.14 && <4.15)
[__1] skipping: base-4.17.0.0, base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
base-4.16.1.0, base-4.16.0.0, base-4.15.1.0, base-4.15.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=4.14 && <4.15' from 'cardano-api')
[__1] rejecting: base-4.14.3.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0,
base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0, base-4.10.1.0,
base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0,
base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1,
base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0,
base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0,
base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, cardano-api)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, cardano-api
kderme commented 1 year ago

Versions The db-sync version (eg cardano-db-sync --version): This is what we are trying to compile PostgreSQL version:

This was left empty

erikd commented 1 year ago

[__1] rejecting: base-4.16.4.0/installed-4.16.4.0 (conflict: cardano-api => base>=4.14 && <4.15)

This is almost always a result of using an incompatible version of ghc. Db-sync currently expects ghc-8.10.*.

reitcircles commented 1 year ago
ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7

git describe --tags
13.1.0.0

So that is not the problem. But the error is still the same.

HEAD is now at 4ec92de Run https only
HEAD is now at 8762a10ef Merge pull request #4851 from input-output-hk/sl/chap-updates
HEAD is now at 066f700 Merge #627
HEAD is now at 8c48771 Merge pull request #1 from input-output-hk/erikd/remove-cabal-dupe
HEAD is now at 00ebe72 Added support for aeson-2.0, text-2.0, and GHC 9.2
Warning: Requested index-state 2022-09-27T18:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state (2022-09-27T17:32:39Z).
Warning: Requested index-state 2023-01-26T18:00:00Z is newer than
'cardano-haskell-packages'! Falling back to older state
(2023-01-26T17:52:04Z).
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cardano-api-1.35.5 (user goal)
[__1] trying: base-4.14.3.0/installed-4.14.3.0 (dependency of cardano-api)
[__2] trying: lobemo-scribe-systemd-0.1.0.0 (user goal)
[__3] next goal: libsystemd-journal (dependency of lobemo-scribe-systemd)
[__3] rejecting: libsystemd-journal-1.4.5 (conflict: pkg-config package
libsystemd>=209, not found in the pkg-config database)
[__3] rejecting: libsystemd-journal-1.4.4 (conflict:
base==4.14.3.0/installed-4.14.3.0, libsystemd-journal => base>=4.6 && <4.13)
[__3] skipping: libsystemd-journal-1.4.3, libsystemd-journal-1.4.2,
libsystemd-journal-1.4.1, libsystemd-journal-1.4.0, libsystemd-journal-1.3.4,
libsystemd-journal-1.3.3, libsystemd-journal-1.3.1, libsystemd-journal-1.3.0,
libsystemd-journal-1.2.0, libsystemd-journal-1.1.0, libsystemd-journal-1.0.0
(has the same characteristics that caused the previous version to fail:
excludes 'base' version 4.14.3.0)
[__3] fail (backjumping, conflict set: base, libsystemd-journal,
lobemo-scribe-systemd)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, cardano-api, libsystemd-journal,
lobemo-scribe-systemd
Try running with --minimize-conflict-set to improve the error message.
kderme commented 1 year ago

Versions The db-sync version (eg cardano-db-sync --version): This is what we are trying to compile PostgreSQL version: This was left empty

You should mention what version (git hash or tag) you're trying to build

reitcircles commented 1 year ago

Versions The db-sync version (eg cardano-db-sync --version): This is what we are trying to compile PostgreSQL version: This was left empty

You should mention what version (git hash or tag) you're trying to build

updated reply above.

git describe --tags
13.1.0.0
kderme commented 1 year ago

rejecting: libsystemd-journal-1.4.5 (conflict: pkg-config package libsystemd>=209, not found in the pkg-config database)

Possibly this is the issue. Some mising library in your system. This seems related https://cardano.stackexchange.com/questions/4258/how-to-solve-cabal-could-not-resolve-dependencies-when-building-cardano-cli-c

reitcircles commented 1 year ago

rejecting: libsystemd-journal-1.4.5 (conflict: pkg-config package libsystemd>=209, not found in the pkg-config database)

Possibly this is the issue. Some mising library in your system. This seems related https://cardano.stackexchange.com/questions/4258/how-to-solve-cabal-could-not-resolve-dependencies-when-building-cardano-cli-c

no success ...it really is frustrating ...

erikd commented 1 year ago

@reitcircles What does the command dpkg -l | grep libsystemd say?

On my (Debian) system it results in:

> dpkg -l | grep libsystemd
ii  libsystemd-dev:amd64                     252.5-2                         amd64        systemd utility library - development files
ii  libsystemd-shared:amd64                  252.5-2                         amd64        systemd shared private library
ii  libsystemd0:amd64                        252.5-2                         amd64        systemd utility library
reitcircles commented 1 year ago

Finally built both using nix & cabal succeeds.

Additional packages:

sudo apt install  zlib1g-dev
sudo apt install libicu-dev

cabal configure --with-compiler=ghc-8.10.4 <or whatever version you have>
cabal build cardano-db-sync

It always looks for dev version of the libs.

erikd commented 1 year ago

If this can be closed, please do so.