Closed mbwmbw1337 closed 1 year ago
Hi @mbwmbw1337,
cabal install
in theory just builds the binary(ies) and copies the output to whatever directory you ask it to. In my experience it doesn't work consistently, and I never use it. In fact, I recommend against it. But you can do the exact same job with two simple commands:
cabal build
cp dist-newstyle/path/to/binary /where/i/want/the/binary
In fact, this is what I do. Either that or cabal run
. (Most of the time I use nix, but when I don't run nix and just cabal, I do this).
Let me know if this works for you.
The above is not quite correct. cabal install
will first sdist the package, and then attempt to install it as though it were from hackage -- i.e. disregarding entirely the cabal.project
file and anything else local external to that fixed sdist. The idea is cabal build
builds in a project, but cabal install
installs a package.
I still can't pindown precisely why this would cause the error given, but it does explain how "install" and "build" are different in general, and may differ in results.
In this particular case, my guess is the extremely custom setup that this package uses:
-- | This module contains a @Setup.hs@ script that hooks into the cabal build
-- process at the end of the configuration phase and generates a module with
-- package information for each component of the cabal package.
This would end up looking for packages that aren't needed as part of the build-targets (e.g. criterion, which is only needed for the test stanza) and then be disappointed when new-install has not made those available.
Use of cabal install
is currently not supported by chainweb-node.
The readme should be updated then, specifically the section 'Building from Source' to document that cabal
or, more specifically cabal install
is not supported...
As right now it incorrectly tells users to cabal install
As right now it incorrectly tells users to
cabal install
Thanks for pointing that out @mbwmbw1337, I'll remove that.
Thank you! Also, it might be worthwhile adding your information on how to link to the bin file or where it is for users not familiar with cabal.
@mbwmbw1337 How does https://github.com/kadena-io/chainweb-node/pull/1683 look?
cabal update, cabal build run fine.
cabal install fails both on mac and ubuntu
Ubuntu
ghcup list
Cabal Install Log
Mac
ghcup list
Cabal Install Log