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

regression (3.7): bls12-381-unix.0.4.1: No implementations provided for the following modules #7027

Closed
emillon opened this issue Feb 8, 2023 · 8 comments · Fixed by #7092
Assignees
Labels
Milestone

Comments

@emillon
Copy link
Collaborator

emillon commented Feb 8, 2023

Hi,

Once again, this is a regression between 3.6.2 and 3.7.0~alpha1. bls12-381-unix.0.4.1 fails with this error:

        Bls12_381__Fq12 referenced from src/unix/bls12_381_unix.cmxa(Bls12_381__Pairing),
           test/unix/.test_fr.eobjs/native/dune__exe__Test_pairing.cmx
         Bls12_381__G1 referenced from src/unix/bls12_381_unix.cmxa(Bls12_381__Pairing),
           test/unix/.test_fr.eobjs/native/dune__exe__Test_pairing.cmx
         Bls12_381__Fr referenced from src/unix/bls12_381_unix.cmxa(Bls12_381__G2),
           test/unix/.test_fr.eobjs/native/dune__exe__Test_pairing.cmx

I bisected that to fb085c0 (#6594).

The dune file has a combination of private_modules and virtual libraries:

(library
 (public_name bls12-381-unix)
 (name bls12_381_unix)
 (implements bls12-381)
 (modules fr g1 g2 pairing fq12 rustc_bls12_381_stubs rustc_bls12_381_bindings)
 (instrumentation (backend bisect_ppx))
 (private_modules Rustc_bls12_381_stubs Rustc_bls12_381_bindings)
 (libraries zarith ctypes ctypes.foreign bls12-381-gen bls12-381)
 (library_flags :standard -linkall -ccopt -pthread)
 (foreign_stubs
  (language c)
  (names rustc_bls12_381_ctypes_c_stubs)
  (flags (-I%{env:OPAM_SWITCH_PREFIX=}/lib/tezos-rust-libs))
 )
 (c_library_flags (-L%{env:OPAM_SWITCH_PREFIX=}/lib/tezos-rust-libs -lrustc_bls12_381 -lpthread))
)

This might be the same as #7015 or #7018.
Thanks.

@emillon emillon added the bug label Feb 8, 2023
@emillon emillon added this to the 3.7.0 milestone Feb 8, 2023
@rgrinberg
Copy link
Member

Hmm, this one seems different than the others. I'll investigate.

@rgrinberg
Copy link
Member

@emillon if you have some time, turning this into a cram test would be quite helpful.

@emillon
Copy link
Collaborator Author

emillon commented Feb 13, 2023

#7038 fixes this; do you still think a repro would be useful?

@rgrinberg
Copy link
Member

I think so. A lot of improvements can be made to the closure so improving the test suite would be worthwhile.

@rgrinberg
Copy link
Member

Could you post the full command that failed if you still have it?

@emillon
Copy link
Collaborator Author

emillon commented Feb 15, 2023

The failing command is dune runtest -p bls12-381-unix. You can find a log here.

The missing modules are indeed not part of the linked library:

$ (cd _build/default && /home/etienne/scratch/repro-dune/_opam/bin/ocamlopt.opt -w -40 -g
-a -o src/unix/bls12_381_unix.cmxa
-cclib -lbls12_381_unix_stubs -cclib -L/home/etienne/scratch/repro-dune/_opam/lib/tezos-rust-libs -cclib -lrustc_bls12_381 -cclib -lpthread -linkall -ccopt -pthread
src/unix/.bls12_381_unix.objs/native/bls12_381__bls12_381_unix__.cmx
src/unix/.bls12_381_unix.objs/native/bls12_381__bls12_381_unix__Rustc_bls12_381_stubs.cmx 
src/unix/.bls12_381_unix.objs/native/bls12_381__bls12_381_unix__Rustc_bls12_381_bindings.cmx 
src/unix/.bls12_381_unix.objs/native/bls12_381__G2.cmx
src/unix/.bls12_381_unix.objs/native/bls12_381__Pairing.cmx 
src/unix/.bls12_381_unix.objs/native/bls12_381.cmx)

This is wrong because Fq12 is listed in (modules). I'll try to make a smaller repro (which in particular does not depend on rust).

@emillon
Copy link
Collaborator Author

emillon commented Feb 15, 2023

(still reducing the problem)

@emillon
Copy link
Collaborator Author

emillon commented Feb 15, 2023

Got it. Here it is as a standalone dune file, though this can be exploded in various files or a cram test:

(subdir
 virtual
 (library
  (name virtual)
  (virtual_modules a b))
 (rule
  (write-file a.mli ""))
 (rule
  (write-file b.mli "")))

(subdir
 impl
 (library
  (name impl)
  (implements virtual)
  (library_flags :standard -linkall))
 (rule
  (write-file a.ml ""))
 (rule
  (write-file b.ml "include A")))

(test
 (name link)
 (libraries impl))

(rule
 (write-file link.ml ""))
% dune runtest
File "_none_", line 1:             
Error: No implementations provided for the following modules:
         Virtual__A referenced from impl/impl.cmxa(Virtual__B)

@rgrinberg rgrinberg linked a pull request Feb 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants