Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CI with multiple GHC versions #660

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

quark17
Copy link
Collaborator

@quark17 quark17 commented Dec 31, 2023

This fixes #581: test BSC not only with the GHC version used for releases (9.4.8) but also on newer GHC (such as 9.8.1). There are multiple ways to support this, but I did it by pulling out the Build and Test jobs into a separate YAML file that can be called like a function, passing in the OS version and GHC version. GitHub calls this "reusable workflows". There are separate versions for macOS and Ubuntu -- maybe we can use conditionals to write them in one file that's mostly the same except for a few places that need to differ -- but at least for now it is easy to diff the two files and confirm that they're the same where they need to be.

The top-level YAML is renamed ci.yml and it runs all OS versions with GHC 9.4.8 and then it has a job for testing the latest GHC (9.8.1) on one macOS and one Ubuntu. We could consider expanding that to more OSes or more GHC versions, if we think that adds value for the amount of time spent. (We could also start doing different checks for merges vs PRs: just a sampling of OSes for PRs, then a full matrix of OSes and GHCs once it's merged -- as a compromise.)

This PR also resolves the testsuite failures for BSC compiled with GHC 9.8.1 (issue #659). The failing tests check the GHC version and expect a failure -- understanding why the failure is still TBD. To implement this, Bluetcl was updated to record the GHC version that was used to compile and to report it via a new subcommand ::Bluetcl::version ghc, which is made available in the testsuite infrastructure. While I was there, I fixed how the infrastructure was getting the BSC version (which wasn't being used except to report it in a log file, but now it's reported readably, without extra junk lines that were accidentally captured in a regexp).

Comments on the design choices here are welcome!

Previously, the build/test jobs run over a matrix of different OS version,
but with a fixed GHC version.  Adding a second matrix variable, such as
the GHC version, would run the job over the entire matrix.  To support
running on a subset of the space, we convert the jobs into call-able
workflows, that take the OS and GHC version as inputs.

This is used to re-implement the existing matrix of OS versions with
GHC 9.4.8 and to add new testing of the latest GHC (9.8.1) on only
the latest OS versions.
The Bluetcl 'version' command now has a 'ghc' subcommand that will
print the version of GHC that the Bluespec tools were compiled with.
The subcommand 'bsc' was also added, which has the same behavior as
calling 'version' with no arguments: prints the Bluespec tools version.
The auotmated printing of help messages needed to be updated to work
for commands with optional subcommands like this.

The testsuite now has a variable 'ghc_version' which can be consulted.
The tests for bug 1490 are updated to use this, because BSC compiled
with GHC 9.8.1 has regressions that need to be handled differently.

The regexp for assigning 'bsc_version' in the testsuite was broken and
was assigning it multiple lines of text (which caused confusion when
printed in the log).  Instead of fixing the regexp, the getting of the
version is changed to use Bluetcl, to print just the version info.
@quark17 quark17 merged commit b59eb11 into B-Lang-org:main Jan 16, 2024
43 checks passed
@quark17 quark17 deleted the ci-reorg branch January 16, 2024 22:11
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.

CI should test BSC with newer GHC versions
1 participant