-
-
Notifications
You must be signed in to change notification settings - Fork 219
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 bzlmod #198
Conversation
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 so much for this. Unsure about how version strings work in this, but otherwise all good.
I would also be more comfortable if we immediately add CI to verify that it works as intended. |
Thank you so much @jsharpe for reviewing this. I have not been active with Bazel for a few years now and am not caught up with modules. I will leave it to you to merge this. |
@jsharpe thanks for the thorough review, is there a way you can approve GitHub workflows for this PR so that I can iterate on the tests until everything passes? EDIT: maybe you approved, it's running now |
I don't think there is unfortunately. I think its a limitation as this is your first PR against this repo. We could get this merged and use a subsquent PR to setup CI and then I don't think we'd have the same limitation? |
Sounds good, I know there are more adjustments to be made, for example all flags aren't forwarded to |
@jsharpe I excluded Bazel 5.1.0 from the CI job matrix with |
FYI, When i've had similar failures to those in CI its been due to redefinitions of the platforms repo in the WORKSPACE.bzlmod file |
Let me know if you want me to look into particular failures. https://github.com/grailbio/bazel-toolchain/actions/runs/5361378105/jobs/9727258799?pr=198 is difficult to migrate as is: The |
tests/openssl/openssl.bazel
Outdated
srcs = [("@grail_llvm_toolchain//tests/openssl:" + f) for f in CONF_FILES], | ||
outs = CONF_FILES, | ||
cmd = "\n".join([ | ||
"cp $(location @com_grail_bazel_toolchain//tests/openssl:{0}) $(location {0})".format(f) | ||
"cp $(location @grail_llvm_toolchain//tests/openssl:{0}) $(location {0})".format(f) |
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.
This name will need to be conditionally selected based on whether BZLMOD is enabled.
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.
Actually, how about renaming the original name of the repository to also match the new one with bzlmod
, it's not really a breaking change IMO. EDIT: Using repo_name
for tests is also an easier option.
Something isn't quite right with the external_test as it seems to be running the non-bzlmod version for the bzlmod testcase. Otherwise the changes look good to me - we're soo close to getting this landed. |
I switched from |
That won’t work for the 5.1.0 tests.. |
A recent change has upped the minimum supported version to 6.0.0 from 5.1.0, if it helps. |
MODULE.bazel
Outdated
@@ -0,0 +1,9 @@ | |||
module( | |||
name = "grail_llvm_toolchain", |
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.
I think it will be OK to call it simply "llvm_toolchain". I am trying to get this project moved to the bazel-contrib repo, where the simpler name would make more sense.
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.
Done! I would love to see this moved to bazel-contrib
.
So, in theory I have fixed (after breaking them) the last few CI issues, except https://github.com/grailbio/bazel-toolchain/actions/runs/6124327795/job/16624119392 that I haven't taken enough time to understand. EDIT: I excluded one more |
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.
Looks very good. Just some final nits.
Let me merge this for you now, and I can iterate on the failing tests on my side. |
Thank you so much for all your hard work on this. |
This is a fairly straightforward change that adds support for using
bazel-toolchain
withbzlmod
. We've been using this patch on a rather large checkout with success.The
llvm.toolchain
extension is only a wrapper around the existingllvm_toolchain
repository rule and supports the same attributes.For trying it out, add the following to your
MODULE.bazel
: