Closed Bodigrim closed 1 year ago
It would be better if
System.Console.ANSI.Types
was provided from a separate ultralightweight package, say,ansi-terminal-types
, which bothtasty
andansi-terminal
could depend upon.
This sounds like a good plan!
This did not work out: tasty
depends on ansi-terminal
not only directly, but also via optparse-applicative
and ansi-wl-pprint
.
@Bodigrim wrote:
not only directly, but also via
cabal-plan
can give you the whole dependency tree.
On Windows
filepath
struggles to usetasty
for its test suite because of a circular dependency throughtasty -> ansi-terminal -> Win32 -> filepath
. Insteadfilepath
rolls out a small testing framework of its own: https://github.com/haskell/filepath/blob/7139cd3383a2aae440a57b5604a8182d9a983715/tests/TestUtil.hsIf we could make
ansi-terminal
an optional dependency,filepath
would be able to use vanillatasty
to organise its test suite. More generally, I find it very important to keeptasty
as slim and robust as possible, because a) it is used a lot to test GHC boot libraries, where no other packages can be taken for granted, b) thousands of CI jobs buildtasty
daily, so even small savings in dependency graph are worthwhile.On the surface it seems entirely doable: while
tasty
usesansi-terminal
to add some colour to the output, this is just bells-and-whistles. E. g., if you runcabal test
without--test-show-details=direct
, ANSI features are completely ignored, and they are certainly irrelevant for CI runs.However, a closer look reveals that
Test.Tasty.Providers.ConsoleFormat
re-exports entities fromSystem.Console.ANSI.Types
. Thus, makingansi-terminal
an optional dependency would affect API, which is not quite acceptable.It would be better if
System.Console.ANSI.Types
was provided from a separate ultralightweight package, say,ansi-terminal-types
, which bothtasty
andansi-terminal
could depend upon. This waytasty
could either makeansi-terminal
an optional dependency or even reimplement few functions we use and eliminate this dependency unconditionally.@andreasabel how does it sound? If you are on board with this plan, I can discuss it with
ansi-terminal
maintainers.