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

Restore stronger check for overlapping libraries #587

Merged
3 commits merged into from Mar 6, 2018
Merged

Restore stronger check for overlapping libraries #587

3 commits merged into from Mar 6, 2018

Conversation

ghost
Copy link

@ghost ghost commented Mar 5, 2018

Let's consider the following case:

  • library a is part of the workspace
  • a depends on b which is only installed
  • b depends on c which is both installed and present in the workspace

before beta18, this was an error. In beta18 it isn't an error anymore, this allows in particular to lint Base without having to create a big workspace. However the new behavior is confusing for users, so we restore the pre-beta18 behavior by default and add an option allow_soft_conflicts to get the beta18 behavior.

@ghost
Copy link
Author

ghost commented Mar 5, 2018

I'm not entirely sure about the name allow_soft_conflicts, this is open to suggestions

src/jbuild.ml Outdated
@@ -795,7 +797,7 @@ module Executables = struct
Ok public_names
else
Error "The list of public names must be of the same \
length as the list of names")
length as the list of names")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace issues?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

@rgrinberg
Copy link
Member

I'm not so sure why it has to be an option on buildables. Shouldn't it be a workspace or a profile setting? For example it would be nice if building @lint would automatically set this.

@hcarty
Copy link
Member

hcarty commented Mar 5, 2018

@diml Thank you! Pinning to your fork/branch fixes the simple a/b/c test case as well as the real project where I first ran into the issue.

In the real project with a more complicated nesting of code I now get the same error I would get in beta17 (names edited):

Error: Conflict between the following libaries:
- "a" in _build/default/b/a/src
- "a" in /home/hcarty/.opam/4.06.0/lib/a
    -> required by library "c" in /home/hcarty/.opam/4.06.0/lib/c
This is not allowed.

while in beta18 I'd just get a type error.

Ah, and there's a typo in the error message there (lib(r)aries).

@ghost
Copy link
Author

ghost commented Mar 5, 2018

Ah, and there's a typo in the error message there (lib(r)aries).

Thanks, it's fixed

@ghost
Copy link
Author

ghost commented Mar 5, 2018

I'm not so sure why it has to be an option on buildables. Shouldn't it be a workspace or a profile setting? For example it would be nice if building @lint would automatically set this.

@rgrinberg, possibly. Although even for @lint this is unlikely to happen. Base is a particular case. Additionally in the case of Base, it seems to me that we will almost always want this behavior, so it this information should be written once and for all in the jbuild file.

@hcarty
Copy link
Member

hcarty commented Mar 5, 2018

Would allow_mixed_dependencies work for the option name?

@ghost
Copy link
Author

ghost commented Mar 5, 2018

I'm not sure mixed is the right term, it makes me think about allowing both local and external dependencies. But maybe allow_overlapping_dependencies.

@hcarty
Copy link
Member

hcarty commented Mar 5, 2018

I like overlapping for this.

Jeremie Dimino added 3 commits March 5, 2018 18:14

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ghost
Copy link
Author

ghost commented Mar 5, 2018

I updated the code

@ghost ghost merged commit 2acbc72 into ocaml:master Mar 6, 2018
rgrinberg added a commit to rgrinberg/jbuilder that referenced this pull request Sep 10, 2020
This is an ancient feature introduced in
ocaml#587

But no test cases were added. This PR addresses this.

Signed-off-by: Rudi Grinberg <[email protected]>
rgrinberg added a commit to rgrinberg/jbuilder that referenced this pull request Sep 10, 2020
This is an ancient feature introduced in
ocaml#587

But no test cases were added. This PR addresses this.

Signed-off-by: Rudi Grinberg <[email protected]>
This pull request was closed.
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.

None yet

2 participants