Closed Vekhir closed 8 months ago
Thanks for the detailed report! I opted for the pragmatic solution and replaced the custom Arbitrary
instance with a dependency on quickcheck-instances
. It's a simple fix and helps users (not only on arch) that are stuck on text-ansi <0.3
Description
When building
hledger-iadd
1.3.20 with GHC 9.8 on Arch, the following error occurs:Analysis
This occurs due to
text-builder-dev
addingquickcheck-instances
as a dependency in 0.3.4.1 and later. As tests/DateParserSpec usesimport Test.QuickCheck
, that also importsTest.QuickCheck.Instances
leading to the duplication.This issue is even explained in the description of quickcheck-instances:
Further, the
text-builder-dev
library is used subsequently until it reacheshledger-iadd
, except thattext-ansi
switched totext-builder-linear
with version 0.3.0, and so it doesn't depend ontext-builder-dev
anymore (transitively). As Arch still shipstext-ansi
0.2.1.1, this problem became visible.Potential solutions
Not sure what to do from a dev perspective.
hledger-iadd
could addquickcheck-instances
themselves, using the new definition, or somehow try to hide it. Perhaps the better solution would be intext-builder-dev
to remove it again as explained in the description above. Since newertext-ansi
isn't affected by this issue, perhaps adding a requirement for that is most appropiate. Though the dependency arises by the use ofhledger-lib
, so ideally they would restricttext-ansi
to not export the orphans themselves. Could be a tough sell though for something that only affects downstream. The quickest solution for users and packagers is to simply updatetext-ansi
to 0.3.0 or above. This requires GHC 9.2 or above.System information
OS: Arch Linux Kernel: 6.7.2-arch1-1 GHC: 9.8.1 hledger-iadd: 1.3.20 hledger-lib: 1.32.3 text-ansi: 1.2.1.1 text-builder: 0.6.7.2 text-builder-dev: 0.3.4.2
A lot of the analysis came about during the writing of it. If anything, this report is useful when Arch officially updates the affected packages or if someone else does a weird half upgrade of packages. I intend to close this issue when haskell-text-ansi gets updated to 0.3.0 or higher. -- Vekhir