Skip to content

Sys_error during "opam install dune" from within a "dune exec" #2099

Closed
ocaml/opam-repository
#14078
@mato

Description

@mato

While upgrading my Mirage/Solo5 E2E test environments from dune 1.8.2 to 1.9.1, opam install dune started failing with a Sys_error exception. I've managed to extract a minimal reproducible test for this error, here:

https://github.com/mato/dune-1.9.1-issue

To reproduce, with an OPAM switch with dune and shexp installed:

git clone https://github.com/mato/dune-1.9.1-issue.git
cd dune-1.9.1-issue
dune exec bin/main.exe

Results in:

[ERROR] The compilation of dune failed at
        "/home/mato/.opam/opam-init/hooks/sandbox.sh build ./boot.exe --release
        -j 3".

#=== ERROR while compiling dune.1.9.1 =========================================#
# context     2.0.3 | linux/x86_64 | ocaml-base-compiler.4.07.1 | https://opam.ocaml.org#4b9884e4
# path        /tmp/dune-1.9.1-issue/switch/_opam/.opam-switch/build/dune.1.9.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build ./boot.exe --release -j 3
# exit-code   1
# env-file    ~/.opam/log/dune-23705-6d07ae.env
# output-file ~/.opam/log/dune-23705-6d07ae.out

and the entire error from output-file is:

Error: exception Sys_error("/tmp/dune-1.9.1-issue/_build/install/default/lib: No such file or directory")
Backtrace:
Raised by primitive operation at file "src/stdune/path.ml", line 878, characters 25-50
Called from file "src/findlib.ml", line 441, characters 6-31
Called from file "list.ml", line 99, characters 22-25
Called from file "src/stdune/list.ml", line 5, characters 19-33
Called from file "src/stdune/list.ml", line 39, characters 29-39
Called from file "src/findlib.ml", line 440, characters 4-265
Called from file "src/findlib.ml", line 453, characters 20-37
Called from file "src/findlib.ml", line 457, characters 2-21
Called from file "src/lib.ml", line 1334, characters 6-34
Called from file "src/super_context.ml", line 288, characters 4-70
Called from file "src/gen_rules.ml", line 327, characters 6-161
Called from file "src/fiber/fiber.ml", line 99, characters 6-13

I think this is some interaction between opam install being called from within a dune exec. I'm not including the .env file here as this is a public forum, but the above steps are 100% reproducible for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions