Cabal install cardano-cli cardano-node error!

Following the official website

$ cabal build all - success!
$ cabal install --installdir ~/.local/bin cardano-cli cardano-node:

Resolving dependencies…
cabal: Could not resolve dependencies:
[__0] unknown package: cardano-cli (user goal)
[__0] fail (backjumping, conflict set: cardano-cli)
After searching the rest of the dependency tree exhaustively, these were the
goals I’ve had most trouble fulfilling: cardano-cli

$ cp -p dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-node-1.25.1/x/cardano-node/build/cardano-node/cardano-node ~/.local/bin/:

cp: cannot stat ‘dist-newstyle/build/x86_64-linux/ghc-8.10.2/cardano-node-1.25.1/x/cardano-node/build/cardano-node/cardano-node’: No such file or directory

What am I missing?

i think cabal install --installdir is a little busted.

To find the execuatbles one they have been built:

find dist-newstyle -type f -name cardano-cli
find dist-newstyle -type f -name cardano-node

Ah yes I was in the wrong dir :man_facepalming: I moved into the correct dir that had the cardano-node folder from git.

@erikd I have cardano-node running on macos 11.2.3 ok. In cardano-node/cardano-cli I run cabal build all and got this error.

cabal: Failed to build cardano-cli-1.26.1-inplace-cardano-cli.
Failed to build cardano-cli-1.26.1 because it depends on cardano-cli-1.26.1
which itself failed to build.
Failed to build cardano-cli-1.26.1-inplace-cardano-cli-test.
Failed to build cardano-client-demo-
Failed to build cardano-client-demo-
Failed to build cardano-node-1.26.1-inplace-cardano-node.
Failed to build cardano-node-chairman-1.26.1-inplace-cardano-node-chairman.
Failed to build cardano-node-chairman-1.26.1 because it depends on
cardano-node-chairman-1.26.1 which itself failed to build.

Any thoughts how to solve this?

Coin Cashew guide is good:

You should not be in the cardano-node/cardano-cli directory but one level up.

You should be in the same directory as the cabal.project file.

Hm ok the error seems about the same. Might’ve missed something - Should I post the full output here?

You might have messed something up by running cabal in the wrong place. Try cabal clean and then go again.

Ok, I think cardano-cli is built! but the build was still not complete:

Installing   shelley-spec-ledger-test- (lib)
Completed    shelley-spec-ledger-test- (lib)
cabal: Failed to build exe:scan-blocks from cardano-client-demo-
Failed to build exe:scan-blocks-pipelined from cardano-client-demo-

Is this critical?

Probably. What git rev or tag are you building?

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

sorry for the delay.

How do I get this tag - is it in the cabal.project file?
I basically have the cardano-node folder up to date. I dont know if this affects the installation, but I did build cardano-node with nix.

It is not in the cabal.project file. You need to know the basics of git.

The git branch command will tell you which branch you are on. You are probably on the master branch, but you should probably not be building master.

Instead, you want to build the latest tag. You can get a list of the git tags using the command git tag --list --sort=v:refname. Currently the latest tag is 1.26.1 which you can check out to a branch using git checkout 1.26.1 --branch tag-1.26.1 . You can then build that.

Sorry I will learn to be better with git. So I ran

git checkout 1.26.1 -b tag-1.26.1
cabal clean
cabal build all

unfortunately I still get the error:

cabal: Failed to build test:cardano-api-test from cardano-api-1.26.1.
Failed to build exe:scan-blocks from cardano-client-demo-
Failed to build exe:scan-blocks-pipelined from cardano-client-demo-

That is the error message, but something went wrong before that. You need to figure out what that was.

ok so I solved it for macos 11.2.3. I followed Installing Cardano-node - Stake pool course from Install Libsodium onwards and changed 1.25.1 to 1.26.1.

Then I guess my paths to cardano-node and cardano-cli were elsewhere:

cp -p dist-newstyle/build/x86_64-osx/ghc-8.10.4/cardano-node-1.26.1/x/cardano-node/noopt/build/cardano-node/cardano-node ~/.local/bin

cp -p dist-newstyle/build/x86_64-osx/ghc-8.10.4/cardano-cli-1.26.1/x/cardano-cli/noopt/build/cardano-cli/cardano-cli ~/.local/bin

Unsure why its installed in ghc 8.10.4 folder when I did ghcup set 8.10.2.