-
Notifications
You must be signed in to change notification settings - Fork 414
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
"Rule failed to generate the following targets" with virtual package #4195
Comments
Running without sandbox in
works fine
Then, it looks like the issue comes from the sandbox. I continue to investigate. |
bls12-381-unix.0.4.1 has been merged in the public opam-repository, see ocaml/opam-repository#18112. The CI of opam-repository didn't detect it. However, the issue appears when running
|
To avoid confusion, I am sometimes talking about bls12-381-js and sometimes about bls12-381-unix: the error appears for both, so i mix them. Looks like it is related to virtual packages. |
It looks like it is because there is a missing permission. [...]
# This case-switch should remain identical between the different sandbox implems
COMMAND="$1"; shift
case "$COMMAND" in
build)
add_mounts ro "$OPAM_SWITCH_PREFIX"
add_mounts rw "$PWD"
add_ccache_mount
add_dune_cache_mount
;;
install)
add_mounts rw "$OPAM_SWITCH_PREFIX"
[...]
esac https://github.com/ocaml/dune/blob/main/src/dune_rules/virtual_rules.ml#L40, where the exception is raised, the src and dst values are:
I then tried to simply add the write permissions on $OPAM_SWITCH_PREFIX (brutal method...), like this: [...]
build)
add_mounts rw "$OPAM_SWITCH_PREFIX" # HERE, ro -> rw.
add_mounts rw "$PWD"
add_ccache_mount
add_dune_cache_mount
;;
[...] and it does install without any issue. |
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require Signed-off-by: Danny Willems <[email protected]>
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require Signed-off-by: Danny Willems <[email protected]>
Fix ocaml#4195 In sandbox, symlink requires rw permissions on the directory of the sources to create a symlink. Copy does not require Signed-off-by: Danny Willems <[email protected]>
Fix ocaml#4195 Signed-off-by: Danny Willems <[email protected]>
Use stat instead of lstat in refresh_and_chmod Fix ocaml#4195 Signed-off-by: Danny Willems <[email protected]>
By using stat instead of lstat in refresh_and_chmod Fix #4195 Signed-off-by: Danny Willems <[email protected]>
By using stat instead of lstat in refresh_and_chmod Fix #4195 Signed-off-by: Danny Willems <[email protected]>
…ne-action-plugin, dune-private-libs and dune-glob (2.8.3) CHANGES: - Make `patdiff` show refined diffs (ocaml/dune#4257, fixes ocaml/dune#4254, @hakuch) - Fixed a bug that could result in needless recompilation under Windows due to case differences in the result of `Sys.getcwd` (observed under `emacs`). (ocaml/dune#3966, @nojb). - Restore compatibility with Coq < 8.10 for coq-lang < 0.3 , document that `(using coq 0.3)` does require Coq 8.10 at least (ocaml/dune#4224, fixes ocaml/dune#4142, @ejgallego) - Add a META rule for 'compiler-libs.native-toplevel' (ocaml/dune#4175, @AltGr) - No longer call `chmod` on symbolic links (fixes ocaml/dune#4195, @dannywillems) - Dune no longer automatically create or edit `dune-project` files (ocaml/dune#4239, fixes ocaml/dune#4108, @jeremiedimino) - Have `dune` communicate the location of the standard library directory to `merlin` (ocaml/dune#4211, fixes ocaml/dune#4188, @nojb) - Workaround incorrect exception raised by Unix.utimes (OCaml PR#8857) in Path.touch on Windows (ocaml/dune#4223, @dra27) - `dune ocaml-merlin` is now able to provide configuration for source files in the `_build` directory. (ocaml/dune#4274, @voodoos) - Automatically delete left-over Merlin files when rebuilding for the first time a project previously built with Dune `<= 2.7`. (ocaml/dune#4261, @voodoos, @aalekseyev) - Fix `ppx.exe` being compiled for the wrong target when cross-compiling (ocaml/dune#3751, fixes ocaml/dune#3698, @toots) - `dune top` correctly escapes the generated toplevel directives, and make it easier for `dune top` to locate C stubs associated to concerned libraries. (ocaml/dune#4242, fixes ocaml/dune#4231, @nojb) - Do not pass include directories containing native objects when compiling bytecode (ocaml/dune#4200, @nojb)
I am working on the JavaScript support for a package called bls12-381 implementing the curve BLS12-381 using a Rust optimized implementation.
The initial version of the package
bls12-381
was only for UNIX, and was using an intermediate Rust dependency called rustc-bls12-381.The JavaScript part uses jsoo to call a wasm version of the rust code given above.
I decided to go with the following structure:
src/virtual
src/unix
src/js
, mostly callingbls12-381-js-gen
undersrc/js-gen
.Intermediate packages are used for modularity/to ease the implementation of UNIX/JS support (bls12-381-gen, bls12-381-js-gen). So the structure is more:
When building and running the tests with
dune build @runtest
, everything is fine. However, when I try to install with opam (see below), I get a bunch of the following error for different files:Expected Behavior
Compile without errors.
Actual Behavior
Reproduction
git clone https://gitlab.com/dannywillems/ocaml-bls12-381 && cd ocaml-bls12-381
opam switch create . 4.09.1 --no-install
2b.
git checkout remove-pin-depends
# temporary, require a MR to be merged in ocaml/opam-repository2c.
opam pin add tezos-rust-libs.1.1 "git+https://gitlab.com/tezos/tezos-rust-libs.git#f0a269087fe86dbe1cf471bb76e42fb4a481e226"
# temporary, like 2b.opam pin add bls12-381-gen.dev ./ --no-action
opam pin add bls12-381.dev . --no-action
opam pin add bls12-381-unix.dev . --no-action
opam pin add bls12-381-js-gen . --no-action
opam pin add bls12-381-js . --no-action
opam install bls12-381-gen --with-test
opam install bls12-381 --with-test
opam instal bls12-381-unix --with-test
# will fail with the error above.opam instal bls12-381-js-gen --with-test
# fine.opam instal bls12-381-js --with-test
# will fail, with the error above.However, when using
dune build @runtest
, it does work fine.Specifications
dune
(output ofdune --version
):2.8.2
ocaml
(output ofocamlc --version
):4.09.1
opam
:2.06
.The text was updated successfully, but these errors were encountered: