-
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
Pass toolchain info to the cabal_wrapper at the call site #1493
Conversation
@siggisim We're occasionally encountering build event log upload timeouts of the form:
As on this PR. These end up failing the build. A rerun typically fixes those. Have you seen these types of errors before? I'm wondering if there's something we can do in our configuration to extend the timeout or otherwise avoid these failures? |
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! Looks great.
One comment about runfiles.
haskell/private/cabal_wrapper.py.tpl
Outdated
path = r.Rlocation(toolchain_info["workspace"] + "/" + exe) | ||
if not os.path.isfile(path) and is_windows: | ||
path = r.Rlocation(toolchain_info["workspace"] + "/" + exe + ".exe") |
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.
r.Rlocation
is for discovering runfiles. However, the tools are now no longer runfiles of the cabal wrapper, but instead parameters and build inputs during the cabal build actions. I.e. the paths provided in the parameters should valid relative to the execroot as is. We'll need to make them absolute, since cabal wrapper later changes directory into the directory containing the cabal file.
It's possible that not all of the required hs and cc toolchain components are inputs to the cabal build action yet. You can use bazel aquery
on some cabal target and inspect the inputs to the HaskellLibrary|Binary
action.
@facundominguez Unrelated to the changes themselves: We have dpulls configured on rules_haskell. You can use it to stack PRs. E.g. this one depends on #1491, so you can add a comment |
The interesting thing here is that the invocation completes on our end in 3.41 minutes: But bazel seems to hang for over an hour on the github runner. This reminds me of this bazel gRPC hang issue that would cause builds to hang indefinitely and ultimately get killed: There were a lot of fixes for this that went in to bazel 4.0.0 and a couple more that went in after. I'm not 100% sure that would fix the issue, but an upgrade to 4.0.0 might be worth it if it's not too painful. The only 15s timeout I've been able to find in bazel or our code is this one, but not sure that's what we're hitting here: If the bazel upgrade doesn't fix the issue or is infeasible, let me know and I can dig in further. |
@siggisim Thank you for looking into this! That's a good point. I'll let you know if the issue still occurs on 4.0.0. |
🎉 All dependencies have been resolved ! |
13779d6
to
994894f
Compare
f592beb
to
664f4f7
Compare
664f4f7
to
847fc0f
Compare
847fc0f
to
3306f53
Compare
cdf4fe8
to
cad9476
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 pushing this through!
This should simplify configuration for cross-compilation as bazel doesn't try anymore to provide a haskell toolchain to build cabal_wrapper "for" the execution platform.
Depends on #1491