-
Notifications
You must be signed in to change notification settings - Fork 470
jbuilder subst -n <name> is sometimes not properly rooted #954
Copy link
Copy link
Closed
Description
To reproduce:
- install opam 2.0rc3, enable sandboxing
- clone ocaml-cohttp: https://github.com/mirage/ocaml-cohttp
- in that directory, create a local switch:
opam switch create . 4.06.1 - then
opam install cohttp. You will get:
#=== ERROR while compiling cohttp.1.1.0 =======================================#
# context 2.0.0~rc3 | macos/x86_64 | ocaml-base-compiler.4.06.1 | pinned(git+file:///Users/thomas/git/ocaml-cohttp#master#2de6f277)
# path ~/git/ocaml-cohttp/_opam/.opam-switch/build/cohttp.1.1.0
# command ~/.opam/opam-init/hooks/sandbox.sh build jbuilder subst -n cohttp
# exit-code 1
# env-file ~/.opam/log/cohttp-63694-6cc03f.env
# output-file ~/.opam/log/cohttp-63694-6cc03f.out
### output ###
# Entering directory '/Users/thomas/git/ocaml-cohttp'
# Error: exception Sys_error("cohttp-async.opam: Operation not permitted")
# Backtrace:
# Raised by primitive operation at file "pervasives.ml", line 315, characters 29-55
# Called from file "src/stdune/io.ml", line 16, characters 15-36
# Called from file "list.ml", line 100, characters 12-15
# Called from file "src/watermarks.ml", line 226, characters 2-100
# Called from file "src/fiber/fiber.ml", line 359, characters 6-13
You can reproduce that by going into the local switch and running the command again:
$ cd _opam/.opam-switch/build/cohttp.1.1.0
$ ~/.opam/opam-init/hooks/sandbox.sh build jbuilder subst -n cohttp
Entering directory '/Users/thomas/git/ocaml-cohttp'
Error: exception Sys_error("cohttp-async.opam: Operation not permitted")
Backtrace:
Raised by primitive operation at file "pervasives.ml", line 315, characters 29-55
Called from file "src/stdune/io.ml", line 16, characters 15-36
Called from file "list.ml", line 100, characters 12-15
Called from file "src/watermarks.ml", line 226, characters 2-100
Called from file "src/fiber/fiber.ml", line 359, characters 6-13
jbuilder tries to modify the source directory, not the temporary checkout!
And this works:
$ ~/.opam/opam-init/hooks/sandbox.sh build jbuilder subst -n cohttp --root .
/cc @rjbou
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels