7

I encountered a bug in cardano-node recently and since I know Haskell - I thought to myself, why not try and fix it?

I've done the following:

  1. Build from source per https://github.com/input-output-hk/cardano-node/blob/master/doc/getting-started/install.md/
  2. Install ghcid through stack
  3. However, when running ghcid -c "cabal repl exe:cardano-node --reorder-goals" as per documentation results in the following error:
$ ghcid -c "cabal repl exe:cardano-node --reorder-goals"
Loading cabal repl exe:cardano-node --reorder-goals ...
Warning: Requested index-state 2021-04-30T00:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state (2021-04-29T23:07:55Z).
Resolving dependencies...
Build profile: -w ghc-8.10.4 -O1
In order, the following will be built (use -v for more details):
 - cardano-node-1.27.0 (exe:cardano-node) (ephemeral targets)
Preprocessing executable 'cardano-node' for cardano-node-1.27.0..
GHCi, version 8.10.4: https://www.haskell.org/ghc/  :? for help
*** Exception: The following packages were specified via -package or -package-id flags,
but were not needed for compilation:
  - text-1.2.4.1
  - optparse-applicative-0.16.1.0
  - cardano-prelude-0.1.0.0
  - cardano-node-1.27.0
  - cardano-config-0.1.0.0


No files loaded, GHCi is not working properly.
Command: cabal repl exe:cardano-node --reorder-goals

Update: I guess for local development, I can probably work around this by setting

package cardano-node
  ghc-options: -Wwarn

in cabal.project, but that seems undesirable. It's been over 8 years since I've last used Haskell & Cabal, so I'm still figuring it all out again heh. But I guess something is slightly misconfigured?

Output when setting -Wwarn for cardano-node:

[1 of 2] Compiling Paths_cardano_node ( /home/weebl/git/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.10.4/cardano-node-1.27.0/x/cardano-node/build/cardano-node/autogen/Paths_cardano_node.hs, interpreted )
[2 of 2] Compiling Main             ( app/cardano-node.hs, interpreted )
Ok, two modules loaded.

All good (2 modules, at 04:45:39)

If anyone knows which steps I'm missing, please let me know.

GHC 8.10.4 Cabal 3.4.0.0 ghcid v0.8.7 OS: Ubuntu 21.04 x86-64

Thanks in advance!

1
  • 2
    until somebody more knowledgeable in this matter chimes in; you could try running this in a nix-shell (NixOS)
    – Matthias Sieber
    Jun 1 at 2:19
2

Try to give the guild cntools build script a look

https://github.com/cardano-community/guild-operators/blob/master/scripts/cnode-helper-scripts/cabal-build-all.sh

It probably contains all the information about the initial setup (try ghcup), the cabal.project file, submodules ecc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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