kadena-io / chainweb-node

Chainweb: A Proof-of-Work Parallel-Chain Architecture for Massive Throughput
https://docs.kadena.io/basics/whitepapers/overview
BSD 3-Clause "New" or "Revised" License
249 stars 95 forks source link

cabal install fails as of 2.19/2.19.1 #1669

Closed mbwmbw1337 closed 1 year ago

mbwmbw1337 commented 1 year ago

cabal update, cabal build run fine.

cabal install fails both on mac and ubuntu

Ubuntu

ghcup list

ghcup list
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file /root/.ghcup/cache/ghcup-0.0.7.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   Tool  Version  Tags                      Notes      
✗  ghc   7.10.3   base-4.8.2.0                         
✗  ghc   8.0.2    base-4.9.1.0                         
✗  ghc   8.2.2    base-4.10.1.0                        
✗  ghc   8.4.1    base-4.11.0.0                        
✗  ghc   8.4.2    base-4.11.1.0                        
✗  ghc   8.4.3    base-4.11.1.0                        
✗  ghc   8.4.4    base-4.11.1.0                        
✗  ghc   8.6.1    base-4.12.0.0                        
✗  ghc   8.6.2    base-4.12.0.0                        
✗  ghc   8.6.3    base-4.12.0.0                        
✗  ghc   8.6.4    base-4.12.0.0                        
✗  ghc   8.6.5    base-4.12.0.0                        
✗  ghc   8.8.1    base-4.13.0.0                        
✗  ghc   8.8.2    base-4.13.0.0                        
✗  ghc   8.8.3    base-4.13.0.0                        
✗  ghc   8.8.4    base-4.13.0.0                        
✗  ghc   8.10.1   base-4.14.0.0                        
✗  ghc   8.10.2   base-4.14.1.0                        
✗  ghc   8.10.3   base-4.14.1.0                        
✗  ghc   8.10.4   base-4.14.1.0                        
✓  ghc   8.10.5   base-4.14.2.0                        
✗  ghc   8.10.6   base-4.14.3.0                        
✔✔ ghc   8.10.7   base-4.14.3.0             hls-powered
✗  ghc   9.0.1    base-4.15.0.0                        
✗  ghc   9.0.2    base-4.15.1.0             hls-powered
✗  ghc   9.2.1    base-4.16.0.0                        
✗  ghc   9.2.2    base-4.16.1.0                        
✗  ghc   9.2.3    base-4.16.2.0                        
✗  ghc   9.2.4    base-4.16.3.0                        
✗  ghc   9.2.5    base-4.16.4.0                        
✗  ghc   9.2.6    base-4.16.4.0                        
✗  ghc   9.2.7    base-4.16.4.0             hls-powered
✓  ghc   9.2.8    recommended,base-4.16.4.0 hls-powered
✗  ghc   9.4.1    base-4.17.0.0                        
✗  ghc   9.4.2    base-4.17.0.0                        
✗  ghc   9.4.3    base-4.17.0.0                        
✗  ghc   9.4.4    base-4.17.0.0                        
✗  ghc   9.4.5    base-4.17.1.0             hls-powered
✗  ghc   9.6.1    base-4.18.0.0             hls-powered
✓  ghc   9.6.2    latest,base-4.18.0.0                 
✗  cabal 2.4.1.0                                       
✗  cabal 3.0.0.0                                       
✗  cabal 3.2.0.0                                       
✗  cabal 3.4.0.0                                       
✗  cabal 3.4.1.0                                       
✗  cabal 3.6.0.0                                       
✓  cabal 3.6.2.0  recommended                          
✓  cabal 3.8.1.0                                       
✔✔ cabal 3.10.1.0 latest                               
✗  hls   1.1.0                                         
✗  hls   1.2.0                                         
✗  hls   1.3.0                                         
✗  hls   1.4.0                                         
✗  hls   1.5.0                                         
✗  hls   1.5.1                                         
✗  hls   1.6.0.0                                       
✗  hls   1.6.1.0                                       
✗  hls   1.7.0.0                                       
✗  hls   1.8.0.0                                       
✗  hls   1.9.0.0                                       
✗  hls   1.9.1.0                                       
✓  hls   1.10.0.0 recommended                          
✔✔ hls   2.0.0.0  latest                               
✗  stack 2.5.1                                         
✗  stack 2.7.1                                         
✗  stack 2.7.3                                         
✗  stack 2.7.5                                         
✗  stack 2.9.1                                         
✓  stack 2.9.3    recommended                          
✔✔ stack 2.11.1   latest                               
✔✔ ghcup 0.1.19.2 latest,recommended                   

Cabal Install Log

cabal install
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/chainweb-2.19.1.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/chainweb-storage-0.1.0.0.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/ethereum-0.1.0.1.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/pact-4.7.1.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/rocksdb-haskell-kadena-1.1.0.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/rosetta-1.0.1.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/wai-middleware-validation-0.1.0.2.tar.gz
Wrote tarball sdist to
/home/chainweb-node/chainweb-node/dist-newstyle/sdist/ixset-typed-0.5.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - chainweb-2.19.1 (exe:chainweb-node, exe:cwtool) (requires build)
Starting     chainweb-2.19.1 (all, legacy fallback)

Failed to build chainweb-2.19.1. The failure occurred during the configure
step.
Build log (
/root/.cabal/logs/ghc-8.10.7/chainweb-2.19.1-5679fcd278f058354c5be80271b180a604558c62f00dc90d37a50ead58ea1785.log
):
[1 of 1] Compiling Main             ( /tmp/cabal-install.-3506575/dist-newstyle/tmp/src-3506575/chainweb-2.19.1/dist/setup/setup.hs, /tmp/cabal-install.-3506575/dist-newstyle/tmp/src-3506575/chainweb-2.19.1/dist/setup/Main.o )
Linking /tmp/cabal-install.-3506575/dist-newstyle/tmp/src-3506575/chainweb-2.19.1/dist/setup/setup ...
Configuring chainweb-2.19.1...
Error: setup: Encountered missing or private dependencies:
criterion,
data-ordlist >=0.4.7,
hashes >=0.2.2.0,
resource-pool >=0.4,
retry >=0.7,
sha-validation >=0.1,
statistics >=0.15,
tasty-json >=0.1

Error: cabal: Failed to build chainweb-2.19.1. See the build log above for
details.

Mac

ghcup list

ghcup list
   Tool  Version  Tags                      Notes      
✗  ghc   7.10.3   base-4.8.2.0              no-bindist 
✗  ghc   8.0.2    base-4.9.1.0              no-bindist 
✗  ghc   8.2.2    base-4.10.1.0             no-bindist 
✗  ghc   8.4.1    base-4.11.0.0             no-bindist 
✗  ghc   8.4.2    base-4.11.1.0             no-bindist 
✗  ghc   8.4.3    base-4.11.1.0             no-bindist 
✗  ghc   8.4.4    base-4.11.1.0             no-bindist 
✗  ghc   8.6.1    base-4.12.0.0             no-bindist 
✗  ghc   8.6.2    base-4.12.0.0             no-bindist 
✗  ghc   8.6.3    base-4.12.0.0             no-bindist 
✗  ghc   8.6.4    base-4.12.0.0             no-bindist 
✗  ghc   8.6.5    base-4.12.0.0             no-bindist 
✗  ghc   8.8.1    base-4.13.0.0             no-bindist 
✗  ghc   8.8.2    base-4.13.0.0             no-bindist 
✗  ghc   8.8.3    base-4.13.0.0             no-bindist 
✗  ghc   8.8.4    base-4.13.0.0             no-bindist 
✗  ghc   8.10.1   base-4.14.0.0             no-bindist 
✗  ghc   8.10.2   base-4.14.1.0             no-bindist 
✗  ghc   8.10.3   base-4.14.1.0             no-bindist 
✗  ghc   8.10.4   base-4.14.1.0             no-bindist 
✗  ghc   8.10.5   base-4.14.2.0                        
✗  ghc   8.10.6   base-4.14.3.0                        
✔✔ ghc   8.10.7   base-4.14.3.0             hls-powered
✗  ghc   9.0.1    base-4.15.0.0             no-bindist 
✓  ghc   9.0.2    base-4.15.1.0                        
✗  ghc   9.2.1    base-4.16.0.0                        
✗  ghc   9.2.2    base-4.16.1.0                        
✗  ghc   9.2.3    base-4.16.2.0                        
✗  ghc   9.2.4    base-4.16.3.0                        
✗  ghc   9.2.5    base-4.16.4.0                        
✗  ghc   9.2.6    base-4.16.4.0                        
✓  ghc   9.2.7    base-4.16.4.0             hls-powered
✓  ghc   9.2.8    recommended,base-4.16.4.0            
✗  ghc   9.4.1    base-4.17.0.0                        
✗  ghc   9.4.2    base-4.17.0.0                        
✗  ghc   9.4.3    base-4.17.0.0                        
✓  ghc   9.4.4    base-4.17.0.0                        
✓  ghc   9.4.5    base-4.17.1.0             hls-powered
✓  ghc   9.6.1    base-4.18.0.0             hls-powered
✓  ghc   9.6.2    latest,base-4.18.0.0                 
✗  cabal 2.4.1.0                            no-bindist 
✗  cabal 3.0.0.0                            no-bindist 
✗  cabal 3.2.0.0                            no-bindist 
✗  cabal 3.4.0.0                                       
✗  cabal 3.4.1.0                                       
✗  cabal 3.6.0.0                                       
✓  cabal 3.6.2.0  recommended                          
✓  cabal 3.8.1.0                                       
✔✔ cabal 3.10.1.0 latest                               
✗  hls   1.1.0                              no-bindist 
✗  hls   1.2.0                              no-bindist 
✗  hls   1.3.0                              no-bindist 
✗  hls   1.4.0                                         
✗  hls   1.5.0                                         
✗  hls   1.5.1                                         
✗  hls   1.6.0.0                                       
✗  hls   1.6.1.0                                       
✗  hls   1.7.0.0                                       
✗  hls   1.8.0.0                                       
✗  hls   1.9.0.0                                       
✓  hls   1.9.1.0                                       
✓  hls   1.10.0.0 recommended                          
✔✔ hls   2.0.0.0  latest                               
✗  stack 2.5.1                              no-bindist 
✗  stack 2.7.1                              no-bindist 
✗  stack 2.7.3                                         
✓  stack 2.7.5                                         
✓  stack 2.9.1                                         
✔✔ stack 2.9.3    recommended                          
✓  stack 2.11.1   latest                               

Cabal Install Log

cabal install
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/chainweb-2.19.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/chainweb-storage-0.1.0.0.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/ethereum-0.1.0.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/pact-4.7.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/rocksdb-haskell-kadena-1.1.0.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/rosetta-1.0.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/wai-middleware-validation-0.1.0.2.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/ixset-typed-0.5.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - chainweb-2.19.1 (exe:chainweb-node, exe:cwtool) (requires build)
Starting     chainweb-2.19.1 (all, legacy fallback)

Failed to build chainweb-2.19.1. The failure occurred during the configure
step.
Build log ( /Users/michael/.cabal/logs/ghc-8.10.7/chnwb-2.19.1-a578e35d.log ):
[1 of 1] Compiling Main             ( /var/folders/lz/7bhbk0t950l6_5r1f5pgj4nh0000gn/T/cabal-install.-73432/dist-newstyle/tmp/src-73432/chainweb-2.19.1/dist/setup/setup.hs, /var/folders/lz/7bhbk0t950l6_5r1f5pgj4nh0000gn/T/cabal-install.-73432/dist-newstyle/tmp/src-73432/chainweb-2.19.1/dist/setup/Main.o )
Linking /var/folders/lz/7bhbk0t950l6_5r1f5pgj4nh0000gn/T/cabal-install.-73432/dist-newstyle/tmp/src-73432/chainweb-2.19.1/dist/setup/setup ...
Configuring chainweb-2.19.1...
Error: setup: Encountered missing or private dependencies:
criterion,
data-ordlist >=0.4.7,
hashes >=0.2.2.0,
resource-pool >=0.4,
retry >=0.7,
sha-validation >=0.1,
statistics >=0.15,
tasty-json >=0.1

Error: cabal: Failed to build chainweb-2.19.1. See the build log above for
details.

michael@Michaels-MacBook-Pro chainweb-node % cabal new-build
Up to date
michael@Michaels-MacBook-Pro chainweb-node % cabal new-build
Up to date
michael@Michaels-MacBook-Pro chainweb-node % cabal new-install
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/chainweb-2.19.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/chainweb-storage-0.1.0.0.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/ethereum-0.1.0.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/pact-4.7.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/rocksdb-haskell-kadena-1.1.0.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/rosetta-1.0.1.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/wai-middleware-validation-0.1.0.2.tar.gz
Wrote tarball sdist to
/Users/michael/Source/chainweb-node/dist-newstyle/sdist/ixset-typed-0.5.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - chainweb-2.19.1 (exe:chainweb-node, exe:cwtool) (requires build)
Starting     chainweb-2.19.1 (all, legacy fallback)

Failed to build chainweb-2.19.1. The failure occurred during the configure
step.
Build log ( /Users/michael/.cabal/logs/ghc-8.10.7/chnwb-2.19.1-a578e35d.log ):
[1 of 1] Compiling Main             ( /var/folders/lz/7bhbk0t950l6_5r1f5pgj4nh0000gn/T/cabal-install.-73659/dist-newstyle/tmp/src-73659/chainweb-2.19.1/dist/setup/setup.hs, /var/folders/lz/7bhbk0t950l6_5r1f5pgj4nh0000gn/T/cabal-install.-73659/dist-newstyle/tmp/src-73659/chainweb-2.19.1/dist/setup/Main.o )
Linking /var/folders/lz/7bhbk0t950l6_5r1f5pgj4nh0000gn/T/cabal-install.-73659/dist-newstyle/tmp/src-73659/chainweb-2.19.1/dist/setup/setup ...
Configuring chainweb-2.19.1...
Error: setup: Encountered missing or private dependencies:
criterion,
data-ordlist >=0.4.7,
hashes >=0.2.2.0,
resource-pool >=0.4,
retry >=0.7,
sha-validation >=0.1,
statistics >=0.15,
tasty-json >=0.1

Error: cabal: Failed to build chainweb-2.19.1. See the build log above for
details.
chessai commented 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.

gbaz commented 1 year ago

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.

larskuhtz commented 1 year ago

Use of cabal install is currently not supported by chainweb-node.

mbwmbw1337 commented 1 year ago

The readme should be updated then, specifically the section 'Building from Source' to document that cabal or, more specifically cabal install is not supported...

mbwmbw1337 commented 1 year ago

As right now it incorrectly tells users to cabal install

Screenshot 2023-06-14 at 3 46 40 AM
chessai commented 1 year ago

As right now it incorrectly tells users to cabal install

Thanks for pointing that out @mbwmbw1337, I'll remove that.

mbwmbw1337 commented 1 year ago

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.

chessai commented 1 year ago

@mbwmbw1337 How does https://github.com/kadena-io/chainweb-node/pull/1683 look?