-
Notifications
You must be signed in to change notification settings - Fork 697
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
Introduce checks for upper dependencies in setup. #5370
Conversation
Re: tests, something like |
You mean for pre- |
I don't cover cases like: #4683 (comment) or if dependency on a Cabal exists due to the dependency on the other package. |
That's fine. |
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 modulo minor comments.
| otherwise = emitWarning nm | ||
emitError nm = | ||
PackageDistInexcusable $ | ||
"The dependency 'build-depends: '"++nm++"' does not specify an " |
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.
s/build-depends/setup-depends/.
Right (pkgs', _) -> | ||
Map.fromListWith intersectVersionRanges | ||
[ (pname, vr) | ||
| Just spi <- pure $ setupBuildInfo pkgs' |
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 you can use maybeToList
here. Also, "spi" should be "sbi" ("bi" by convention means "build info").
setup depends are now checked for having upper dependencies. Upper bounds are mandatory for base and Cabal libraries, and are optional (but emit warning) for other libraries. Implicit dependencies are not being checked.
@23Skidoo I've addressed your comments and added a test case. |
Coincidentally, I've just implemented making |
A bunch of solver tests now fail... |
@@ -0,0 +1,24 @@ | |||
import Test.Cabal.Prelude | |||
|
|||
-- Test that setup shows all the 'autogen-modules' warnings. |
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.
Copy-pasto.
Thanks, but I think we can update the tests that run |
I'll need to make this change more complex, currently cabal does not distinguish between |
The change we want to do is replace |
For a mandatory upper bound (at Hackage if I recall) I set |
closing in favor of #7409 |
* Introduce checks for upper dependencies in setup. setup depends are now checked for having upper dependencies. Upper bounds are mandatory for base and Cabal libraries, and are optional (but emit warning) for other libraries. Implicit dependencies are not being checked. * Add tests. * Fix tests. * add changelog * fix test for the newer cabal_raw' * scale down alerts: no warnings on any package, only errors on base+Cabal * address review comments * typo * improve changelog (add Cabal) * remove boundedAbove and use Distribution.Version.hasUpperBound instead Co-authored-by: Alexander Vershilov <alexander.vershilov@gmail.com> Co-authored-by: Emily Pillmore <emilypi@cohomolo.gy> Co-authored-by: Mikolaj Konarski <mikolaj@well-typed.com>
setup depends are now checked for having upper dependencies.
Upper bounds are mandatory for base and Cabal libraries, and
are optional (but emit warning) for other libraries.
Implicit dependencies are not being checked.
Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!