OPAM install fails on bytecode-only architectures
Just like in the title. I tried installing Menhir on a bytecode-only OPAM switch and it failed with ocamlopt: command not found
. I pasted the error at the end of this issue, but I think I know where it comes from:
The Makefile
supports TARGET=byte
but does not infer it on its own. And the OPAM package does not give it this information. There might be a way with OPAM filter but I'm not sure that there is anything about bytecode-only. An other way would be to let the Makefile detect it automatically. If you don't think that this is a sensible default, why not default to native
but allow for TARGET=auto
?
OPAM logs follow:
#=== ERROR while compiling menhir.20181113 ====================================#
# context 2.0.3 | linux/x86_64 | ocaml-variants.4.04.2+bytecode-only | https://opam.ocaml.org#a94e4b1b
# path ~/.opam/4.04.2+bytecode-only/.opam-switch/build/menhir.20181113
# command ~/.opam/opam-init/hooks/sandbox.sh build make -f Makefile PREFIX=/home/niols/.opam/4.04.2+bytecode-only USE_OCAMLFIND=true docdir=/home/niols/.opam/4.04.2+bytecode-only/doc/menhir libdir=/home/niols/.opam/4.04.2+bytecode-only/lib/menhir mandir=/home/niols/.opam/4.04.2+bytecode-only/man/man1
# exit-code 2
# env-file ~/.opam/log/menhir-1921-d2c37b.env
# output-file ~/.opam/log/menhir-1921-d2c37b.out
### output ###
# [...]
# /home/niols/.opam/4.04.2+bytecode-only/bin/ocamlc -c -g -bin-annot -safe-string -o TableInterpreter.cmo TableInterpreter.ml
# /home/niols/.opam/4.04.2+bytecode-only/bin/ocamlc -c -g -bin-annot -safe-string -o StaticVersion.cmo StaticVersion.ml
# /home/niols/.opam/4.04.2+bytecode-only/bin/ocamlc -pack -g -bin-annot General.cmo Convert.cmo IncrementalEngine.cmo EngineTypes.cmo Engine.cmo ErrorReports.cmo Printers.cmo InfiniteArray.cmo PackedIntArray.cmo RowDisplacement.cmo LinearizedArray.cmo TableFormat.cmo InspectionTableFormat.cmo InspectionTableInterpreter.cmo TableInterpreter.cmo StaticVersion.cmo -o menhirLib.cmo
# ocamlopt -c -g -bin-annot -safe-string -for-pack MenhirLib -o General.cmx General.ml
# + ocamlopt -c -g -bin-annot -safe-string -for-pack MenhirLib -o General.cmx General.ml
# /bin/sh: ocamlopt : commande introuvable
# Command exited with code 127.
# make[2]: *** [Makefile:44: stage1] Error 10
# make[2] : on quitte le répertoire « /home/niols/.opam/4.04.2+bytecode-only/.opam-switch/build/menhir.20181113/src »
# make[1]: *** [Makefile:34: bootstrap] Error 2
# make[1] : on quitte le répertoire « /home/niols/.opam/4.04.2+bytecode-only/.opam-switch/build/menhir.20181113/src »
# make: *** [Makefile:121: all] Error 2