ERROR while compiling fmt.0.8.7

I want to try out Lucas Pluvinags’s mirage port to ESP32.
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/ build ocaml pkg/
    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 |
# path        ~/.opam/4.06.0+32bit/.opam-switch/build/fmt.0.8.7
# command     ~/.opam/opam-init/hooks/ build ocaml pkg/ 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.
# [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
#      '-build-dir' '_build' 'opam' 'pkg/META' '' ''
#      '' '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/']: 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?

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

1 Like

From 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

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.

1 Like