<p>Try to give the guild cntools build script a look</p>
<p><a href="https://github.com/cardano-community/guild-operators/blob/master/scripts/cnode-helper-scripts/cabal-build-all.sh" rel="nofollow noreferrer">https://github.com/cardano-community/guild-operators/blob/master/scripts/cnode-helper-scripts/cabal-build-all.sh</a></p>
<p>It probably contains all the information about
the initial setup (try ghcup), the cabal.project file, submodules ecc</p>

CC BY-SA 4.0
2021-06-08T14:28:53.210Z
2021-06-08T14:28:53.210Z
Markus - CLIO1
<p>I encountered a bug in cardano-node recently and since I know Haskell - I thought to myself, why not try and fix it?</p>
<p>I've done the following:</p>
<ol>
<li>Build from source per <a href="https://github.com/input-output-hk/cardano-node/blob/master/doc/getting-started/install.md/" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-node/blob/master/doc/getting-started/install.md/</a></li>
<li>Install ghcid through stack</li>
<li>However, when running <code>ghcid -c &quot;cabal repl exe:cardano-node --reorder-goals&quot;</code> as per documentation results in the following error:</li>
</ol>
<pre><code>$ ghcid -c &quot;cabal repl exe:cardano-node --reorder-goals&quot;
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
</code></pre>
<p><strong>Update</strong>: I guess for local development, I can probably work around this by setting</p>
<pre><code>package cardano-node
  ghc-options: -Wwarn
</code></pre>
<p>in cabal.project, but that seems undesirable. It's been over 8 years since I've last used Haskell &amp; Cabal, so I'm still figuring it all out again heh. But I guess something is slightly misconfigured?</p>
<p>Output when setting -Wwarn for cardano-node:</p>
<pre><code>[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)

</code></pre>
<p>If anyone knows which steps I'm missing, please let me know.</p>
<p>GHC 8.10.4
Cabal 3.4.0.0
ghcid v0.8.7
OS: Ubuntu 21.04 x86-64</p>
<p>Thanks in advance!</p>

CC BY-SA 4.0
2021-06-01T02:19:23.837Z
until somebody more knowledgeable in this matter chimes in; you could try running this in a nix-shell (NixOS)
Matthias Sieber
<development><cardano-node>
Getting started developing cardano-node
# Getting started developing cardano-node

(Asked by: username_0 on 2021-06-01)

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:

Build from source per https://github.com/input-output-hk/cardano-node/blob/master/doc/getting-started/install.md/
Install ghcid through stack
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!

**Tags:** development, cardano-node
> **Comments:**
> **username_1**: until somebody more knowledgeable in this matter chimes in; you could try running this in a nix-shell (NixOS)  

---

## 1 answers

### Answer by username_2 on 2021-06-08. Score: 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


---

