diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b963958..c03ca647 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,11 +11,10 @@ default_stages: [commit] repos: # Check formatting and lint for starlark code - - repo: https://github.com/keith/pre-commit-buildifier - rev: 4.0.1.1 + - repo: https://github.com/garymm/bazel-buildifier-pre-commit-hooks + rev: v6.1.2 hooks: - - id: buildifier - # - id: buildifier-lint + - id: bazel-buildifier # Enforce that commit messages allow for later changelog generation - repo: https://github.com/commitizen-tools/commitizen rev: v2.18.0 diff --git a/cuda/templates/BUILD.local_toolchain_clang b/cuda/templates/BUILD.local_toolchain_clang index 1ef17940..903f6377 100644 --- a/cuda/templates/BUILD.local_toolchain_clang +++ b/cuda/templates/BUILD.local_toolchain_clang @@ -2,19 +2,19 @@ load( "@rules_cuda//cuda:defs.bzl", - "cuda_toolkit", "cuda_toolchain", + "cuda_toolkit", cuda_toolchain_config = "cuda_toolchain_config_clang", ) cuda_toolkit( name = "cuda-toolkit", - path = "%{cuda_path}", - version = "%{cuda_version}", - nvlink = "%{nvlink_label}", - link_stub = "%{link_stub_label}", bin2c = "%{bin2c_label}", fatbinary = "%{fatbinary_label}", + link_stub = "%{link_stub_label}", + nvlink = "%{nvlink_label}", + path = "%{cuda_path}", + version = "%{cuda_version}", ) cuda_toolchain_config( diff --git a/cuda/templates/BUILD.local_toolchain_nvcc b/cuda/templates/BUILD.local_toolchain_nvcc index fde9c3b7..4c18136e 100644 --- a/cuda/templates/BUILD.local_toolchain_nvcc +++ b/cuda/templates/BUILD.local_toolchain_nvcc @@ -20,8 +20,9 @@ cuda_toolkit( cuda_toolchain_config( name = "nvcc-local-config", cuda_toolkit = ":cuda-toolkit", - nvcc_version_major = %{nvcc_version_major}, - nvcc_version_minor = %{nvcc_version_minor}, + # int("%{foo}") instead of %{foo} to make the file valid syntactically. + nvcc_version_major = int("%{nvcc_version_major}"), + nvcc_version_minor = int("%{nvcc_version_minor}"), toolchain_identifier = "nvcc", ) diff --git a/cuda/templates/BUILD.local_toolchain_nvcc_msvc b/cuda/templates/BUILD.local_toolchain_nvcc_msvc index dee4ba5a..7309e18e 100644 --- a/cuda/templates/BUILD.local_toolchain_nvcc_msvc +++ b/cuda/templates/BUILD.local_toolchain_nvcc_msvc @@ -21,8 +21,9 @@ cuda_toolchain_config( name = "nvcc-local-config", cuda_toolkit = ":cuda-toolkit", msvc_env_tmp = "%{env_tmp}", - nvcc_version_major = %{nvcc_version_major}, - nvcc_version_minor = %{nvcc_version_minor}, + # int("%{foo}") instead of %{foo} to make the file valid syntactically. + nvcc_version_major = int("%{nvcc_version_major}"), + nvcc_version_minor = int("%{nvcc_version_minor}"), toolchain_identifier = "nvcc", ) diff --git a/examples/WORKSPACE.bazel b/examples/WORKSPACE.bazel index 3f9cfe2d..f79eaaf7 100644 --- a/examples/WORKSPACE.bazel +++ b/examples/WORKSPACE.bazel @@ -13,6 +13,7 @@ local_repository( # you should fetch it *before* calling this. load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies") + rules_cuda_dependencies() -register_detected_cuda_toolchains() +register_detected_cuda_toolchains()