Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running cabal build all of the master branch #223

Closed
fajard01 opened this issue Feb 20, 2022 · 7 comments
Closed

Error when running cabal build all of the master branch #223

fajard01 opened this issue Feb 20, 2022 · 7 comments
Labels
bug 🐛 Something isn't working

Comments

@fajard01
Copy link

fajard01 commented Feb 20, 2022

I've cloned the repository, setup my IOHK caches, then ran nix-shell after which I do a cabal update which all goes fine. However when I run cabal build all, I get this error:

cabal: Failed to build prettyprinter-configurable-0.1.0.0 (which is required
by test:unit from plutus-merkle-tree-1.0.0, exe:tx-cost from hydra-node-0.3.0
and others). The failure occurred during the configure step. The exception
was:
dieVerbatim: user error (cabal:
'/nix/store/k55ry7wsp852fg4rmck8yly4sxhrrqw0-ghc-shell-for-packages-ghc-8.10.7-env/bin/ghc'
exited with an error:

/home/datapool/hydra-poc/dist-newstyle/tmp/src-1167189/prettyprinter-configurable-0.1.0.0/dist/setup/setup.hs:12:1:
error:
Could not find module `Distribution.Extra.Doctest'
There are files missing in the `cabal-doctest-1.0.8' package,
try running 'ghc-pkg check'.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
12 | import Distribution.Extra.Doctest (defaultMainWithDoctests)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)

Is there any fix? Everything in my system is up to date as well.

@abailly-iohk abailly-iohk added the bug 🐛 Something isn't working label Feb 21, 2022
@abailly-iohk
Copy link
Contributor

I have not been able to reproduce the issue even using a fresh new VM using https://github.com/abailly-iohk/nix-haskell-dev-vm

@abailly-iohk
Copy link
Contributor

The nix caches setup is a bit different from the default as we are using a private cachix cache. I will try rebuilding everything without this custom cache.

@abailly-iohk
Copy link
Contributor

Even letting aside the hydra-node specific cache, I was not able to reproduce the issue starting from a pristine VM and master clone:

$ cd hydra-poc
$ direnv allow
....
$ cabal update && cabal build all --enable-tests
...
Installing   prettyprinter-configurable-0.1.0.0 (all, legacy fallback)
Building     hspec-discover-2.8.3 (exe:hspec-discover)
Installing   hspec-discover-2.8.3 (exe:hspec-discover)
Completed    prettyprinter-configurable-0.1.0.0 (all, legacy fallback)

@abailly-iohk
Copy link
Contributor

@fajard01 I suspect something else in your system is messing up with the dependencies. Have you separately built the plutus or plutus-apps repo, for example? My understanding is that although nix works hard towards making build isolated and reproducible, it's not 100% possible with cabal because the latter seems to insist on using per user dependencies cache in the ~/.cabal directory.

abailly-iohk added a commit that referenced this issue Feb 21, 2022
Explicitly listing some local packages and not others means the latter
one won't have their dependencies managed by haskell.nix which
potentially leads to incompatibilities. Implicitly, all local packages
have their dependencies managed by nix which should make the build
more consistent.
@fajard01
Copy link
Author

I have built the plutus-apps repo without any issue and I haven't had a problem with the plutus-pioneer lectures whatsoever. Could it be that my plutus-apps branch interferes with the hydra branch? I shall play around with the cache and see if I can find a solution. I'm not on a VM but on a standalone Archlinux installation but i wouldn't think that matters.

@abailly-iohk
Copy link
Contributor

@fajard01 You are not doing anything wrong, it seems that our dependency management was inconsistent. Could you try building branch from PR #226?

ch1bo pushed a commit that referenced this issue Feb 21, 2022
Explicitly listing some local packages and not others means the latter
one won't have their dependencies managed by haskell.nix which
potentially leads to incompatibilities. Implicitly, all local packages
have their dependencies managed by nix which should make the build
more consistent.
@fajard01
Copy link
Author

Yes all working! Thanks for the crisp reply.
Marked as solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants