-
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
Building the most straightforward tests with GHC Bindist compiled with Hadrian #1842
base: master
Are you sure you want to change the base?
Conversation
Might be worth putting the generated bindist somewhere on the internet, to avoid reference to my local file system. |
WORKSPACE
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for development, but we'll want to clean this up and deduplicate with haskell/ghc_bindist.bzl
.
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.
Right.
haskell/repl.bzl
Outdated
"%{TOOL}": hs.tools.ghci.path, | ||
"%{ARGS}": "(" + " ".join( | ||
"%{TOOL}": hs.tools.ghc.path, | ||
"%{ARGS}": "--interactive (" + " ".join( |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. To investigate.
haskell/ghc_bindist_hadrian.bzl
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.tpl
is 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_toolchain
macro 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_toolchain
then the repository rules and regular rules are separated and the import ofghc_bindist_hadrian.bzl
inghc.BUILD.tpl
is 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
splitFileName
andminusFileName
as described in splitFileName and minusFileName Variable not in scope causes builds to fail #1832ghci
binary. As far as I understood, this should be moved toghc --interactive
to pass tests related to REPL.