Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Conflict between running cabal manually and using hie #1791

Open
newhoggy opened this issue Jul 9, 2020 · 1 comment
Open

Conflict between running cabal manually and using hie #1791

newhoggy opened this issue Jul 9, 2020 · 1 comment

Comments

@newhoggy
Copy link

newhoggy commented Jul 9, 2020

I'm getting intermittent build failures like this:

ld: library not found for -lHSshelley-spec-ledger-0.1.0.0-inplace-ghc8.6.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)

And this:

ld: can't open file, errno=2 file '/Users/jky/wrk/iohk/cardano-node/dist-newstyle/build/x86_64-osx/ghc-8.6.5/cardano-prelude-0.1.0.0/build/libHScardano-prelude-0.1.0.0-inplace-ghc8.6.5.dylib'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)

And this:

ghc: can't find a package database at /Users/jky/wrk/iohk/cardano-node/dist-newstyle/build/x86_64-osx/ghc-8.6.5/cardano-crypto-praos-2.0.0/package.conf.inplace
cabal: Failed to build cardano-crypto-praos-2.0.0 (which is required by
test:cardano-node-test from cardano-node-1.15.0, test:cardano-cli-test from
cardano-cli-1.15.0 and others).

This occurs when I attempt to use cabal and haskell-ide-engine at the same time.

About 50% of attempts fail. Each time it fails, I get a different error. On a different "in-place" package.

Moreover incremental builds don't work so well as it appears that incremental build artefacts get destroyed and need to get reconfigured and built.

This is my version of cabal:

cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library

This is my version of hie:

$ ~/.cabal/bin/backup/hie-8.6.5 --version
Version 1.4 x86_64 ghc-8.6.5

hie is build from this commit: a9005b2ba2050bdfdd4438f1d471a3f7985492cd

Work around

Supply an additional --build-dir flag so that my own builds go to a different dist directory so as to not interfere the cabal processes that hie launches that use the default directory dist-newstyle.

@newhoggy newhoggy changed the title Conflict between running cabal manually and hie Conflict between running cabal manually and using hie Jul 9, 2020
@newhoggy
Copy link
Author

newhoggy commented Jul 9, 2020

Switching to haskell-language-server is also a viable work-around. In this case, make sure you generate hie.yaml files if you have any issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant