Summary
When running cabal repl inside any week in the Plutus Pioneer Program, it fails with the error message:
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: lzma.h
* Missing (or bad) C library: lzma
- However, when running
which lzma
I get a path to/Applications/anaconda3/bin/lzma
- Also when trying to
brew install lzma
I am told thatlzma
is now included inxz
.
Overview/Description
When trying to build the cabal repl for the Plutus Pioneer Program on macOS Monterrey, cabal fails with an error message stating it can't find the lzma library.
I've tried using cabal new-build --extra-include-dirs="<path to lzma>"
(the path I got from running which lzma
on the terminal) and extra-include-dirs: /opt/homebrew/include extra-lib-dirs: /opt/homebrew/lib
to no avail.
Steps to Reproduce
Following the instructions on cardanoacademy, cardano stack exchange, and IOG's technical community discord to build the cabal repl for the Plutus Pioneer Program.
- Inside plutus-apps - git checkout 3746610e53654a1167aeb4c6294c6096d16b0502
- Run command
nix-shell
- Inside
nix-shell
-git checkout
(tag of the corresponding week on the cabal.project file, e.g. ee59880f47ab835dbd73bea0847dab7869fc20d8 for week01). - Run command
Cabal update
- Run command
Cabal repl
Test Results
Failed to build lzma-0.0.0.3. The failure occurred during the configure step.
Build log (
/Users/macadmin/.cabal/logs/ghc-8.10.2.20201118/lzm-0.0.0.3-09eda932.log ):
Configuring library for lzma-0.0.0.3..
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: lzma.h
* Missing (or bad) C library: lzma
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
cabal: Failed to build lzma-0.0.0.3 (which is required by
plutus-pioneer-program-week01-0.1.0.0). See the build log above for details.
Environment Setup and Configuration
OS: macOS Monterrey version 12.4 Model Name: MacBook Pro
Any help or guidance would be greatly appreciated.
which lzma
likely returned the path to the executable.extra-include-dirs
probably wants a path to source code eg source for lzma. Trylocate lzma.h
(or similar command for Mac) to see if it's on your system and use that path inextra-include-dirs
. If it isn't you should be able to locate and install the lzma source.--extra-lib-dirs
instead.locate lzma.h
and got a list of paths, I tried them all with--extra-include-dirs
and still the same issue, plus an added treat ofNot in scope: type constructor or class ‘GHC.GenTickish’
which I'm also looking into. I've triedbrew install liblzma-dev
and getlzma is now part of the xz formula
. Weird thing is, I can seelzma.h
all over the place, how does it not see it? I've even tried installing the Haskell package and nothing.