Cabal seems to not build

Hi,

the cabal build all seems to be failing upon a version check for ghc:

~/cardano-node# cabal build all
Warning: cannot determine version of /usr/local/bin/ghc :
“”
cabal: The program ‘ghc’ version >=7.0.1 is required but the version of
/usr/local/bin/ghc could not be determined.

I have ghc 8.6.5, i did get the git tag cardano node 1.19.0, there seems to be a discrepancy in the docs between 1.18.0 & 1.19.0.

Help appreciated, thanks

you can check current version of ghc:

/usr/local/bin/ghc -v

just in case, check if this is the one system is using:

type ghc

try update cabal and reinstall ghc:

wget https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz

tar -xf cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz
rm cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz cabal.sig
mkdir -p ~/.local/bin
mv cabal ~/.local/bin/

echo “export PATH=~/.local/bin:$PATH” >> ~/.bashrc
source ~/.bashrc
echo $PATH

cabal update
cabal --version

wget https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-deb9-linux.tar.xz
tar -xf ghc-8.6.5-x86_64-deb9-linux.tar.xz
rm ghc-8.6.5-x86_64-deb9-linux.tar.xz
cd ghc-8.6.5
./configure
sudo make install
cd …

1 Like

Hi Lauris,

thanks for that, but still issues, getting the following install error:

Installing library in /usr/local/lib/ghc-8.6.5/ghc-8.6.5
“/usr/local/lib/ghc-8.6.5/bin/ghc-pkg” --force --global-package-db “/usr/local/lib/ghc-8.6.5/package.conf.d” update rts/dist/package.conf.install
/usr/local/lib/ghc-8.6.5/bin/ghc-pkg: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make[1]: *** [ghc.mk:991: install_packages] Error 127
make: *** [Makefile:51: install] Error 2

Thanks

Getting this:

~/cardano-node# cabal build all
HEAD is now at 7d795c3 Merge pull request #144 from input-output-hk/dcoutts/hashing-api
HEAD is now at 2547ad1 Merge pull request #65 from dcoutts/dcoutts/drop-vrf-p256-openssl
HEAD is now at 183a70c0 Merge pull request #1712 from input-output-hk/jc/app-perf-use-active-stake
HEAD is now at 316c854 Merge #113
HEAD is now at 43a036c Replace Universum with Cardano.Prelude
HEAD is now at 26d35ad Add SeedGoblin instance for Maybe a
HEAD is now at efa4b5e Merge #568
HEAD is now at ec74d1c46 Merge #2466
HEAD is now at 42a8319 Merge pull request #223 from Jimbo4350/jordan/update-pprint
Warning: Requested index-state2020-07-15T00:00:00Z is newer than
hackage.haskell.org’! Falling back to older state (2020-07-14T22:50:55Z).
Resolving dependencies…
cabal: Could not resolve dependencies:
[__0] trying: Win32-network-0.1.0.0 (user goal)
[__1] next goal: base (dependency of Win32-network)
[__1] rejecting: base-4.14.1.0/installed-4.14.1.0 (conflict: Win32-network =>
base>=4.5 && <4.13)
[__1] skipping: base-4.14.0.0, base-4.13.0.0 (has the same characteristics
that caused the previous version to fail: excluded by constraint ‘>=4.5 &&
<4.13’ from ‘Win32-network’)
[__1] rejecting: 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: Win32-network, base)
After searching the rest of the dependency tree exhaustively, these were the
goals I’ve had most trouble fulfilling: base, Win32-network

Used GHC 8.10.2 and cardano node branch 1.19.0

Which Linux you have? Do you use vps or own server?

I had similar problems in a ubuntu vm. It turned out to be due to how I had installed dependencies at the very beginning.

Also, have you modified and sourced your .bashrc?

as a layman I’m wondering wot this all means.
whatever it is, it’s good to see some HEADy shit going on behind the scenes
[if] u no h2om sayin
thanks devs!! you guys are total sweeties!!! community got yer back w this cabal nonsense. no obstacles!
-on

1 Like

Ubuntu 20.04 (64 Bit), using hosted VPS .

Thanks

Yes followed all the steps according to the stake pool handbook.

Thanks

So had I. If I remember correctly, at first I had attempted to use commands the ubuntu vm wasn’t happy with.

So went back to the school, grabbed the right commands (apt, as opposed to yum). But they had not executed correctly, because they needed multiple confirms.

I had attached a text file with the solution that finally worked on an old post.

I will link it to you, hoping it helps.

Cheers A

Thanks, but could you just paste the text from the pdf in here? Would prefer not to download it.

Thanks alot

Yes, of course, sorry about that. I have modified the below for the current (1.19.0) version of the node, I did this on the fly on mobile, so please check the relevant lines have been modified correctly.

Please also note that I pasted straight from text editor to here, so the commented out sections might look a bit funny and the links will probably auto-populate. Do not click the links if this makes you uncomfortable.

Hope it helps,

A

For use in Ubuntu/Debian builds

See https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/getting-started/install-node

for differences with other setups (eg AWS)

##################################################################
##################################################################

Install necessary dependencies

NOTE to self: run these 4 lines SEPARATELY

sudo apt-get update -y


sudo apt-get install build-essential pkg-config libffi-dev libgmp-dev -y


sudo apt-get install libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev -y


sudo apt-get install make g++ tmux git jq wget libncursesw5 libtool autoconf -y

install cabal

wget https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz

tar -xf cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz

rm cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz cabal.sig

mkdir -p ~/.local/bin

mv cabal ~/.local/bin/

verify PATH: .local/bin is NOT in path => modify .bashrc

echo $PATH

nano .bashrc

insert at bottom of file, save (^O) and exit (^X)

export PATH="~/.local/bin:$PATH"

either reboot or source .bashrc (for changes to take effect)

source .bashrc	

update and verify cabal version

cabal update

cabal --version

returns cabal-install version 3.2.0.0

so far so good

download and install GHC

wget https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-deb9-linux.tar.xz

tar -xf ghc-8.6.5-x86_64-deb9-linux.tar.xz

rm ghc-8.6.5-x86_64-deb9-linux.tar.xz

cd ghc-8.6.5

./configure

sudo make install

cd ..

returns done at the end of sudo make install

so far so good

install libsodium and export to PATH

git clone https://github.com/input-output-hk/libsodium

cd libsodium

git checkout 66f017f1

./autogen.sh

./configure

make

sudo make install

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

no news is good news, so far so good

go back home and source cardano-node

cd

git clone https://github.com/input-output-hk/cardano-node.git

ls cardano-node #checked, all good

get tags and select which version to build

cd cardano-node

git fetch --all --tags

git tag

git checkout tags/1.19.0 

enters detached HEAD state, all good

build the node

cabal build all

export executables to path and go home

cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-1.19.0/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/


cp -p dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-cli-1.19.0/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/


cd

check correctness of versions

cardano-cli --version

cardano-node --version

#####################################################################

for further information check:

https://cardano-foundation.gitbook.io/stake-pool-course/

#####################################################################

1 Like

Thanks but still failed, i did take ghc 8.10.2 as opposed to 8.6.5, but that should not be the issue…

