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

Can't find Coq plugin cmxs on loadpath error #7893

Closed
palmskog opened this issue Jun 5, 2023 · 9 comments · Fixed by #7895 or ocaml/opam-repository#23942
Closed

Can't find Coq plugin cmxs on loadpath error #7893

palmskog opened this issue Jun 5, 2023 · 9 comments · Fixed by #7895 or ocaml/opam-repository#23942
Labels

Comments

@palmskog
Copy link

palmskog commented Jun 5, 2023

Expected Behavior

When I create a dune-project and dune file for a Coq project with Dune 3.8 and depend on a Coq plugin installed via coq_makefile like Equations, it should suffice to add (theories Equations) into (coq.theory ...) to enable compilation of the project.

Actual Behavior

When I run dune build, I get the following error:

Error: Can't find file equations_plugin.cmxs on loadpath.

Reproduction

  1. Create a dune-project file like the following:
(lang dune 3.8)
(using coq 0.8)
(name TestEquations)
  1. Create a dune file like the following:
(coq.theory
 (name TestEquations)
 (synopsis "Test Equations")
 (theories Equations)
 ;(plugins coq-equations)
)
  1. Create Eqn.v or other .v file like the following:
From Equations Require Import Equations.
  1. Run dune build, get the following error:
File "./Eqn.v", line 1, characters 0-40:
Error: Can't find file equations_plugin.cmxs on loadpath.

Note that the error disappears if ;(plugins coq-equations) in dune is uncommented.

Specifications

  • Version of dune (output of dune --version): 3.8.0
  • Version of ocaml (output of ocamlc --version): 4.14.1
  • Operating system (distribution and version): Ubuntu LTS 22.04

Additional information

This bug report was submitted at the suggestion of @ejgallego.

  • Coq version: 8.16.0
  • Equations version: 1.3+8.16
@ejgallego
Copy link
Collaborator

ejgallego commented Jun 5, 2023

Thanks a lot for the reproduction instructions @palmskog , for the sake to be sure what the problem is, can you confirm that the user-contrib/Equations directory has the equations_plugins.cmxs file on it?

Can you also post the contents of the _build/log file, after a dune clean && dune build --cache=disabled ?

@palmskog
Copy link
Author

palmskog commented Jun 5, 2023

For the first confirmation:

$ ls ~/.opam/4.14.1+flambda+coq.8.16/lib/coq/user-contrib/Equations/
CoreTactics.glob  CoreTactics.v  CoreTactics.vo  equations_plugin.cmxs  Init.glob  Init.v Init.vo  Prop  Signature.glob  Signature.v  Signature.vo  Type

For the contents of _build/log after a dune clean && dune build --cache=disabled for the successful run with (plugins coq-equations):

# dune build --cache=disabled
# OCAMLPARAM: unset
# Shared cache: disabled
# Workspace root: /home/palmskog/src/rv/vlsm-eqn
# Auto-detected concurrency: 32
$ /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlc.opt -config > /tmp/dune_9bfbe0_output
# Dune context:
#  { name = "default"
#  ; kind = "default"
#  ; profile = Dev
#  ; merlin = true
#  ; for_host = None
#  ; fdo_target_exe = None
#  ; build_dir = In_build_dir "default"
#  ; ocaml_bin = External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin"
#  ; ocaml =
#      Ok External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocaml"
#  ; ocamlc =
#      External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlc.opt"
#  ; ocamlopt =
#      Ok
#        External
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlopt.opt"
#  ; ocamldep =
#      Ok
#        External
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamldep.opt"
#  ; ocamlmklib =
#      Ok
#        External
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlmklib.opt"
#  ; env =
#      map
#        { "DUNE_OCAML_HARDCODED" :
#            "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib"
#        ; "DUNE_OCAML_STDLIB" :
#            "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/ocaml"
#        ; "DUNE_SOURCEROOT" : "/home/palmskog/src/rv/vlsm-eqn"
#        ; "INSIDE_DUNE" : "/home/palmskog/src/rv/vlsm-eqn/_build/default"
#        ; "OCAMLFIND_IGNORE_DUPS_IN" :
#            "/home/palmskog/src/rv/vlsm-eqn/_build/install/default/lib"
#        ; "OCAMLPATH" :
#            "/home/palmskog/src/rv/vlsm-eqn/_build/install/default/lib"
#        ; "OCAMLTOP_INCLUDE_PATH" :
#            "/home/palmskog/src/rv/vlsm-eqn/_build/install/default/lib/toplevel"
#        ; "OCAML_COLOR" : "always"
#        ; "OPAMCOLOR" : "always"
#        }
#  ; findlib_paths =
#      [ External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib" ]
#  ; natdynlink_supported = true
#  ; supports_shared_libraries = true
#  ; ocaml_config =
#      { version = "4.14.1"
#      ; standard_library_default =
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/ocaml"
#      ; standard_library =
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/ocaml"
#      ; standard_runtime = "the_standard_runtime_variable_was_deleted"
#      ; ccomp_type = "cc"
#      ; c_compiler = "gcc"
#      ; ocamlc_cflags =
#          [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-pthread"; "-fPIC" ]
#      ; ocamlc_cppflags = [ "-D_FILE_OFFSET_BITS=64" ]
#      ; ocamlopt_cflags =
#          [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-pthread"; "-fPIC" ]
#      ; ocamlopt_cppflags = [ "-D_FILE_OFFSET_BITS=64" ]
#      ; bytecomp_c_compiler =
#          [ "gcc"
#          ; "-O2"
#          ; "-fno-strict-aliasing"
#          ; "-fwrapv"
#          ; "-pthread"
#          ; "-fPIC"
#          ; "-D_FILE_OFFSET_BITS=64"
#          ]
#      ; bytecomp_c_libraries = [ "-lm"; "-lpthread" ]
#      ; native_c_compiler =
#          [ "gcc"
#          ; "-O2"
#          ; "-fno-strict-aliasing"
#          ; "-fwrapv"
#          ; "-pthread"
#          ; "-fPIC"
#          ; "-D_FILE_OFFSET_BITS=64"
#          ]
#      ; native_c_libraries = [ "-lm" ]
#      ; native_pack_linker = [ "ld"; "-r"; "-o" ]
#      ; cc_profile = []
#      ; architecture = "amd64"
#      ; model = "default"
#      ; int_size = 63
#      ; word_size = 64
#      ; system = "linux"
#      ; asm = [ "as" ]
#      ; asm_cfi_supported = true
#      ; with_frame_pointers = false
#      ; ext_exe = ""
#      ; ext_obj = ".o"
#      ; ext_asm = ".s"
#      ; ext_lib = ".a"
#      ; ext_dll = ".so"
#      ; os_type = "Unix"
#      ; default_executable_name = "a.out"
#      ; systhread_supported = true
#      ; host = "x86_64-pc-linux-gnu"
#      ; target = "x86_64-pc-linux-gnu"
#      ; profiling = false
#      ; flambda = true
#      ; spacetime = false
#      ; safe_string = true
#      ; exec_magic_number = "Caml1999X031"
#      ; cmi_magic_number = "Caml1999I031"
#      ; cmo_magic_number = "Caml1999O031"
#      ; cma_magic_number = "Caml1999A031"
#      ; cmx_magic_number = "Caml1999y031"
#      ; cmxa_magic_number = "Caml1999z031"
#      ; ast_impl_magic_number = "Caml1999M031"
#      ; ast_intf_magic_number = "Caml1999N031"
#      ; cmxs_magic_number = "Caml1999D031"
#      ; cmt_magic_number = "Caml1999T031"
#      ; natdynlink_supported = true
#      ; supports_shared_libraries = true
#      ; windows_unicode = false
#      }
#  }
$ /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqc --config > /tmp/dune_c16a1d_output
$ /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqc --print-version > /tmp/dune_64915f_output
$ (cd _build/default && /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqdep -boot -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq-equations -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/btauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/cc -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/derive -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/extraction -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/firstorder -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/funind -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac2 -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/micromega -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/nsatz -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/number_string_notation -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ring -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/rtauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssreflect -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssrmatching -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tutorial -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/zify -R /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/theories Coq -Q /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/user-contrib/Equations Equations -R . TestEquations -dyndep opt -vos Eqn.v) > _build/default/.TestEquations.theory.d
$ (cd _build/default && /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqc -q -w -deprecated-native-compiler-option -w -native-compiler-disabled -native-compiler ondemand -boot -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq-equations -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/btauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/cc -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/derive -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/extraction -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/firstorder -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/funind -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac2 -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/micromega -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/nsatz -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/number_string_notation -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ring -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/rtauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssreflect -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssrmatching -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tutorial -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/zify -R /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/theories Coq -Q /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/user-contrib/Equations Equations -R . TestEquations Eqn.v)

