# ERROR while compiling fmt.0.8.7

**URL:** <https://discuss.ocaml.org/t/error-while-compiling-fmt-0-8-7/4352>\
**Category:** Learning\
**Tags:** opam, mirageos\
**Created:** [September 11, 2019, 7:36pm UTC](https://discuss.ocaml.org/t/error-while-compiling-fmt-0-8-7/4352 "2019-09-11T19:36:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atzensepp](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@atzensepp](https://discuss.ocaml.org/u/atzensepp)\
**Post date:** [September 11, 2019, 7:36pm UTC](https://discuss.ocaml.org/t/error-while-compiling-fmt-0-8-7/4352/1 "2019-09-11T19:36:55Z")

</div>

I want to try out Lucas Pluvinags’s mirage port to ESP32.  
([https://www.lortex.org/posts/mirage/esp32/2018/06/22/build-your-own-mirage.html](https://www.lortex.org/posts/mirage/esp32/2018/06/22/build-your-own-mirage.html))  
After creating and changing to a _opam switch 4.06.0+32bit_ I want to do a  
_opam install mirage_

wich fails with:

```
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><> <><><><>
[ERROR] The compilation of fmt failed at
    "/home/florian/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml
    build --dev-pkg false --with-base-unix true --with-cmdliner true".

#=== ERROR while compiling fmt.0.8.7 ==========================================#
# context 2.0.4 | linux/x86_64 | ocaml-variants.4.06.0+32bit | https://opam.ocaml.org#3389beb3
# path ~/.opam/4.06.0+32bit/.opam-switch/build/fmt.0.8.7
# command ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --dev-pkg false --with-base-unix true --with-cmdliner true
# exit-code 1
# env-file ~/.opam/log/fmt-24744-6ef1df.env
# output-file ~/.opam/log/fmt-24744-6ef1df.out
### output ###
# [...]
# Error: Integer literal exceeds the range of representable integers of type int
# Command exited with code 2.
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
# '-build-dir' '_build' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md'
# 'README.md' 'src/fmt.a' 'src/fmt.cmxs' 'src/fmt.cmxa' 'src/fmt.cma'
# 'src/fmt.cmx' 'src/fmt.cmi' 'src/fmt.mli' 'src/fmt_tty.a'
# 'src/fmt_tty.cmxs' 'src/fmt_tty.cmxa' 'src/fmt_tty.cma'
# 'src/fmt_tty.cmx' 'src/fmt_tty.cmi' 'src/fmt_tty.mli' 'src/fmt_cli.a'
# 'src/fmt_cli.cmxs' 'src/fmt_cli.cmxa' 'src/fmt_cli.cma'
# 'src/fmt_cli.cmx' 'src/fmt_cli.cmi' 'src/fmt_cli.mli' 'src/fmt_top.a'
# 'src/fmt_top.cmxs' 'src/fmt_top.cmxa' 'src/fmt_top.cma'
# 'src/fmt_top.cmx' 'src/fmt_tty_top_init.ml']: exited with 10

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build fmt 0.8.7
└─ 
╶─ No changes have been performed

```

Could someone help me to get over this hurdle?

---

<div class="post-metadata">

**Author:** ![ivg](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ivg/32/103_2.png) [@ivg](https://discuss.ocaml.org/u/ivg)\
**Post date:** [September 11, 2019, 7:55pm UTC](https://discuss.ocaml.org/t/error-while-compiling-fmt-0-8-7/4352/2 "2019-09-11T19:55:38Z")

</div>

The error message indicates that a project is using an integer literal that exceeds the maximum integer value representable in 32-bit OCaml, e.g., `let x = 0xDEABEEF` works fine in 64-bit OCaml, but is not portable to 32-bit OCaml, because it doesn’t fit into 31-bit.

You shall submit a problem report to the project mainpage [https://github.com/dbuenzli/fmt/issues](https://github.com/dbuenzli/fmt/issues)

---

<div class="post-metadata">

**Author:** ![Armael](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/armael/32/1223_2.png) [@Armael](https://discuss.ocaml.org/u/Armael)\
**Post date:** [September 11, 2019, 8:58pm UTC](https://discuss.ocaml.org/t/error-while-compiling-fmt-0-8-7/4352/3 "2019-09-11T20:58:21Z")

</div>

From [https://github.com/dbuenzli/fmt/issues/38](https://github.com/dbuenzli/fmt/issues/38) I suspect the issue is fixed in the master branch, but not the last released version.

You could try pinning the dev version of fmt: `opam pin add fmt --dev-repo`

---

<div class="post-metadata">

**Author:** ![atzensepp](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@atzensepp](https://discuss.ocaml.org/u/atzensepp)\
**Post date:** [September 13, 2019, 8:23pm UTC](https://discuss.ocaml.org/t/error-while-compiling-fmt-0-8-7/4352/4 "2019-09-13T20:23:00Z")

</div>

Thank you for the hint. Meanwhile I have installed fmt.0.8.6

`opam install fmt.0.8.6`

and reran

`opam install mirage`

With that mirage compiled.
