haskell / aeson

A fast Haskell JSON library
Other
1.26k stars 321 forks source link

Relax attoparsec-aeson-2.1 bounds #1058

Closed IamfromSpace closed 1 year ago

IamfromSpace commented 1 year ago

Hi all, the existence of the compatibility package of attoparsec-aeson is very helpful for making sure that projects that depend on a minimal interface for aeson can do things like conditional compilation to be broadly compatible across all versions.

Right now, the bounds in attoparsec-aeson for aeson are set to >=1.4.1.0, but I think these can easily go as low as >=0.11.0.0 (if not omitted all together). 0.11.x is the first appearance of Data.Aeson.Parser, so anyone using a version that far back might be interested in using this package. The interface is slightly extended between 0.11.x and 1.4.x, but so is the interface between 1.4.x and 2.1.x, so I think the only lower bound that makes sense is whether or not the module was exposed. And I'm still not convinced any lower bound is needed on 2.1--this is a compatibility package after all, and it exposes nothing.

At the moment, hal supports stack LTSes all the way back to 11 and 12. However, the version of aeson in these is outside the current bounds attoparsec-2.1 bounds, meaning our current versions would have to drop that guarantee. If the bounds could be lowered so we can continue to maintain our offering of broad and long lived compatibility, that would be much appreciated, thanks!

phadej commented 1 year ago

You can always have an automatic flag like

flag attoparsec-aeson
  manual: False
  default: True

-- and then in the library
library
  ...
  if flag(attoparsec-aeson)
    build-depends: aeson >=2.2 && <2.3, attoparsec-aeson >=2.2 && <2.3
  else
    build-depends: aeson <2.2

The attoparsec-aeson-2.1 is there to add convenience for most, but not all users.


aeson-1.4.1.0 is almost exactly 5 years old version right now. The five years is e.g. the same as Ubuntu keeps standard support for its LTS releases. Asking for more from OSS maintainers is IMHO inappropriate.

IamfromSpace commented 1 year ago

I’ll be exploring a flag approach next, thank you.

I would ask that you reconsider however, simply based on the low level of effort involved in relaxing bounds, with the possibility of helping other maintainers.