@ejgallego
Copy link
Collaborator

ejgallego commented Jun 5, 2023

Thanks @palmskog , that's the succesful run with the (plugin ...) thing added, isn't it?

[I correctly see -I $ocaml_lib/lib/coq-equations in the command line]

@palmskog
Copy link
Author

palmskog commented Jun 5, 2023

@ejgallego you're right, my mistake, here is the erroring log with ;(plugins coq-equations):

# dune build --cache=disabled
# OCAMLPARAM: unset
# Shared cache: disabled
# Workspace root: /home/palmskog/src/rv/vlsm-eqn
# Auto-detected concurrency: 32
$ /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlc.opt -config > /tmp/dune_42964b_output
# Dune context:
#  { name = "default"
#  ; kind = "default"
#  ; profile = Dev
#  ; merlin = true
#  ; for_host = None
#  ; fdo_target_exe = None
#  ; build_dir = In_build_dir "default"
#  ; ocaml_bin = External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin"
#  ; ocaml =
#      Ok External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocaml"
#  ; ocamlc =
#      External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlc.opt"
#  ; ocamlopt =
#      Ok
#        External
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlopt.opt"
#  ; ocamldep =
#      Ok
#        External
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamldep.opt"
#  ; ocamlmklib =
#      Ok
#        External
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/ocamlmklib.opt"
#  ; env =
#      map
#        { "DUNE_OCAML_HARDCODED" :
#            "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib"
#        ; "DUNE_OCAML_STDLIB" :
#            "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/ocaml"
#        ; "DUNE_SOURCEROOT" : "/home/palmskog/src/rv/vlsm-eqn"
#        ; "INSIDE_DUNE" : "/home/palmskog/src/rv/vlsm-eqn/_build/default"
#        ; "OCAMLFIND_IGNORE_DUPS_IN" :
#            "/home/palmskog/src/rv/vlsm-eqn/_build/install/default/lib"
#        ; "OCAMLPATH" :
#            "/home/palmskog/src/rv/vlsm-eqn/_build/install/default/lib"
#        ; "OCAMLTOP_INCLUDE_PATH" :
#            "/home/palmskog/src/rv/vlsm-eqn/_build/install/default/lib/toplevel"
#        ; "OCAML_COLOR" : "always"
#        ; "OPAMCOLOR" : "always"
#        }
#  ; findlib_paths =
#      [ External "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib" ]
#  ; natdynlink_supported = true
#  ; supports_shared_libraries = true
#  ; ocaml_config =
#      { version = "4.14.1"
#      ; standard_library_default =
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/ocaml"
#      ; standard_library =
#          "/home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/ocaml"
#      ; standard_runtime = "the_standard_runtime_variable_was_deleted"
#      ; ccomp_type = "cc"
#      ; c_compiler = "gcc"
#      ; ocamlc_cflags =
#          [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-pthread"; "-fPIC" ]
#      ; ocamlc_cppflags = [ "-D_FILE_OFFSET_BITS=64" ]
#      ; ocamlopt_cflags =
#          [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-pthread"; "-fPIC" ]
#      ; ocamlopt_cppflags = [ "-D_FILE_OFFSET_BITS=64" ]
#      ; bytecomp_c_compiler =
#          [ "gcc"
#          ; "-O2"
#          ; "-fno-strict-aliasing"
#          ; "-fwrapv"
#          ; "-pthread"
#          ; "-fPIC"
#          ; "-D_FILE_OFFSET_BITS=64"
#          ]
#      ; bytecomp_c_libraries = [ "-lm"; "-lpthread" ]
#      ; native_c_compiler =
#          [ "gcc"
#          ; "-O2"
#          ; "-fno-strict-aliasing"
#          ; "-fwrapv"
#          ; "-pthread"
#          ; "-fPIC"
#          ; "-D_FILE_OFFSET_BITS=64"
#          ]
#      ; native_c_libraries = [ "-lm" ]
#      ; native_pack_linker = [ "ld"; "-r"; "-o" ]
#      ; cc_profile = []
#      ; architecture = "amd64"
#      ; model = "default"
#      ; int_size = 63
#      ; word_size = 64
#      ; system = "linux"
#      ; asm = [ "as" ]
#      ; asm_cfi_supported = true
#      ; with_frame_pointers = false
#      ; ext_exe = ""
#      ; ext_obj = ".o"
#      ; ext_asm = ".s"
#      ; ext_lib = ".a"
#      ; ext_dll = ".so"
#      ; os_type = "Unix"
#      ; default_executable_name = "a.out"
#      ; systhread_supported = true
#      ; host = "x86_64-pc-linux-gnu"
#      ; target = "x86_64-pc-linux-gnu"
#      ; profiling = false
#      ; flambda = true
#      ; spacetime = false
#      ; safe_string = true
#      ; exec_magic_number = "Caml1999X031"
#      ; cmi_magic_number = "Caml1999I031"
#      ; cmo_magic_number = "Caml1999O031"
#      ; cma_magic_number = "Caml1999A031"
#      ; cmx_magic_number = "Caml1999y031"
#      ; cmxa_magic_number = "Caml1999z031"
#      ; ast_impl_magic_number = "Caml1999M031"
#      ; ast_intf_magic_number = "Caml1999N031"
#      ; cmxs_magic_number = "Caml1999D031"
#      ; cmt_magic_number = "Caml1999T031"
#      ; natdynlink_supported = true
#      ; supports_shared_libraries = true
#      ; windows_unicode = false
#      }
#  }
$ /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqc --config > /tmp/dune_7d4d0d_output
$ /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqc --print-version > /tmp/dune_31d788_output
$ (cd _build/default && /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqdep -boot -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/btauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/cc -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/derive -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/extraction -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/firstorder -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/funind -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac2 -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/micromega -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/nsatz -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/number_string_notation -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ring -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/rtauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssreflect -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssrmatching -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tutorial -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/zify -R /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/theories Coq -Q /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/user-contrib/Equations Equations -R . TestEquations -dyndep opt -vos Eqn.v) > _build/default/.TestEquations.theory.d
$ (cd _build/default && /home/palmskog/.opam/4.14.1+flambda+coq.8.16/bin/coqc -q -w -deprecated-native-compiler-option -w -native-compiler-disabled -native-compiler ondemand -boot -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/btauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/cc -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/derive -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/extraction -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/firstorder -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/funind -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ltac2 -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/micromega -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/nsatz -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/number_string_notation -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ring -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/rtauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssreflect -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/ssrmatching -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tauto -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/tutorial -I /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/../coq-core/plugins/zify -R /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/theories Coq -Q /home/palmskog/.opam/4.14.1+flambda+coq.8.16/lib/coq/user-contrib/Equations Equations -R . TestEquations Eqn.v)
> File "./Eqn.v", line 1, characters 0-40:
> Error: Can't find file equations_plugin.cmxs on loadpath.
>
[1]

@ejgallego
Copy link
Collaborator

I looked at the code that should add the -I for equations and indeed it is there, so the bug must be some kind of silly mistake on our part.

@ejgallego
Copy link
Collaborator

ejgallego commented Jun 5, 2023

@Alizter a dune describe coq-theories or something like that could be helpful to debug this.

@ejgallego
Copy link
Collaborator

Bug confirmed by printing the list of inferred coqpaths:

name: Equations 
path: /home/egallego/.opam/coq-v8.16/lib/coq/user-contrib/Equations 
cmxs: []

@ejgallego
Copy link
Collaborator

The scanning code seems pretty bogus, first bug is:

let scan_vo_cmxs ~path dir_contents =
  let f (d, kind) =
    Format.eprintf "considering %s\n" d;
    match kind with
    (* Skip some directories as Coq does, for now '-' and '.' *)
    | _ when String.contains d '-' -> List.Skip
    | _ when String.contains d '.' -> Skip

The latter condition makes indeed us to scan all files as they contain a dot (examples: Foo.vo equations_plugins.cmxs) etc...

Once we disable that, there are quite a few additional bugs:

  • Plugin filename is passed to -I instead of its directory
  • Logic for subdirs is not correct:
name: Equations.Prop 
 path: /home/egallego/.opam/coq-v8.16/lib/coq/user-contrib/Equations/Prop 
 vo: /home/egallego/.opam/coq-v8.16/lib/coq/user-contrib/Equations/CoreTactics.vo
     /home/egallego/.opam/coq-v8.16/lib/coq/user-contrib/Equations/Init.vo
     /home/egallego/.opam/coq-v8.16/lib/coq/user-contrib/Equations/Signature.vo 
 cmxs: /home/egallego/.opam/coq-v8.16/lib/coq/user-contrib/Equations/equations_plugin.cmxs

I've exhausted my time bugdet for this for today, but that should provide a lead on the fix.

@rgrinberg rgrinberg added the coq label Jun 5, 2023
@ejgallego
Copy link
Collaborator

I did produce a fix in the end, see new PR.

ejgallego added a commit to ejgallego/dune that referenced this issue Jun 5, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

TODO:
  - changelog
  - new test cases [installed plugin]
  - figure out why old test-cases were not catching
    `Coq_lib.Legacy.vo` always returning the empty list.
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 5, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

TODO:
  - changelog
  - new test cases [installed plugin]
  - figure out why old test-cases were not catching
    `Coq_lib.Legacy.vo` always returning the empty list.
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 5, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

TODO:
  - changelog
  - new test cases [installed plugin]
  - figure out why old test-cases were not catching
    `Coq_lib.Legacy.vo` always returning the empty list.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 5, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 5, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 5, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 8, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 8, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit to ejgallego/dune that referenced this issue Jun 9, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
ejgallego added a commit that referenced this issue Jun 9, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes #7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
emillon pushed a commit to emillon/dune that referenced this issue Jun 13, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
emillon added a commit that referenced this issue Jun 15, 2023
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes #7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
Co-authored-by: Emilio Jesus Gallego Arias <e+git@x80.org>
emillon added a commit to emillon/opam-repository that referenced this issue Jun 16, 2023
CHANGES:

- Switch back to threaded console for all systems; fix unresponsive console on
  Windows (ocaml/dune#7906, @nojb)

- Respect `-p` / `--only-packages` for `melange.emit` artifacts (ocaml/dune#7849, @anmonteiro)

- Fix scanning of Coq installed files (@ejgallego, reported by
  @palmskog, ocaml/dune#7895 , fixes ocaml/dune#7893)

- Fix RPC buffer corruption issues due to multi threading. This issue was only
  reproducible with large RPC payloads (ocaml/dune#7418)

- Fix printing errors from excerpts whenever character offsets span multiple
  lines (ocaml/dune#7950, fixes ocaml/dune#7905, @rgrinberg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants