Skip to content
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

Fix incorrect tools label for _wrapper_device_link #134

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

cloudhan
Copy link
Collaborator

Label, for example, :cuda/bin/crt/link.stub is incorrect in

if repository_ctx.path(cuda_path + "/bin/nvlink" + bin_ext).exists:
nvlink = ":cuda/bin/nvlink{}".format(bin_ext)
if repository_ctx.path(cuda_path + "/bin/crt/link.stub").exists:
link_stub = ":cuda/bin/crt/link.stub"
if repository_ctx.path(cuda_path + "/bin/bin2c" + bin_ext).exists:
bin2c = ":cuda/bin/bin2c{}".format(bin_ext)
if repository_ctx.path(cuda_path + "/bin/fatbinary" + bin_ext).exists:
fatbinary = ":cuda/bin/fatbinary{}".format(bin_ext)

Prior to #66 it was, @local_cuda//:cuda/bin/crt/link.stub which resolves to <local_cuda>/cuda/bin/crt/link.stub , but the generated BUILD file resides in <local_cuda>/toolchain/BUILD, so :cuda/bin/crt/link.stub actually resolves to <local_cuda>/toolchain/cuda/bin/crt/link.stub which does not exists.

@cloudhan
Copy link
Collaborator Author

@jsharpe I think we should have a label_helper for creating Label of @rules_cuda and @local_cuda instead of str, so that bazel can help with the remapping.

Previous try of str(Label("@rules_cuda//cuda/dummy:nvlink")) caused the conversion back to str as //cuda/dummy:nvlink instead of the canonical form @<rules_cuda_remapped_name>//cuda/dummy:nvlink in the rules_cuda repo.

@cloudhan cloudhan merged commit ab09e0d into main Aug 9, 2023
12 checks passed
@cloudhan cloudhan deleted the cloudhan/fix-wrapper-dlink-tools-label branch August 9, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant