Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opam sandboxing issues #19

Closed
reynir opened this issue Nov 10, 2022 · 5 comments · Fixed by #24
Closed

Opam sandboxing issues #19

reynir opened this issue Nov 10, 2022 · 5 comments · Fixed by #24

Comments

@reynir
Copy link
Member

reynir commented Nov 10, 2022

On a new opam switch in the master branch of conan I get the following error when installing conan:

Entering directory '/home/reynir/workspace/conan'
Copying to _destdir/home/reynir/workspace/conan/_opam/lib/conan/META
Error: mkdir(_destdir): Read-only file system

While in another opam switch installing conan from opam results in a different but related error:

Entering directory '/home/reynir/workspace/builder-web'
Error: Unknown package conan!
Fatal error: exception Sys_error("_build/.filesystem-clock: Read-only file system")
Raised by primitive operation at Stdlib.open_out_gen in file "stdlib.ml", line 331, characters 29-55
Called from Stdune__io.Make.with_file_out in file "otherlibs/stdune/io.ml", line 102, characters 17-43
Called from Dune_engine__cached_digest.get_current_filesystem_time in file "src/dune_engine/cached_digest.ml", line 80, characters 2-38
Called from Dune_engine__cached_digest.delete_very_recent_entries in file "src/dune_engine/cached_digest.ml", line 94, characters 12-42
Called from Dune_engine__cached_digest.dump.(fun) in file "src/dune_engine/cached_digest.ml", line 117, characters 8-37
Called from Stdune__exn.protectx in file "otherlibs/stdune/exn.ml", line 12, characters 8-11
Re-raised at Stdune__exn.protectx in file "otherlibs/stdune/exn.ml", line 18, characters 4-11
Called from Stdlib.at_exit.new_exit in file "stdlib.ml", line 560, characters 59-63
Called from Stdlib.do_at_exit in file "stdlib.ml" (inlined), line 566, characters 20-61
Called from Stdlib.exit in file "stdlib.ml", line 569, characters 2-15
Called from Main in file "bin/main.ml", line 100, characters 4-10
@reynir
Copy link
Member Author

reynir commented Nov 10, 2022

For _destdir I found out reading dune install --help that dune install --create-install-files creates _destdir:

   --create-install-files
       Do not directly install, but create install files in the root
       directory and create substituted files if needed in destdir
       (_destdir by default)

I don't know what this does, if it's necessary, and maybe we can get away with adding in the opam file

install: ["dune" "install"]

The same dune install --create-install-files invocation is present in conan.0.2.0 in opam repository.

@dinosaure
Copy link
Member

I mainly followed this tutorial from dune: https://dune.readthedocs.io/en/stable/sites.html?highlight=create-install-files#installation. And it says that we must add the --create-install-files. Probably @rgrinberg has a better knowledge than me about your error and my usage of dune-site.

@tmcgilchrist
Copy link
Member

Similar but different error installing on macOS (Monterey) opam 2.1.4 and ocaml 4.14.1.

$ opam install conan
The following actions will be performed:
  ∗ install conan 0.0.2

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
⬇ retrieved conan.0.0.2  (cached)
[ERROR] The compilation of conan.0.0.2 failed at "dune install --create-install-files conan".

#=== ERROR while compiling conan.0.0.2 ========================================#
# context     2.1.4 | macos/x86_64 | ocaml-base-compiler.4.14.1 | https://opam.ocaml.org/#26770281
# path        ~/code/ocaml/ocamlot/_opam/.opam-switch/build/conan.0.0.2
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune install --create-install-files conan
# exit-code   1
# env-file    ~/.opam/log/conan-14922-5c5eb5.env
# output-file ~/.opam/log/conan-14922-5c5eb5.out
### output ###
# Error: Unknown package conan!



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build conan 0.0.2
└─ 
╶─ No changes have been performed

@dinosaure
Copy link
Member

I will try to look deeper on this issue, however, I suspect a dune issue here. Let me confirm that.

@reynir
Copy link
Member Author

reynir commented Apr 26, 2023

Hi, I did a git grep -- --create-install-files in opam-repository, and all other occurences add as well "-p" name" in the invocation. I will test if this fixes it for me and submit a PR.

dinosaure added a commit to dinosaure/opam-repository that referenced this issue Apr 28, 2023
…cli (0.0.3)

CHANGES:

- Fix the OCaml 5 support (@dinosaure, @Leonidas-from-XIV, mirage/conan#21)
- Apply `ocamlformat.0.24.1` (@dinosaure, mirage/conan#22)
- Fix lower bounds (@gridbugs, mirage/conan#23)
- Add `-p` name to dune install invocation (@reynir, mirage/conan#24, mirage/conan#19)
- Fix the MacOS support (@dinosaure, mirage/conan#25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants