Cabal install, executables missing

I ran cabal build all successfully, did not see anything error like.

I run cabal install all --bindir ~/.local/bin and at first it seems to work, but then I get a problem:

(seems to work, can see my cardano-node and cardano-cli tar.gz’s…)

But then starts to fail:
(screenshot below)

Falling back to older state (2020-11-14T23:50:07Z).
cabal: Cannot build the executables in the package byron-spec-chain because it
does not contain any executables. Check the .cabal file for the package and
make sure that it properly declares the components that you expect.
Cannot build the executables in the package byron-spec-ledger because it does
not contain any executables. Check the .cabal file for the package and make
sure that it properly declares the components that you expect.


Any ideas?

I also tried these recommended commands:

cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-node-<TAGGED VERSION>/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/

cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-cli-<TAGGED VERSION>/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/

But the .../cardano-node-1.24.2/x/.... path does not exist. Any ideas why? Here is what I have:


As you can see, my directories only extend out to:
dist-newstyle/build/x86_64-linux/ghc-8.10.2/.
and all the tar.gz’s mentioned earlier (“Wrote tarball sdist to…”) are not there either.

My PATH variable:

echo $PATH
/home/thinkocapo/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thinkocapo/.local
/bin

UPDATE
I ran

cabal clean
cabal update
cabal install cardano-node cardano-cli

and it eventually hung

so then ran cabal build all

and how i’m finally seeing cardano-node cardano-cliinside of my dist-newstyle/build/x86_64-linux/ghc-8.10.2/*` so that’s good. It’s still building…

I’ll have to re-try all this again as this was a little rocky. My current guess is that this should work, I saw it in a few other issues on the forum:

cabal clean
cabal update
cabal build all

UPDATE - FIXED

Can now do
cardan-node --update
cardano-cli --update

because they’re in ~/.local/bin

I really think running
cabal clean
cabal update
made all the difference. May try and open a PR on the docs or the Stake Pool School

Is a ~/.cabal/config file needed? That’s what cabal update gets you:
https://cabal.readthedocs.io/en/3.4/installing-packages.html#configuration

Thanks to all who suggested this!

Hello @devcap ,

it looks like the cardano staking pool documentation is outdated. The cabal install --bindir ~/.local/bin was replaced by --install-method=copy and --installdir=$WORKDIR (with $WORKDIR=~/.local/bin).
A further issue of the documentation is that a build and a install is not necssary as an installation does configure, build and install…

The cabal-install package provides a command line tool named cabal . It uses the Cabal library and provides a user interface to the Cabal/Hackage build automation and package management system. It can build and install both local and remote packages, including dependencies.
Source from hackage.haskell.org

Replace the following:

cabal configure --with-compiler=ghc-8.10.2
echo “package cardano-crypto-praos” >> cabal.project.local
echo " flags: -external-libsodium-vrf" >> cabal.project.local
cabal build all
cabal install all --bindir ~/.local/bin
cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-node-/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/
cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-cli-/x/cardano-cli/build/cardano-cli/cardano-cli ~/.local/bin/
cardano-cli --version
Source from docs.cardano.org

with:

cabal update \
&& echo “package cardano-crypto-praos” >> cabal.project.local \
&& echo " flags: -external-libsodium-vrf" >> cabal.project.local \
&& cabal install cardano-node cardano-cli --enable-optimization=2 \
–install-method=copy \
–installdir= ~/.local/bin \
&& cardano-cli --version \
&& cardano-node --version;

and it will install without any issues. :v:

1 Like