bazel-contrib / rules_cuda

Starlark implementation of bazel rules for CUDA.
https://bazel-contrib.github.io/rules_cuda/
MIT License
92 stars 43 forks source link

test: workaround label resolving with bzlmod #263

Closed cloudhan closed 3 months ago

cloudhan commented 3 months ago

Partially fix test failures triggered by #262

Workaround utilities test when bzlmod is enabled:

ERROR: Traceback (most recent call last):
    File "/home/runner/work/rules_cuda/rules_cuda/tests/flag/flag_validation_test.bzl", line 98, column 61, in <toplevel>
        cuda_library_sm61_flag_test = _create_cuda_library_flag_test(config_settings_sm61)
    File "/home/runner/work/rules_cuda/rules_cuda/tests/flag/flag_validation_test.bzl", line 63, column 29, in _create_cuda_library_flag_test
        return analysistest.make(
    File "/home/runner/.cache/bazel/_bazel_runner/c7158fce5becee297c399541ca8c3db4/external/bazel_skylib~/lib/unittest.bzl", line [28](https://github.com/bazel-contrib/rules_cuda/actions/runs/10286317527/job/28467427384?pr=262#step:6:29)5, column 51, in _make_analysis_test
        test_transition = analysis_test_transition(
Error in analysis_test_transition: invalid transition output '@@[unknown repo '' requested from @@bazel_skylib~]//cuda:archs': no repo visible as @ from repository '@@bazel_skylib~'
ERROR: error loading package under directory 'tests': error loading package 'tests/flag': initialization of module 'tests/flag/flag_validation_test.bzl' failed
cloudhan commented 3 months ago

New error popup as expected:

ERROR: Analysis of target '//tests/flag:cuda_library_c_dbg_flag_test' failed; build aborted: module extension "toolchain" from "//cuda:extensions.bzl" does not generate repository "local_cuda", yet it is imported as "local_cuda" in the usage at /home/runner/work/rules_cuda/rules_cuda/MODULE.bazel:10:21
github-actions[bot] commented 3 months ago

Integration Build: succeeded ✅ https://github.com/bazel-contrib/rules_cuda/actions/runs/10287083056