Closed jvillard closed 7 years ago
Note that this issue also possibly exposes a bug in jbuilder's handling of the directory
option in findlib.
Those zip.cma's that jbuilder is complaining about are in fact equivalent. camlzip is aliases to zip as we can see in the META:
https://github.com/xavierleroy/camlzip/blob/master/META-camlzip https://github.com/xavierleroy/camlzip/blob/master/META-zip
Although this could also be a bug in camlzip as it installs all of its artifacts twice. Into lib/camlzip and lib/zip.
The camlzip behaviour is because for a long time camlzip didn't build with findlib and so people (= individuals and OS packagers, I think) created META files and some people used zip for the package and some people used camlzip!
@dra27 Ouch :) . findlib seems doesn't seem to handle this either btw.
This fails as well:
ocamlfind ocamlopt -package camlzip,zip -linkall -linkpkg x.ml -w +31 -o x.opt
Perhaps this means that we should just fix camlzip. It seems like camlzip (or zip) should really be just an alias using requires = "..."
then
Seems like these zip packages should indeed be fixed. However there is also a conflict between extlib and camomile. This is a bit unfortunate since camomile doesn't install the cmi files for UTF8
or Uchar
, so they are only accessible through CamomileLibrary...
.
I didn't know you could link a byte-code executable with two toplevel modules of the same name. In the short term, maybe we should just pass -w -31
when building custom utops.
Disabling the warning seems like a good workaround.
Are there any negative consequences possible to disabling this warning?
I did some experiments and when a module is linked twice and the interfaces don't match, it is an error. So we can't get a segfault, but we might get weird behaviors (duplicated global states, etc...).
Additionally, it seems that we only get the warning if both modules are pulled. For toplevels this will always be the case as we link with -linkall
. This might explain why these errors go unnoticed.
So turning warning 31 into a non-fatal warning seems OK.
I've made a PR for camlzip and the warning is no longer fatal. So this is now fixed.
I need to at least be able to pass flags to disable some fatal warnings 31, otherwise the compilation fails for my project: