-
Notifications
You must be signed in to change notification settings - Fork 81
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 ghc version to CI matrix for bindists #1923
Conversation
4ad86a7
to
ccd7a43
Compare
83e19de
to
87e7f3e
Compare
6288a69
to
734ffd4
Compare
907d710
to
eb58ed1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for figuring this out, from what I saw that was not easy!
I left a few small comments, and questions for clarification. My main concern is any potential impact on downstream users, or rather to what extent the impact is confined to our CI.
haskell/private/ghc_ci.bzl
Outdated
print("Using GHC version {} from env variable `GHC_VERSION`".format(ghc_version)) | ||
|
||
repository_ctx.file("BUILD") | ||
repository_ctx.file("ghc_version.bzl", content = "GHC_VERSION = {}".format(repr(ghc_version))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if $GHC_VERSION
is unset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case the file will contain GHC_VERSION = None
. This will cause the default GHC version to be used.
extensions/ghc_version.bzl
Outdated
@@ -0,0 +1,15 @@ | |||
""" Module extension which configures the GHC version""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC it configures the default version. But, if a MODULE.bazel
file provides a specific version to the bindist module extension, then it will override this env-var, correct? If so, the docs should be clearer on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, this will only effect the default GHC version used, and only for rules_haskell and rules_haskell_tests. Other modules are not effected at all. They will always just get the default GHC version if using version = None
and the specified version otherwise.
I have added clearer docs to this file.
build_file_content = """ | ||
if GHC_VERSION and GHC_VERSION.startswith("9.4."): | ||
http_archive( | ||
name = "Cabal", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is @Cabal
all used? From what I can tell it's mostly used for test dependencies and for the worker. So, it shouldn't directly affect users of rules_haskell, correct?
Side note, I noticed that some test-dependencies in rules_haskell's MODULE.bazel
, e.g. some stack_snapshot
s, are not marked as dev-dependencies. It's out of scope for this PR, but something we should fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is
@Cabal
all used? From what I can tell it's mostly used for test dependencies and for the worker. So, it shouldn't directly affect users of rules_haskell, correct?
Yes.
Side note, I noticed that some test-dependencies in rules_haskell's
MODULE.bazel
, e.g. somestack_snapshot
s, are not marked as dev-dependencies. It's out of scope for this PR, but something we should fix.
Agreed, and I already tried that (setting dev_dependency = True
) but that failed with some wild error later, since rules_haskell_tests depended on it.
http_archive( | ||
name = "Cabal", | ||
build_file_content = """ | ||
if GHC_VERSION and GHC_VERSION.startswith("9.4."): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long as it's only for our CI, I'm fine with this approach. Generally speaking, a better route would be if we could figure out how to select
based on resolved GHC version and then use select to switch to the correct versions. But, that seems quite difficult in this case.
@Mergifyio rebase |
This makes the default GHC version publicly accessible and introduces a new repository which uses the default GHC version if not already defined.
This wrapper adds the `bin` folder of the cc toolchain from GHC's bindist to the `PATH` so that the protoc.exe is able to find its runtime DLLs, e.g. libc++.dll. Note, using a `sh_binary` rule with a cmd script does not create an extra executable contrary to using a Bash script.
These are not needed, since `executable = True` already demands a single executable file
We need to be able to use `--proto_compiler` to specify a custom protoc executable / script. The needed "proto_compiler" configuration field has been introduced in Bazel 5.3.0.
It is always the first one.
✅ Branch has been successfully rebased |
@Mergifyio refresh |
✅ Pull request refreshed |
Add ghc version to CI matrix for bindists
This PR adds a
ghc
dimension to the CI build matrix for the "Build & Test - bindist" job and runs jobs for GHC 9.2.5 as well as GHC 9.4.5.Also, we have to bump the minimal supported Bazel version to 5.3.0 in this PR, since we use an API that was introduced in that version and gating it with a version check was tripping up the Stardoc documentation generation (e.g. see here).
Fixes #1933 and fixes #1900