<p>After the command</p>
<pre><code>nix-shell
</code></pre>
<p>execute in the shell</p>
<pre><code>nix-shell -p lzma
</code></pre>

CC BY-SA 4.0
2022-11-16T13:39:42.690Z
2022-11-16T13:39:42.690Z
Fermat
<p>I believe you are using the wrong git commit for plutus-apps for week02. It should be <code>6aff97d596ac9d59460aab5c65627b1c8c0a1528</code> according to  <a href="https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week02/cabal.project#L63" rel="nofollow noreferrer">https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week02/cabal.project#L63</a></p>
<p>In other words, you should cd into the <code>plutus-apps</code> directory and then:</p>
<pre><code>$ git checkout 6aff97d596ac9d59460aab5c65627b1c8c0a1528
$ nix-shell
</code></pre>
<p>And then proceed with the rest of the process the same way you were doing before.</p>

CC BY-SA 4.0
2022-12-16T14:45:35.367Z
2022-12-16T14:45:35.367Z
caike
<p>I'm trying to run the command &quot;cabal build&quot; the Week02 code of <a href="https://github.com/chris-moreton/plutus-pioneer-program/blob/main/code/week02/src/Week02/Gift.hs" rel="nofollow noreferrer">plutus-pioneer-program</a> but it has this error and I have tried everything but the same error keeps appear:</p>
<pre><code>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: &quot;dist/build/hsc2hscall1082370-0.rsp&quot;
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.
</code></pre>
<p>Here are the steps I do:</p>
<ol>
<li>cd into <a href="https://github.com/input-output-hk/plutus-apps" rel="nofollow noreferrer">plutus-apps</a> directory then</li>
</ol>
<pre><code>$ git checkout 81ba78edb1d634a13371397d8c8b19829345ce0d
$ nix-shell
</code></pre>
<ol start="2">
<li>Now I'm inside the nix-shell, I cd into plutus-pioneer-program's Week2 code and then run</li>
</ol>
<pre><code>[nix-shell:.../plutus-pioneer-program/code/week02]# cabal update
[nix-shell:.../plutus-pioneer-program/code/week02]# cabal build
</code></pre>
<p>That's all, the error above appears. After investigating, I think the error is caused by missing lzma.h, I installed liblzma-dev from <a href="https://cardano.stackexchange.com/questions/6425/lzma-0-0-0-3-missing-when-building-week-01-code">this thread</a>, but the error remains.</p>
<p>Can anyone help me out please? Thank you very much!</p>

CC BY-SA 4.0
2022-11-16T08:10:54.647Z
I am also facing the same issue. Have you found any solution?
χerфmiи
<plutus-pioneer-program><plutus-playground>
Error cabal build: "Failed to build lzma-0.0.0.3" even in nix-shell and also tried "sudo-apt install liblzma-dev"
# Error cabal build: "Failed to build lzma-0.0.0.3" even in nix-shell and also tried "sudo-apt install liblzma-dev"

(Asked by: username_0 on 2022-10-03)

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:

cd into plutus-apps directory then

$ git checkout 81ba78edb1d634a13371397d8c8b19829345ce0d
$ nix-shell


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!

**Tags:** plutus-pioneer-program, plutus-playground
> **Comments:**
> **username_1**: I am also facing the same issue. Have you found any solution?  

---

## 2 answers

### Answer by username_2 on 2022-11-16. Score: 0

After the command
nix-shell

execute in the shell
nix-shell -p lzma


---

### Answer by username_3 on 2022-12-16. Score: 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.


---

