# Stuck on stage #QP2 - cannot use readline package

**URL:** <https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951>\
**Category:** Bug Reports\
**Tags:** challenge:shell\
**Created:** [March 1, 2026, 12:23pm UTC](https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951 "2026-03-01T12:23:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubenbakker](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rubenbakker/32/20238_2.png) [@rubenbakker](https://forum.codecrafters.io/u/rubenbakker)\
**Post date:** [March 1, 2026, 12:23pm UTC](https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951/1 "2026-03-01T12:23:29Z")

</div>

I’m unable to install the readline ocaml package. Sounds like readline.h file isn’t present on the system. How can I solve this? Thanks!

```auto
build] > #=== ERROR while compiling readline.0.2 =======================================#
[build] > # context 2.0.10 | linux/x86_64 | ocaml-base-compiler.5.4.0 | git+file:///home/opam/opam-repository
[build] > # path ~/.opam/5.4/.opam-switch/build/readline.0.2
[build] > # command ~/.opam/5.4/bin/dune build -p readline -j 71 @install
[build] > # exit-code 1
[build] > # env-file ~/.opam/log/readline-7-29d576.env
[build] > # output-file ~/.opam/log/readline-7-29d576.out
[build] > ### output ###
[build] > # File "src/dune", line 17, characters 11-19:
[build] > # 17 | (names readline)
[build] > # ^^^^^^^^
[build] > # (cd _build/default/src && /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -pthread -D_FILE_OFFSET_BITS=64 -Wall -fdiagnostics-color=always -g -I /home/opam/.opam/5.4/lib/ocaml -o readline.o -c readline.c)
[build] > # readline.c:6:10: fatal error: readline/readline.h: No such file or directory
[build] > # 6 | #include <readline/readline.h>
[build] > # | ^ ~~~~~~~~~~~~~~~~~~~~
[build] > # compilation terminated.

```

---

<div class="post-metadata">

**Author:** ![senevoldsen](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/senevoldsen/32/6460_2.png) [@senevoldsen](https://forum.codecrafters.io/u/senevoldsen)\
**Post date:** [March 1, 2026, 3:54pm UTC](https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951/3 "2026-03-01T15:54:02Z")

</div>

Is that on the tester or locally? I’m guessing Ocaml is trying to build a library and need the development package for the header file? Locally, you may find it easiest to install `libreadline-dev` or whatever you system calls the underlying package (that the ocaml package itself needs).

---

<div class="post-metadata">

**Author:** ![rubenbakker](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rubenbakker/32/20238_2.png) [@rubenbakker](https://forum.codecrafters.io/u/rubenbakker)\
**Post date:** [March 1, 2026, 4:30pm UTC](https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951/4 "2026-03-01T16:30:40Z")

</div>

Locally it’s working, as the package is installed on my system. It’s the tester that’s failing and I’m unable to install the package.

I found this thread with a similar problem with Zig: [[#QP2][Zig] Using readline, huh?](https://forum.codecrafters.io/t/qp2-zig-using-readline-huh/8554) @andy1li upgraded the Zig buildpack to solve it. Maybe the same thing needs to be done for Ocaml?

Zig Dockerfile:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/8/9/8968a232195092d3c83369fa44de37204733ed48.png)

The Ocaml Dockerfile doesn’t install any additional packages.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [March 4, 2026, 6:49am UTC](https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951/5 "2026-03-04T06:49:19Z")

</div>

Hey @rubenbakker, I’ve updated the OCaml Dockerfile in [this PR](https://github.com/codecrafters-io/build-your-own-shell/pull/303/changes). This should resolve the issue.

Let me know if you’re still running into the problem.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [March 9, 2026, 6:51am UTC](https://forum.codecrafters.io/t/stuck-on-stage-qp2-cannot-use-readline-package/15951/7 "2026-03-09T06:51:02Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
