Skip to content

Conversation

clyring
Copy link
Member

@clyring clyring commented Sep 12, 2025

This uses tasty-inspection-testing, which is needs a plugin and so introduces a circular dependency:

 bytestring -> plugin -> ghc -> bytestring

This is worked around with an ugly but simple hack: Guard the part of the testsuite that uses the plugin behind a flag, and change the name of the (local) package before trying to build the testsuite with that flag enabled.


(Obviously there are more similar tests that could be added if this works and isn't too repulsive.)

This uses tasty-inspection-testing, which is a plugin and so
introduces a circular dependency:
   bytestring -> plugin -> ghc -> bytestring
This is worked around with an ugly but simple hack:
Guard the part of the testsuite that uses the plugin behind a flag,
and change the name of the (local) package before trying to build
the testsuite with that flag enabled.
bytestring.cabal Outdated
default: False
manual: True

Flag plugin-tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat suboptimal, because Hackage won't have any idea that this is an internal flag for tests only and will proudly advertise the flag to everyone. Given that we hack the Cabal file anyway, could we insert build-depends and other-modules as a part of shell script too?

@@ -0,0 +1,45 @@
{-# LANGUAGE TemplateHaskellQuotes #-}

module PluginTests.Splices where
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add an explicit export list?

, (`doesNotUseAnyOf` unpackCString_functions_all)
]

hasNoStringyStuffExceptFolds :: Name -> Q Exp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems unused anywhere?

@@ -0,0 +1,14 @@
# small script to hackily work around the dependency cycle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about chmod +x on this file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants