Skip to content

Commit

Permalink
upgrade buildifier (#127)
Browse files Browse the repository at this point in the history
* Use different buildifier pre-commit

The previous one didn't seem to work when I ran it locally. Maybe a
newer version of it would, but that one doesn't seem to cache the
buildifier binary which seems like it will be a lot slower.

This also updates to the latest version of buildifier

Change-Id: Ifeec1bc6a9663619b74f7cafb1be6eb2eecf9b61

* Format with newest buildifier

Change-Id: I74fb2d01863b68ad3274bb0e0e70b3350f53e50a
  • Loading branch information
garymm authored Jul 10, 2023
1 parent 039ee7b commit b9cf8ec
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions cuda/templates/BUILD.local_toolchain_clang
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 3 additions & 2 deletions cuda/templates/BUILD.local_toolchain_nvcc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
5 changes: 3 additions & 2 deletions cuda/templates/BUILD.local_toolchain_nvcc_msvc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
3 changes: 2 additions & 1 deletion examples/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit b9cf8ec

Please sign in to comment.