-
-
Notifications
You must be signed in to change notification settings - Fork 54
Fix MODULE example in README #347
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
base: main
Are you sure you want to change the base?
Conversation
The previous example in README failed with error: ``` ERROR: Analysis of target '//project_template/cpp:main' failed; build aborted: The module extension defined at /home/dev/.cache/bazel/_bazel_dev/0a671fc952be90f724e819c56b1dda7d/external/rules_cuda+/cuda/extensions.bzl:42:29 does not have a tag class named toolkit, but its use is attempted at /home/dev/llm/MODULE.bazel:4:13 ``` we have to import toolkit instead of toolchain from cuda.
It seem |
@cloudhan Could you elaborate? The core example on the main branch does not seem to be correct: # MODULE.bazel
bazel_dep(name = "rules_cuda", version = "0.2.1")
cuda = use_extension("@rules_cuda//cuda:extensions.bzl", "toolchain")
cuda.toolkit(
name = "cuda",
toolkit_path = "",
)
use_repo(cuda, "cuda") Will fail: root@a94b8f573df5:/workspace# bazel run //:mybin
ERROR: Analysis of target '//:mybin' failed; build aborted: The module extension defined at /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/rules_cuda+/cuda/extensions.bzl:42:29 does not have a tag class named toolkit, but its use is attempted at /workspace/MODULE.bazel:10:13
INFO: Elapsed time: 0.300s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target But replacing to: |
You should use commit from main branch. The behavior is tested in CI and cannot be wrong. rules_cuda/tests/integration/toolchain_root/MODULE.bazel Lines 4 to 9 in 28177e2
So this is not a fix, it is a break. |
@cloudhan Thank you for the comment and the explanation. Using bazel_dep(name = "rules_cuda", version = "0.2.3")
cuda = use_extension("@rules_cuda//cuda:extensions.bzl", "toolchain")
archive_override(
module_name = "rules_cuda",
integrity = "sha256-9PahCCOjx6Kqp2PFugoJEi09fXQBSsiOCxPbQbnMnFk=",
url = "https://github.com/bazel-contrib/rules_cuda/archive/28177e2283a16b1e81c229e9bdc5610f1f3b07f7.tar.gz",
strip_prefix = "rules_cuda-28177e2283a16b1e81c229e9bdc5610f1f3b07f7",
) Do you think we could update the docs, for the I think it would help a lot with setting up the rules for the first timers. I'd be happy to submit such PR, let me how you feel about this. |
The previous example in README failed with error:
we have to import toolkit instead of toolchain from cuda.
Also took the chance to bump rules_cuda.