-
Notifications
You must be signed in to change notification settings - Fork 2
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
Incorrect upper bounds generated #6
Comments
dhess
added a commit
to hackworthltd/primer
that referenced
this issue
Oct 15, 2022
Also, we make the following changes: * Switch back to the haskell.nix-provided HLS. * Undo the workarounds needed for input-output-hk/haskell.nix#1177 as that issue has now been fixed upstream. * disable the NixOS test framework for the time being until I can port it to the next NixOS test system. * Switch to fourmolu 0.8.2 as building 0.7 causes a segfault on `aarch64-darwin`, all of a sudden. * Reformat our Cabal files using the latest `cabal-fmt`. * Drop the GHC 8.10.7 workaround for `cabal-fmt`. * Drop `cabal-edit` from our toolset, as it produces bad PVP bounds, and has apparently been abandoned upstream. See sdiehl/cabal-edit#6
dhess
added a commit
to hackworthltd/primer
that referenced
this issue
Oct 15, 2022
Also, we make the following changes: * Switch back to the haskell.nix-provided HLS. * Undo the workarounds needed for input-output-hk/haskell.nix#1177 as that issue has now been fixed upstream. * disable the NixOS test framework for the time being until I can port it to the next NixOS test system. * Switch to fourmolu 0.8.2 as building 0.7 causes a segfault on `aarch64-darwin`, all of a sudden. * Reformat our Cabal files using the latest `cabal-fmt`. * Drop the GHC 8.10.7 workaround for `cabal-fmt`. * Drop `cabal-edit` from our toolset, as it produces bad PVP bounds, and has apparently been abandoned upstream. See sdiehl/cabal-edit#6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following sequence of commands
cabal-edit latest optics
: says the latest isoptics ^>= 0.4
cabal-edit add optics
: adds the dependencyoptics ^>= 0.4
cabal-edit update optics
: changes the dependency tooptics >=0.4 && <=0.5
(Note the use of<=
here)There two things to note here. A minor distraction is that upgrading an up-to-date package changed the cabal file. The much more important thing is that this upper bound is incorrect!
This claims we will be compatible with an as-yet-unreleased new major version of
optics
. I don't think that this is what the version bound should be. I expect I should have either ofoptics >=0.4 && <0.5
, (which is equivalent to the original bound). This says "compatible until the next major version bump".optics >=0.4 && <=0.4
(I chose a bad example here, for a current dependency ofdep ^>= 1.2.3.4
and a newer version of1.7.8.9
we would getdep >=1.2.3.4 && <= 1.7.8.9
). This says "compatible with the currently-released version, but maybe not anything later, even minor/patch releases".I think the confusion in the code is between
cabal-edit/exe/Main.hs
Line 387 in 3e509ba
upgrade
- note thatmajorUpperBound
computes the next-greater major version - andcabal-edit/exe/Main.hs
Line 168 in 3e509ba
cabal-edit/exe/Main.hs
Line 205 in 3e509ba
upgrade
function seems to use it as thelatest
version (thus putting a<=
bound).I think the fix should be straightforward and am willing to send a PR once it is clear which of the two options would be preferable. (Note to self: potentially is worth adding a lint pass to detect a
<=
bound on a non-existing version number?)The text was updated successfully, but these errors were encountered: