This error is already kind of confirmed by an OCaml developer in IRC, since he got the very same error number on Jbuilder some time ago, while nobody else was able to reproduce it back then.
The stdout and stderr files are both empty.
➜ ~ opam install merlin -v
The following actions will be performed:
∗ install cppo 1.6.0 [required by yojson]
∗ install easy-format 1.3.0 [required by yojson]
∗ install biniou 1.2.0 [required by yojson]
∗ install yojson 1.4.0 [required by merlin]
∗ install merlin 3.0.2
===== ∗ 5 =====
Do you want to continue ? [Y/n] y
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[biniou] Archive in cache
[cppo] Archive in cache
[easy-format] Archive in cache
[merlin] Archive in cache
[yojson] Archive in cache
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[cppo: jbuilder build] Command started
[easy-format: jbuilder build] Command started
+ jbuilder "build" "-p" "cppo" "-j" "4" (CWD=/home/matthias/.opam/4.05.0+flambda/build/cppo.1.6.0)
[ERROR] The compilation of cppo failed at "jbuilder build -p cppo -j 4".
+ jbuilder "build" "-p" "easy-format" "-j" "4" (CWD=/home/matthias/.opam/4.05.0+flambda/build/easy-format.1.3.0)
[ERROR] The compilation of easy-format failed at "jbuilder build -p easy-format -j 4".
#=== ERROR while installing cppo.1.6.0 ========================================#
# opam-version 1.2.2
# os linux
# command jbuilder build -p cppo -j 4
# path /home/matthias/.opam/4.05.0+flambda/build/cppo.1.6.0
# compiler 4.05.0+flambda
# exit-code 127
# env-file /home/matthias/.opam/4.05.0+flambda/build/cppo.1.6.0/cppo-11487-c61e7b.env
# stdout-file /home/matthias/.opam/4.05.0+flambda/build/cppo.1.6.0/cppo-11487-c61e7b.out
# stderr-file /home/matthias/.opam/4.05.0+flambda/build/cppo.1.6.0/cppo-11487-c61e7b.err
#=== ERROR while installing easy-format.1.3.0 =================================#
# opam-version 1.2.2
# os linux
# command jbuilder build -p easy-format -j 4
# path /home/matthias/.opam/4.05.0+flambda/build/easy-format.1.3.0
# compiler 4.05.0+flambda
# exit-code 127
# env-file /home/matthias/.opam/4.05.0+flambda/build/easy-format.1.3.0/easy-format-11487-a71bb4.env
# stdout-file /home/matthias/.opam/4.05.0+flambda/build/easy-format.1.3.0/easy-format-11487-a71bb4.out
# stderr-file /home/matthias/.opam/4.05.0+flambda/build/easy-format.1.3.0/easy-format-11487-a71bb4.err
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
∗ install biniou 1.2.0
∗ install merlin 3.0.2
∗ install yojson 1.4.0
The following actions failed
∗ install cppo 1.6.0
∗ install easy-format 1.3.0
No changes have been performed
'opam install merlin -v' failed.
➜ ~
ls $(opam config var bin)/jbuilder
/home/matthias/.opam/4.05.0+flambda/bin/jbuilder
opam reinstall jbuilder
The following actions will be performed:
↻ recompile jbuilder 1.0+beta12
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[default] https://opam.ocaml.org/archives/jbuilder.1.0+beta12+opam.tar.gz downloaded
=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
⊘ removed jbuilder.1.0+beta12
[ERROR] The compilation of jbuilder failed at "ocaml bootstrap.ml".
#=== ERROR while installing jbuilder.1.0+beta12 ===============================#
# opam-version 1.2.2
# os linux
# command ocaml bootstrap.ml
# path /home/matthias/.opam/4.05.0+flambda/build/jbuilder.1.0+beta12
# compiler 4.05.0+flambda
# exit-code 127
# env-file /home/matthias/.opam/4.05.0+flambda/build/jbuilder.1.0+beta12/jbuilder-12652-e7966f.env
# stdout-file /home/matthias/.opam/4.05.0+flambda/build/jbuilder.1.0+beta12/jbuilder-12652-e7966f.out
# stderr-file /home/matthias/.opam/4.05.0+flambda/build/jbuilder.1.0+beta12/jbuilder-12652-e7966f.err
=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
∗ install jbuilder 1.0+beta12
The following changes have been performed
⊘ remove jbuilder 1.0+beta12
The former state can be restored with:
opam switch import "~/.opam/4.05.0+flambda/backup/state-20170804140806.export"
➜ Downloads git:(master) ✗
I guess it’s too late now, but if there’s still something there (there shouldn’t) what happens if you try to run this binary manually ? and what are the permissions ?
Regarding the opam reinstall jbuilder failure it seems you should report this upstream.
jbuilder, but forget about this. Your problem is somewhere else, it seems opam is unable to execute anything that it installed. Can you run the binary ?
$(opam config var bin)/ocaml --version
echo $(opam config var bin)
I don’t understand what is going maybe you should simply rm -r .opam and start over.
For some reason opam config exec can’t run what is in opam config var bin despite the fact that according to opam config exec -- env that the PATH is correctly setup. I’m sorry but I cannot help further.
This has been confirmed to be a problem with an OPAM binary compiled with OCaml 4.05.0, due to changed semantics in the execvpe call.
Workaround: Run
eval `opam config env`
in your shell before executing the opam command.
There is also a proposed PR in OCaml to regain the old execvpe behaviour in future releases, and @altgr is investigating backporting a fix into the opam 1.2 branch.