~/cardano-node# cabal build all
Cloning into ‘/root/cardano-node/dist-newstyle/src/cardano-b_-ef6f6555066e7b95’…
remote: Enumerating objects: 62, done.
remote: Counting objects: 100% (62/62), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 3160 (delta 9), reused 21 (delta 2), pack-reused 3098
Receiving objects: 100% (3160/3160), 1.67 MiB | 3.25 MiB/s, done.
Resolving deltas: 100% (1755/1755), done.
HEAD is now at df86874 Merge pull request #134 from input-output-hk/nc/nix-shell
Cloning into ‘/root/cardano-node/dist-newstyle/src/cardano-c_-ff3e781b30c95867’…
remote: Enumerating objects: 1457, done.
remote: Total 1457 (delta 0), reused 0 (delta 0), pack-reused 1457
Receiving objects: 100% (1457/1457), 455.37 KiB | 1.58 MiB/s, done.
Resolving deltas: 100% (621/621), done.
HEAD is now at 2547ad1 Merge pull request #65 from dcoutts/dcoutts/drop-vrf-p256-openssl
Cloning into ‘/root/cardano-node/dist-newstyle/src/cardano-l_-be5e6979fa855cac’…
remote: Enumerating objects: 192, done.
remote: Counting objects: 100% (192/192), done.
remote: Compressing objects: 100% (123/123), done.
remote: Total 47544 (delta 64), reused 126 (delta 29), pack-reused 47352
Receiving objects: 100% (47544/47544), 28.24 MiB | 4.51 MiB/s, done.
Resolving deltas: 100% (28362/28362), done.
HEAD is now at 460ee17d Merge pull request #1794 from input-output-hk/dcoutts/allow-script-addrs
Cloning into ‘/root/cardano-node/dist-newstyle/src/cardano-p_-29c69bdfb71ad002’…
remote: Enumerating objects: 1373, done.
remote: Total 1373 (delta 0), reused 0 (delta 0), pack-reused 1373
Receiving objects: 100% (1373/1373), 323.58 KiB | 1.07 MiB/s, done.
Resolving deltas: 100% (628/628), done.
HEAD is now at 71ea865 Merge #114
Cloning into ‘/root/cardano-node/dist-newstyle/src/goblins-8f13f67cff0daf8c’…
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 442 (delta 6), reused 16 (delta 6), pack-reused 423
Receiving objects: 100% (442/442), 129.36 KiB | 783.00 KiB/s, done.
Resolving deltas: 100% (176/176), done.
HEAD is now at 312198a Merge pull request #2 from mrBliss/mrBliss/microlens
Cloning into ‘/root/cardano-node/dist-newstyle/src/iohk-moni_-9bf5314d46ca988d’…
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 9306 (delta 19), reused 24 (delta 2), pack-reused 9245
Receiving objects: 100% (9306/9306), 34.87 MiB | 8.13 MiB/s, done.
Resolving deltas: 100% (5276/5276), done.
HEAD is now at 8190b00 fixing compilation on Windows (#576)
Cloning into ‘/root/cardano-node/dist-newstyle/src/ouroboros_-e7dffa0d85e2839’…
remote: Enumerating objects: 2611, done.
remote: Counting objects: 100% (2611/2611), done.
remote: Compressing objects: 100% (1615/1615), done.
remote: Total 98128 (delta 1843), reused 1328 (delta 844), pack-reused 95517
Receiving objects: 100% (98128/98128), 97.72 MiB | 10.61 MiB/s, done.
Resolving deltas: 100% (67088/67088), done.
HEAD is now at aecfe77de Merge #2521
Warning: Requested index-state2020-07-15T00:00:00Z is newer than
hackage.haskell.org’! Falling back to older state (2020-07-14T22:50:55Z).
Resolving dependencies…
cabal: Could not resolve dependencies:
[__0] trying: Win32-network-0.1.0.0 (user goal)
[__1] next goal: base (dependency of Win32-network)
[__1] rejecting: base-4.14.1.0/installed-4.14.1.0 (conflict: Win32-network =>
base>=4.5 && <4.13)
[__1] skipping: base-4.14.0.0, base-4.13.0.0 (has the same characteristics
that caused the previous version to fail: excluded by constraint ‘>=4.5 &&
<4.13’ from ‘Win32-network’)
[__1] rejecting: 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: Win32-network, base)
After searching the rest of the dependency tree exhaustively, these were the
goals I’ve had most trouble fulfilling: base, Win32-network

Try cabal clean
cabal update
cabal build all

Warning: Requested index-state2020-07-15T00:00:00Z is newer than
hackage.haskell.org’! Falling back to older state (2020-07-14T22:50:55Z).
Resolving dependencies…
cabal: Could not resolve dependencies:

The above is quoted from your previous post. Have you checked the ambassador’s suggestion (apologies for not remembering their name, I’m currently on email only)? If that worked, please ignore the rest of this answer.

I cannot remember the specifics, but you may be able to find them in my old post. I can say however that we had boiled it down to a dependencies issue (because of the above message you also get).

At the time I was in a ubuntu vm hosted on Windows through vb. I scrapped the whole vm and started over. Have you tried this?

Cheers A

No luck but thanks

Got it built, seems to not like root user

This guide is pretty good

https://cardano-community.github.io/guild-operators/#/basics

Thanks, will check it out