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

META file includes private libraries #580

Merged
merged 1 commit into from
Mar 5, 2018

Conversation

rgrinberg
Copy link
Member

This is incorrect as those aren't installed.

@diml this is a pretty serious bug that was discovered in mirage/ocaml-git#280 (comment)

I suppose the fix is to exclude these private names and include the .cm files in the libraries that depend on the private stuff.

I'm not really sure when this regression was introduced either. I recall this case working fine before. I wonder when this regression was introduced.

This is incorrect as those aren't installed
@rgrinberg
Copy link
Member Author

Btw, I suppose the proper way to handle this would be to install the private libraries archives except for the cmi's so they're unusable. But I think this requires us to have the strict libraries feature. So that the internal library is hidden for all in-source consumers of the lib.

@ghost
Copy link

ghost commented Mar 5, 2018

I don't think this was ever supported. The fix is to make jbuilder report an error in this case

@rgrinberg
Copy link
Member Author

rgrinberg commented Mar 5, 2018

You don't agree with my proposal of installing the private libs without their cmi's? Seems like that would be adequate to solve this problem and also useful. It shouldn't very hard once we have strict includes.

I'll make it an error for now though. As it's much better than what we have now.

@rgrinberg rgrinberg merged commit 2945569 into ocaml:master Mar 5, 2018
@ghost
Copy link

ghost commented Mar 5, 2018

You don't agree with my proposal of installing the private libs without their cmi's?

But if the library has no public name, what do you attach the .cma of the private lib to? i.e. what archives(...) field does it go into?

@rgrinberg
Copy link
Member Author

Yeah, adding the .cma's to the the library that is using the internal libraries will work. The only issue here seems to be the possible duplication on the file system. As other public libs using these private dependencies will also want to install these.

Another way would be to install the private libs as their own findlib packages but not install their cmi's. We'll perhaps need some sort of name mangling scheme so that users aren't tripped up by these private libraries.

Anyway, I'm not 100% sure of this implementation, but I think the idea of public libraries using private dependencies is sound.

@ghost
Copy link

ghost commented Mar 5, 2018

Yeah, adding the .cma's to the the library that is using the internal libraries will work. The only issue here seems to be the possible duplication on the file system. As other public libs using these private dependencies will also want to install these.

There is one more issue: let's say you have 3 public libraries a, b and c and a private library x:

  • a depends on x
  • b depends on x
  • c depends on a and b

if you add x.cma to both a and b, then you can't link anything using c, as x.cma would end up being being linked twice.

@ghost
Copy link

ghost commented Mar 5, 2018

We discussed this at some point with @bobot. I think it's a lot simpler if such libraries have their own findlib package. Sometimes authors might want such libraries to be hidden as they don't correspond to things users should use directly. For such cases we could have a convention: for instance when one component in the findlib name starts with an underscore, it is not displayed by ocamlfind list

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.

1 participant