testsuite: Add tests to catch changes in core libraries
Here we add testing infrastructure to ensure that changes in core
libraries (e.g. base
and ghc-prim
) are caught in CI. This infrastructure leverages the utils/dump-decls
utility, a small hack to dump the exposed declarations of a package. dump-decls
is then used by three new tests: base-exports
, ghc-prim-exports
, and ghc-bignum-exports
. These will fail whenever their respective library's exports change. This gives us an easy way to catch when exposed interfaces have changed, both during code review and via automation.
Moreover, this gives us an easy-to-diff representation of the exposed core library interfaces in version control.
In an earlier version of this patch dump-decls
was a Python script which invoked ghci
but this approach ended up being rather painful due to GHCi's not-terribly-programmatically-friendly interface and Python's rather poor string-processing abilities.
Depends upon !10535 (closed).