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

don't install ocaml_integers.h twice #555

Closed
wants to merge 1 commit into from

Conversation

symphorien
Copy link

This makes ocamlfind emit a warning and prevents building with nix and
opam2nix

This makes ocamlfind emit a warning and prevents building with nix and
opam2nix
@symphorien
Copy link
Author

Well the travis failures are strange, because without this patch, here is the output I get:

[...]
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ocaml_integers.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_type_info_stubs.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_cstubs_internals.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_primitives.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_complex_stubs.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_ldouble_stubs.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/cstubs_internals.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_raw_pointer.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_managed_buffer_stubs.h
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_types.cmti
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/posixTypes.cmti
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.cmti
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/complexL.cmti
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/lDouble.cmti
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/posixTypes.cmt
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.cmt
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/complexL.cmt
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/lDouble.cmt
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/cstubs_internals.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_structs.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_primitive_types.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_static.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_types.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/posixTypes.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/complexL.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/lDouble.cmi
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_types.mli
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/posixTypes.mli
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.mli
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/complexL.mli
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/lDouble.mli
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.a
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/libctypes_stubs.a
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.cmxs
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.cmxa
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/dllctypes_stubs.so
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes.cma
ocamlfind  install -add ctypes -optional  _build/ctypes-top.cma   _build/ctypes-top.cmxa _build/ctypes-top.cmxs   _build/ctypes-top.a src/ctypes-top/ctypes_printers.mli _build/src/ctypes-top/ctypes_printers.cmi  _build/src/ctypes-top/ctypes_printers.cmt _build/src/ctypes-top/ctypes_printers.cmti  /nix/store/h38slrdk6r12sgc9lrf3gsdcb03ki0dw-integers-0.2.2/lib/integers/ocaml_integers.h _build/src/ctypes-top/ctypes_printers.cmx _build/src/ctypes-top/install_ctypes_printers.cmx
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/install_ctypes_printers.cmx
Installed /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ctypes_printers.cmx
ocamlfind: [WARNING] Overwriting file /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ocaml_integers.h
ocamlfind: /nix/store/jkzwdzw4qimlamqvypdzkiic4g1wy4v8-ctypes-0.13.1/lib/ctypes/ocaml_integers.h: Permission denied
make: *** [Makefile:184: install-ctypes-top] Error 2
Command failed.
builder for ‘/nix/store/b2y5r7qv2dhmvk4c1i6yz2f2j96q3738-ctypes-0.13.1.drv’ failed with exit code 2

(ocaml 4.04.2, linux x86_64)
This shows that the header is indeed copied twice (and because of nix, the header is read-only which causes the failure, but that is unrelated)
I can git a way to reproduce the above result with nix and opam2nix, but it is rather involved.

@timbertson
Copy link

I think this file gets installed one for each component being installed - so if you install ctypes and ctypes-top, you'll get it twice. But in that case this change causes it to be installed zero times? (Not sure why some builds are passing in that case, perhaps they have it on their search path automatically?)

If that's the case, I guess you'd need to pull it up to its own project in the makefile in order to only install it once. I don't follow the makefile well enough to know how that would work though.

@symphorien
Copy link
Author

mmh makes sense.

@yallop
Copy link
Owner

yallop commented Dec 22, 2017

Thanks for the report & analysis @symphorien & @timbertson.

#557 attempts to fix the problem. Feedback on that PR would be welcome: does it fix things for you?

@symphorien
Copy link
Author

yes it solves the problem. Thanks

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 this pull request may close these issues.

3 participants