failure of 'opam install menhir'

  • Open
  • quality assurance status badge
Details
3 participants
  • Gabriel Hondet
  • Julien Lepiller
  • Simon Tournier
Owner
unassigned
Submitted by
Gabriel Hondet
Severity
normal
G
G
Gabriel Hondet wrote on 22 Feb 2019 21:56
opam fails
(address . bug-guix@gnu.org)
87ef7z1r0q.fsf@gmail.com
Hi,

When I try to use opam, it fails:

$ opam install menhir

#=== ERROR while compiling ocaml-system.4.07.1 ================================#
# context 2.0.1 | linux/x86_64 | | https://opam.ocaml.org#34f81c06
# path ~/.opam/default/.opam-switch/build/ocaml-system.4.07.1
# command ~/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml
# exit-code 1
# env-file ~/.opam/log/ocaml-system-12254-60459a.env
# output-file ~/.opam/log/ocaml-system-12254-60459a.out
### output ###
# bwrap: execvp ocaml: No such file or directory

and if I do (in fish)
$ set -x OPAM_USER_PATH_RO /home/gabriel/.guix-profile/bin/

then I obtain the error:

$ opam install menhir

#=== ERROR while compiling ocaml-system.4.07.1 ================================#
# context 2.0.1 | linux/x86_64 | | https://opam.ocaml.org#34f81c06
# path ~/.opam/default/.opam-switch/build/ocaml-system.4.07.1
# command ~/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml
# exit-code 1
# env-file ~/.opam/log/ocaml-system-13887-6cc03f.env
# output-file ~/.opam/log/ocaml-system-13887-6cc03f.out
### output ###
# bwrap: Can't mkdir parents for /home/gabriel/.guix-profile/bin/: No such file or directory

Any idea on how to fix this?

Thanks,
Gabriel
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5ercJXBcjd3P1FcAMbyBBfZZ1CUFAlxwYfUACgkQMbyBBfZZ
1CXOzQ//UYZYEt3eSbYNH+PSFe5+pY7pfR3BTmoZJPTnGGZtSVZV5cSHZZH8l4AB
UOfA1zPX1hiyk1wqj8Y70avrdpRLuEMe2KUfkkuLsGvMpGw7GSwQj6mKPbMYACcD
+xZhU3RzlU565MHzZ590ycE2j+vyMvViXT9o78oYIPY/a0WRvFiaZTJw7h6UPSBc
aLAOWQn8ydsXocVGv92EjuyiZH+rZO22jeiBKebRSvaVbjBBD7pYqxscJjzcOTtH
PAH9bQbZP6dK9XMgI2IP3EYU+57MMjjCl4EoxxaJOCa36h/FvDFojlzfP4SjF8wI
Zshq4z+so9fgAOs87UH4oawKGlpLG8mBqsgpLel/MZsP/QvhzAD7gloMv/2BAnBS
rZnOB/ckAZrG7zBbhFsavpxICBibyRSj/7MNs2pAL80jehzzU3/WWhbw0ZYd9gbC
NF4g1QbZrT7Bac81fMa4uaUAZx7MJdtGSeUrg0jtYMv3CpdpqOgNcYPahkYMJRpn
K6iJdhDF6QAbmwtc2g/QvSDT07P4pFEgsFrXXg9W0hYwkws15MvfRwuHiwIAkXef
tJ/AqnXZElfAP5PF+X1zRV/kmZ26md5zNCmdtpuheA/qayiyyXG25bplIKDz73jW
t1ucGC1saTpYF6eIFNR/t14tnpn6Y/DsYNXlaS9QAziprdfn0GU=
=F3VW
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 22 Feb 2019 22:41
338B07A5-8A13-4526-BC9F-B9A38E7C899E@lepiller.eu
Le 22 février 2019 21:56:21 GMT+01:00, Gabriel Hondet <gabrielhondet@gmail.com> a écrit :
Toggle quote (43 lines)
>Hi,
>
>When I try to use opam, it fails:
>
>$ opam install menhir
>
>#=== ERROR while compiling ocaml-system.4.07.1
>================================#
># context 2.0.1 | linux/x86_64 | | https://opam.ocaml.org#34f81c06
># path ~/.opam/default/.opam-switch/build/ocaml-system.4.07.1
># command ~/.opam/opam-init/hooks/sandbox.sh build ocaml
>gen_ocaml_config.ml
># exit-code 1
># env-file ~/.opam/log/ocaml-system-12254-60459a.env
># output-file ~/.opam/log/ocaml-system-12254-60459a.out
>### output ###
># bwrap: execvp ocaml: No such file or directory
>
>and if I do (in fish)
>$ set -x OPAM_USER_PATH_RO /home/gabriel/.guix-profile/bin/
>
>then I obtain the error:
>
>$ opam install menhir
>
>#=== ERROR while compiling ocaml-system.4.07.1
>================================#
># context 2.0.1 | linux/x86_64 | | https://opam.ocaml.org#34f81c06
># path ~/.opam/default/.opam-switch/build/ocaml-system.4.07.1
># command ~/.opam/opam-init/hooks/sandbox.sh build ocaml
>gen_ocaml_config.ml
># exit-code 1
># env-file ~/.opam/log/ocaml-system-13887-6cc03f.env
># output-file ~/.opam/log/ocaml-system-13887-6cc03f.out
>### output ###
># bwrap: Can't mkdir parents for /home/gabriel/.guix-profile/bin/: No
>such file or directory
>
>Any idea on how to fix this?
>
>Thanks,
>Gabriel

That's thc limit of opam here, it always tries to install ocaml package with the ocaml compiler. Don't you have a compiler in your switch already though? If so, I wonder why it's not found. Could you try to modify your $PATH to add it?
G
G
Gabriel Hondet wrote on 23 Feb 2019 17:58
Re: bug#34620: Acknowledgement (opam fails)
(address . 34620@debbugs.gnu.org)
87bm321lx2.fsf@gmail.com
Hi again,

After some experiments, and after looking at what did Nix, it seems that
wrapping opam does the trick (with a .opam-real and a opam). I'll try
this and make a patch.

Cheers,
Gabriel
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5ercJXBcjd3P1FcAMbyBBfZZ1CUFAlxxe8oACgkQMbyBBfZZ
1CXcbA/+IjNqT4WbE2hC6bf7lLmcbphB8Cs+J38ugewrkodHOTVA7Q1hZBbMJw9M
1aAzIBuAwUbUEYHyU/5bx0iA5g8GHel5G1mJG16lSaJwuaNS4pSJTaoaXI1MYLvj
txzHp0aedfh5xiht6hRu4SNzRoKgnSlpAYFcg0OiyL1wjaxFh44bX3cDOwRtuAHU
fUjA8O44Po4mOIeM5LsJlIlsUgSrCnr6wl+Qtoqk3dAC5/X16zY6eDg0t25ozTEl
eAjQa45fLjxxSPzSLRp2XEHegraeRzlNOXa6RANPBlu2UcVFynnikU3i12E21gH5
IPqcN0ReXRADDhSZIf1gi3c7nyfvD6DMD+tE3CBVtg7l9T1TOxYD4ct6GKK9PRKk
UayT45sN7gqsfnoEBlP1FAQOrJzq238eT3/WJEA/dGjr1lWEnwEI6SbM9xxQDVpt
xsXkg7x49oJy6J4SHerfGFbQc03dfbSWzCDhDCCblyRWp42pSejsyTAP4P88Q8BD
HitEKHR7W8gOrro/4V1B/dIcYH4VHIu5tffPcrmlqOtBisJ4b0qxWrHG9DuJxxlB
PwJO/XYTIMbVhvXBZ9Kat62MuQAEnQHEGz/H/gdtIFz6Drl+b1L6GfrpTeMQZP2j
4eL7jw9rS/5FshMLorGpH2+9GYhOnXY/By0lBvWoZ4LufA25Ml8=
=vKDI
-----END PGP SIGNATURE-----

G
G
Gabriel Hondet wrote on 24 Feb 2019 08:43
(address . 34620@debbugs.gnu.org)
878sy51vik.fsf@gmail.com
Hello,

Wrapping works except that the binary can't find libraries, how can I
add the libraries of the profile (e.g. =asm/socket.h= or =crti.o=) in
the wrapper? The matter is to get the path of a profile (as if it was a
package in the ~inputs~ of the function).

Gabriel
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5ercJXBcjd3P1FcAMbyBBfZZ1CUFAlxySzMACgkQMbyBBfZZ
1CXf3w/7BqAHbxxB0h9Iy5NzPP+of25DPpkVdBTBvFL1TkTPDYWXiDfzUVH1sakA
qR2/mXPw0dO8EJJXayVNN0PVIOu0LNeyBQVi2bFZfEbu//6wo2Xr9DbEf3vjBWVv
iOMXBtmmucQGanso32rnpA3POqKh4q8RCXiM1L8O+5X7Z78gTF5fwftPxURx3XIq
AlG0qxfy9dh1YiYPc0UaSXhhQskmg6dn3Yr7x/o6i3PGU/ANrCm3KawxSB8+0/zG
t6LrS6Dql8JObJsrdfKwaMHDwpnLacbMlq0NIfmpOIBMnbFwCW+zDi6E/+PQz4zX
jIyIIMDsfVn2AywRyEdBBKlsJ27kyeH+oBf5oiyhMIlgG88SKNANfb5XcyFT/VBt
Akb3okJXBgfQpcjVILC/4eMio7Qi1oMwg+T1OU0YSlgTslJsGhy/cCgmyKfbEmRD
0cwFpQshoxyqOTumFAEJUG8oGOYmOsSPGF5UhfMYD4usB242ADPSyOrci0X2ZVdY
eJQ+cdxiGnlQP6k/KJpanK4YOxdhgGt5PQVgriqjOUJWmoZ9zq8f190pI79AWa8A
FAl1EKOIENYaDR03hnbt2g7+oYdZCoxu5xCry5EhWKfMEt7ND83CmXOzIaACPunm
GoA0FIJkqEjy6H3l62ARuBa2WCPoEk/9NrCo3jfIhIdAuHEboOg=
=zq1W
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 24 Feb 2019 11:15
1E11E517-AD19-4999-B775-9D17B081B36E@lepiller.eu
Le 24 février 2019 08:43:47 GMT+01:00, Gabriel Hondet <gabrielhondet@gmail.com> a écrit :
Toggle quote (10 lines)
>Hello,
>
>Wrapping works except that the binary can't find libraries, how can I
>add the libraries of the profile (e.g. =asm/socket.h= or =crti.o=) in
>the wrapper? The matter is to get the path of a profile (as if it was
>a
>package in the ~inputs~ of the function).
>
>Gabriel

Can you share whbt you've done so far?
S
S
Simon Tournier wrote on 11 Oct 2023 10:58
Re: bug#34620: 'opam install menhir' fails
(name . Gabriel Hondet)(address . gabrielhondet@gmail.com)(address . 34620@debbugs.gnu.org)
86pm1llemq.fsf@gmail.com
Hi,

Digging some old bugs about OCaml, I hit #34620:


On Fri, 22 Feb 2019 at 21:56, Gabriel Hondet <gabrielhondet@gmail.com> wrote:

Toggle quote (29 lines)
> $ opam install menhir
>
> #=== ERROR while compiling ocaml-system.4.07.1 ================================#
> # context 2.0.1 | linux/x86_64 | | https://opam.ocaml.org#34f81c06
> # path ~/.opam/default/.opam-switch/build/ocaml-system.4.07.1
> # command ~/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml
> # exit-code 1
> # env-file ~/.opam/log/ocaml-system-12254-60459a.env
> # output-file ~/.opam/log/ocaml-system-12254-60459a.out
> ### output ###
> # bwrap: execvp ocaml: No such file or directory
>
> and if I do (in fish)
> $ set -x OPAM_USER_PATH_RO /home/gabriel/.guix-profile/bin/
>
> then I obtain the error:
>
> $ opam install menhir
>
> #=== ERROR while compiling ocaml-system.4.07.1 ================================#
> # context 2.0.1 | linux/x86_64 | | https://opam.ocaml.org#34f81c06
> # path ~/.opam/default/.opam-switch/build/ocaml-system.4.07.1
> # command ~/.opam/opam-init/hooks/sandbox.sh build ocaml gen_ocaml_config.ml
> # exit-code 1
> # env-file ~/.opam/log/ocaml-system-13887-6cc03f.env
> # output-file ~/.opam/log/ocaml-system-13887-6cc03f.out
> ### output ###
> # bwrap: Can't mkdir parents for /home/gabriel/.guix-profile/bin/: No such file or directory

Today, using Guix 6113e05, I get:

Toggle snippet (65 lines)
$ which opam
/home/simon/.config/guix/profiles/compiler/compiler/bin/opam

$ opam install menhir
The following actions will be performed:
? recompile ocamlfind 1.9.5 [upstream or system changes]
? recompile dune 3.6.1 [upstream or system changes]
∗ install menhirSdk 20230608 [required by menhir]
∗ install menhirLib 20230608 [required by menhir]
? recompile csexp 1.5.1 [uses dune]
? recompile cppo 1.6.9 [uses dune]
∗ install menhir 20230608
? recompile merlin-lib 4.7-414 [uses dune]
? recompile yojson 2.0.2 [uses dune]
? recompile dot-merlin-reader 4.6 [upstream or system changes]
? recompile merlin 4.7-414 [uses dot-merlin-reader, dune]
===== ∗ 3 ? 8 =====
Do you want to continue? [Y/n] Y
Y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
? retrieved cppo.1.6.9 (cached)
? retrieved csexp.1.5.1 (cached)
? retrieved dot-merlin-reader.4.6 (cached)
? retrieved dune.3.6.1 (cached)
? retrieved menhir.20230608 (https://opam.ocaml.org/cache)
? retrieved merlin.4.7-414 (cached)
? retrieved merlin-lib.4.7-414 (cached)
? retrieved ocamlfind.1.9.5 (cached)
? retrieved yojson.2.0.2 (cached)
? retrieved menhirLib.20230608 (https://opam.ocaml.org/cache)
[ERROR] The compilation of ocamlfind.1.9.5 failed at "make all".
? retrieved menhirSdk.20230608 (https://opam.ocaml.org/cache)

#=== ERROR while compiling ocamlfind.1.9.5 ====================================#
# context 2.1.3 | linux/x86_64 | ocaml.4.14.0 | https://opam.ocaml.org#368128df
# path ~/.opam/default/.opam-switch/build/ocamlfind.1.9.5
# command ~/.opam/opam-init/hooks/sandbox.sh build make all
# exit-code 2
# env-file ~/.opam/log/ocamlfind-218324-578149.env
# output-file ~/.opam/log/ocamlfind-218324-578149.out
### output ###
# [...]
# File "frontend.ml", line 859, characters 10-39:
# 859 | Fl_package_base.package_users predicates1 packages1
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Warning 6 [labels-omitted]: label preds was omitted in the application of this function.
# ocamlc -I +compiler-libs -o ocamlfind -g findlib.cma unix.cma \
# -I +unix -I +dynlink ocaml_args.cmo frontend.cmo
# File "_none_", line 1:
# Error: Error while linking /gnu/store/9pa7j2sdlzsvbxczbn1xmnycxaddzz0c-ocaml-5.0.0/lib/ocaml/unix/unix.cma(Unix):
# The external function `caml_unix_waitpid' is not available
# make[1]: *** [Makefile:53: ocamlfind] Error 2
# make[1]: Leaving directory '/home/simon/.opam/default/.opam-switch/build/ocamlfind.1.9.5/src/findlib'
# make: *** [Makefile:14: all] Error 2


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
?? The following actions failed
? λ build ocamlfind 1.9.5
??
?? No changes have been performed
# Run eval $(opam env) to update the current shell environment

Well, I think it is another kind of bug than the reported one.

Closing?

Cheers,
simon
S
S
Simon Tournier wrote on 11 Oct 2023 10:58
control message for bug #34620
(address . control@debbugs.gnu.org)
86o7h5lelv.fsf@gmail.com
retitle 34620 failure of 'opam install menhir'
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 34620@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 34620
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch