1

I'm trying to run the command "cabal build" the Week02 code of plutus-pioneer-program but it has this error and I have tried everything but the same error keeps appear:

Failed to build lzma-0.0.0.3.
Build log (
/root/.cabal/logs/ghc-8.10.4.20210212/lzma-0.0.0.3-0c9bb4b908cda90da75c6385d28bd3027ce216c08ab1b83c43f13ae414b04d3b.log
):
Configuring library for lzma-0.0.0.3..
Preprocessing library for lzma-0.0.0.3..
compiling dist/build/LibLzma_hsc_make.c failed (exit code 1)
rsp file was: "dist/build/hsc2hscall1082370-0.rsp"
command was: /nix/store/d2fqghv083a8q7j8sjb2m5q6i840h691-gcc-wrapper-10.2.0/bin/cc -c dist/build/LibLzma_hsc_make.c -o dist/build/LibLzma_hsc_make.o -D__GLASGOW_HASKELL__=810 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Idist/build/autogen -Idist/build/global-autogen -include dist/build/autogen/cabal_macros.h -I/nix/store/3av3p9ky0lg2f1bc5jgg2sl872z7g4m9-ghc-8.10.4.20210212/lib/ghc-8.10.4.20210212/bytestring-0.10.12.0/include -I/nix/store/3av3p9ky0lg2f1bc5jgg2sl872z7g4m9-ghc-8.10.4.20210212/lib/ghc-8.10.4.20210212/base-4.14.1.0/include -I/nix/store/grcf3skqwdw35pki3d0gf7mj0flskni7-gmp-6.2.1-dev/include -I/nix/store/3av3p9ky0lg2f1bc5jgg2sl872z7g4m9-ghc-8.10.4.20210212/lib/ghc-8.10.4.20210212/integer-gmp-1.0.3.0/include -I/nix/store/3av3p9ky0lg2f1bc5jgg2sl872z7g4m9-ghc-8.10.4.20210212/lib/ghc-8.10.4.20210212/include -I/nix/store/wxb1awkkkbjp26jwqf854488qbzlkk25-libffi-3.3-dev/include -I/nix/store/3av3p9ky0lg2f1bc5jgg2sl872z7g4m9-ghc-8.10.4.20210212/lib/ghc-8.10.4.20210212/include/
error: LibLzma.hsc:44:10: fatal error: lzma.h: No such file or directory
compilation terminated.

cabal: Failed to build lzma-0.0.0.3 (which is required by
plutus-pioneer-program-week02-0.1.0.0). See the build log above for details.

Here are the steps I do:

  1. cd into plutus-apps directory then
$ git checkout 81ba78edb1d634a13371397d8c8b19829345ce0d
$ nix-shell
  1. Now I'm inside the nix-shell, I cd into plutus-pioneer-program's Week2 code and then run
[nix-shell:.../plutus-pioneer-program/code/week02]# cabal update
[nix-shell:.../plutus-pioneer-program/code/week02]# cabal build

That's all, the error above appears. After investigating, I think the error is caused by missing lzma.h, I installed liblzma-dev from this thread, but the error remains.

Can anyone help me out please? Thank you very much!

1
  • I am also facing the same issue. Have you found any solution?
    – Abhijit
    Nov 16, 2022 at 8:10

2 Answers 2

0

After the command

nix-shell

execute in the shell

nix-shell -p lzma
0

I believe you are using the wrong git commit for plutus-apps for week02. It should be 6aff97d596ac9d59460aab5c65627b1c8c0a1528 according to https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week02/cabal.project#L63

In other words, you should cd into the plutus-apps directory and then:

$ git checkout 6aff97d596ac9d59460aab5c65627b1c8c0a1528
$ nix-shell

And then proceed with the rest of the process the same way you were doing before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.