-
Notifications
You must be signed in to change notification settings - Fork 714
Fix the duplicate modules check #7966
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the code, but I tested the product on hashable-1.2.7
and hashable-1.3
and found now that it works as expected: build and install succeed, check gives this warning:
Warning: Potential duplicate modules (subject to conditionals) in benchmark:
Data.Hashable.RandomSource
in if not (null dupLibsLax) | ||
then [PackageBuildImpossible $ "Duplicate modules in " ++ s ++ ": " ++ commaSep (map prettyShow dupLibsLax)] | ||
else if not (null dupLibsStrict) | ||
then [PackageDistSuspicious $ "Potential duplicate modules (subject to conditionals) in " ++ s ++ ": " ++ commaSep (map prettyShow dupLibsStrict)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be PackageDistInexcusable
, since in this case there's a branch where modules are duplicated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inexecusable would prevent hackage upload. Given that people can write multiple if branches that are not obviously nonexclusive, but whose conditions (e.g. ghc versions) logically can't all be satisfied at once, this would make the check more restrictive than prior. So e.g. ghc-src-gen could be built but not uploaded. One could argue this would be cleaner, but my goal was to clarify existing checks and allow more clearly legit stuff to pass, not to add any new restrictions.
Could you post hackage-tests results ( #7776 (comment) ) with master, master with this patch, and master with #7616 reverted? |
Master without this patch has 1116 build impossible. With it, there are only 525 build impossible, with the remaining 591 are now marked as suspicious. So that seems about right. |
What is the number with #7616 reverted? |
Damn it, i ran that test the other day and then forgot to post the results, which are now on a lost terminal. But the build impossible was no less than with this patch, and perhaps even the exact same -- i.e. the results tied out as one would hope. |
@Mergifyio rebase master |
✅ Branch has been successfully rebased |
edd300b
to
a58592e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fully understand the code neither but trust it 🙂
but I think this really need a changelog entry and a regression test, based in the hashable case f.e., bonus if it tests the warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this really need a changelog entry and a regression test, based in the hashable case f.e., bonus if it tests the warning
@Mergifyio rebase master |
✅ Branch has been successfully rebased |
a58592e
to
0480612
Compare
Full hackage test check data for each case at index
//cc @fgaz |
@Mergifyio rebase master |
✅ Branch has been successfully rebased |
0480612
to
d3a6c09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for the fix
Great to see this fixed! BEFORE:
AFTER: works! |
Resolves #7776
Now if a package may have duplicate modules (subject to conditionals), cabal warns on this.
But if a package necessarily has duplicate modules (because they are not guarded by conditionals), cabal will error.