Building the most straightforward tests with GHC Bindist compiled with Hadrian#1842
Building the most straightforward tests with GHC Bindist compiled with Hadrian#1842GuillaumeGen wants to merge 41 commits intomasterfrom
Conversation
|
Might be worth putting the generated bindist somewhere on the internet, to avoid reference to my local file system. |
| url = "file:///home/guillaume/ExternalPrograms/ghc/_build/bindist/ghc-9.2.5-x86_64-unknown-linux.tar.xz", | ||
| sha256 = "e27724de38998dd6c3fb46ac5df4cf6818d779c1b749ea1afcd0b64e55b8217e", | ||
| strip_prefix = "ghc-9.2.5-x86_64-unknown-linux", | ||
| version = "9.2.5", |
There was a problem hiding this comment.
Some of the issues are probably unrelated to the hadrian toolchain and instead just due to the version bump. It might make sense to tackle those in a separate PR and bump the GHC version under test.
There was a problem hiding this comment.
You are completely right. Separating issues is always beneficial and it will help both review and understanding the cause of the failing tests.
| if local_python_repo_name not in native.existing_rules(): | ||
| _configure_python3_toolchain(name = local_python_repo_name) | ||
|
|
||
| def _configure_python3_toolchain_impl(repository_ctx): |
There was a problem hiding this comment.
Fine for development, but we'll want to clean this up and deduplicate with haskell/ghc_bindist.bzl.
| "%{TOOL}": hs.tools.ghci.path, | ||
| "%{ARGS}": "(" + " ".join( | ||
| "%{TOOL}": hs.tools.ghc.path, | ||
| "%{ARGS}": "--interactive (" + " ".join( |
There was a problem hiding this comment.
Does this work for other GHC versions as well? If so, great! If not, we'll have to gate this to not break the other GHC versions.
There was a problem hiding this comment.
Good question. To investigate.
| generated_bin_filegroup = define_rule( | ||
| "copy_filegroups_to_this_package", | ||
| name = "generated_bin_filegroup", | ||
| srcs = [":bin"], | ||
| ) | ||
|
|
||
| generated_lib_filegroup = define_rule( | ||
| "copy_filegroups_to_this_package", | ||
| name = "generated_lib_filegroup", | ||
| srcs = [":lib"], | ||
| ) | ||
|
|
||
| generated_docdir_filegroup = define_rule( | ||
| "copy_filegroups_to_this_package", | ||
| name = "generated_docdir_filegroup", | ||
| srcs = [":{}".format(docdir)], | ||
| ) | ||
|
|
||
| generated_include_filegroup = define_rule( | ||
| "copy_filegroups_to_this_package", | ||
| name = "generated_include_filegroup", | ||
| srcs = [":{}".format(docdir)], | ||
| ) |
There was a problem hiding this comment.
You can move these into haskell/toolchain.bzl next to _hadrian_bindist_settings as
copy_filegroups_to_this_package(
name = "generated_bin_filegroup",
srcs = [":bin"],
)
...
and the definition of copy_filegroups_to_this_package as well.
Reasons why that may be preferable:
- The
ghc.BUILD.tplis also used by the other bindist toolchains and needs to remain valid for those use cases until we can supersede them with the Hadrian one. But, the%{generated_*_filegroup}placeholders are only used for the Hadrian case. Invoking the copy-files rules withinhaskell_toolchainmacro means that these placeholders are no longer needed. - It's preferable to not mix repository rule and regular rule definitions in the same file, so that changes to the rule definition don't also invalidate the repository rule and cause unnecessary refetching. If the copy-file rule is moved into
haskell_toolchainthen the repository rules and regular rules are separated and the import ofghc_bindist_hadrian.bzlinghc.BUILD.tplis also no longer needed. - It puts both concerns into the same place: generating the settings file and placing the bindist files next to it.
There was a problem hiding this comment.
Convinced. Will do it.
1c574d7 to
171af7b
Compare
3a71f45 to
fd50666
Compare
|
Made some progress:
|
78ddc14 to
7d4f967
Compare
49346e7 to
0f69a7f
Compare
This is needed to support GHC >= 9.4
We skip the `make install` step which would wrap executables with custom scripts. For runghc it passes the GHC executable using the `-f` flag. By default `runghc` would try to execute `ghc-stage2` instead.
0313d1d to
c1e1916
Compare
This is using a locally built bindist using Hadrian.
This is currently passing 153 of the 206 tests when running
bazel test //... --keep_going.The main identified issues for failing tests are:
splitFileNameandminusFileNameas described in splitFileName and minusFileName Variable not in scope causes builds to fail #1832ghcibinary. As far as I understood, this should be moved toghc --interactiveto pass tests related to REPL.