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

The paths of Lwt's installed cmi files #364

Closed
aantron opened this issue May 19, 2017 · 5 comments
Closed

The paths of Lwt's installed cmi files #364

aantron opened this issue May 19, 2017 · 5 comments
Labels
Milestone

Comments

@aantron
Copy link
Collaborator

aantron commented May 19, 2017

@diml in ocaml/opam-repository#9228 (comment):

qcow-tool fails to build in one the datakit build. I check, it's because mirage-block-unix uses Lwt_unix but lwt.unix is missing from the jbuild. It's not detected at build time since the cmi files for lwt.unix are installed in the same directory as the cmi files for lwt.

/cc @aantron, it'd be better to install the cmi for the various sub-libraries in sub-directories, to avoid problems like these. jbuilder installs the files for a library with findlib name a.b.c in /a/b/c.

This seems like a problem with jbuilder being incompatible with non-jbuilder installs; on the other hand, maybe we can just move these .cmi files in the next release, and avoid friction.

cc @djs55 @rgrinberg

EDIT: instructions for testing are below.

@aantron aantron added the medium label May 19, 2017
@aantron aantron added this to the 3.1.0 milestone May 19, 2017
@Drup
Copy link
Member

Drup commented May 19, 2017

The recent oasis feature called "FindlibDirectory" should allow to do that quite easily.

@aantron
Copy link
Collaborator Author

aantron commented May 20, 2017

So I guess this is a matter of

  1. Adding FindlibDirectory to each Findlib library package in _oasis that has a FindlibParent (example).
  2. Finding out what version of OASIS implements FindlibParent, either by reading its changelog, or somehow through blame in that repo.
  3. Making sure Lwt's opam file requires at least that version of OASIS.

@aantron aantron added easy and removed medium labels May 20, 2017
@ghost
Copy link

ghost commented May 22, 2017

FTR, jbuilder is compatible with non-jbuilder installs. It simply reads META files like ocamlfind. The issue I was talking about in the PR is the following:

  1. create a file referencing Lwt_unix
  2. compile it with ocamlfind ocamlc -package lwt -c ...
  3. link an exectuable with ocamlfind ocamlc -package lwt -o ...

Only step (3) will fail. Which is unfortunate because if the user forgets to state a dependency on lwt.unix, then they won't get an error until much later when someone tries to link an executable with their libraries. The right way to deal with include paths is to have one library per directory, and that's what jbuilder enforces for libraries it installs itself.

@aantron aantron changed the title jbuilder and the paths of Lwt's installed cmi files The paths of Lwt's installed cmi files May 22, 2017
@aantron
Copy link
Collaborator Author

aantron commented May 22, 2017

Thanks for clarifying, @diml.

So, I guess to work on this, one would:

  1. Pin Lwt master with opam source --dev-repo --pin lwt.
  2. Follow the instructions from @diml's post above to reproduce the issue.
  3. Make a git branch and make the change to _oasis described above.
  4. opam reinstall lwt (or opam upgrade lwt?) to install a version of Lwt from your branch, with the _oasis change included.
  5. Follow the same steps as in (2) to reproduce, but make sure they trigger an error at step 2 this time.
  6. PR the branch to the Lwt repo.

@aantron
Copy link
Collaborator Author

aantron commented Jun 9, 2017

This was resolved by #374.

@aantron aantron closed this as completed Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants