Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cuda/private/templates/BUILD.cuda_disabled
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ filegroup(
name = "compiler_deps",
srcs = [],
)

cc_library(
name = "cuda_runtime",
)
12 changes: 5 additions & 7 deletions tests/integration/test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ pushd "$this_dir/toolchain_none"
ERR=$(bazel build //:optinally_use_rule --@rules_cuda//cuda:enable=True 2>&1 || true)
if ! [[ $ERR == *"didn't satisfy constraint"*"valid_toolchain_is_configured"* ]]; then exit 1; fi

# use library fails because the library file does not exist
ERR=$(bazel build //:use_library 2>&1 || true)
if ! [[ $ERR =~ "target 'cuda_runtime' not declared in package" ]]; then exit 1; fi
if ! [[ $ERR =~ "ERROR: Analysis of target '//:use_library' failed" ]]; then exit 1; fi
# use library should analyse build successfully (empty cuda_runtime target exists)
bazel build //:use_library

# use rule fails because rules_cuda depends non-existent cuda toolkit
# use rule analyses correctly but fails during compilation because nvcc doesn't exist
ERR=$(bazel build //:use_rule 2>&1 || true)
if ! [[ $ERR =~ "target 'cuda_runtime' not declared in package" ]]; then exit 1; fi
if ! [[ $ERR =~ "ERROR: Analysis of target '//:use_rule' failed" ]]; then exit 1; fi
if ! [[ $ERR =~ "No such file or directory" ]]; then exit 1; fi
if ! [[ $ERR =~ "ERROR: Build did NOT complete successfully" ]]; then exit 1; fi

bazel clean && bazel shutdown
popd
Expand Down
Loading