Skip to content

Commit

Permalink
[bazel] Move buildifier to bzlmod
Browse files Browse the repository at this point in the history
Switch from building buildifier ourselves to using the
`buildifier_prebuilt` module. This also means we don't have to build it
from source using a Go toolchain.

Signed-off-by: James Wainwright <[email protected]>
  • Loading branch information
jwnrt committed Dec 17, 2024
1 parent 4df33fb commit 8d54ddf
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 78 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
module(name = "lowrisc_opentitan")

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")

include("//third_party/rust:rust.MODULE.bazel")

Expand Down
152 changes: 152 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ crt_register_toolchains(riscv32 = True)
load("//third_party/github:repos.bzl", "github_tools_repos")
github_tools_repos()

# Go Toolchain (needed by the Buildifier linter)
load("//third_party/go:repos.bzl", "go_repos")
go_repos()
load("//third_party/go:deps.bzl", "go_deps")
go_deps()

# Various linters
load("//third_party/lint:repos.bzl", "lint_repos")
lint_repos()
Expand Down
2 changes: 1 addition & 1 deletion quality/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

load("@bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
load("@buildifier_prebuilt//:rules.bzl", "buildifier", "buildifier_test")
load("@lowrisc_misc_linters//rules:rules.bzl", "licence_test")
load("//rules:quality.bzl", "clang_format_check", "clang_format_test", "clang_tidy_rv_test", "clang_tidy_test", "html_coverage_report", "rustfmt_fix", "rustfmt_test")

Expand Down
3 changes: 0 additions & 3 deletions third_party/go/BUILD

This file was deleted.

43 changes: 0 additions & 43 deletions third_party/go/deps.bzl

This file was deleted.

17 changes: 0 additions & 17 deletions third_party/go/repos.bzl

This file was deleted.

7 changes: 0 additions & 7 deletions third_party/lint/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ def lint_repos(lowrisc_misc_linters = None):
path = "hw/ip/prim/util/vendor/google_verible_verilog_syntax_py",
)

http_archive(
name = "bazelbuild_buildtools",
sha256 = "05c3c3602d25aeda1e9dbc91d3b66e624c1f9fdadf273e5480b489e744ca7269",
strip_prefix = "buildtools-6.4.0",
url = "https://github.com/bazelbuild/buildtools/archive/refs/tags/v6.4.0.tar.gz",
)

http_archive_or_local(
name = "lowrisc_misc_linters",
local = lowrisc_misc_linters,
Expand Down
1 change: 0 additions & 1 deletion util/prep-bazel-airgapped-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ if [[ ${AIRGAPPED_DIR_CONTENTS} == "ALL" || \
${BAZELISK} fetch \
--repository_cache=${BAZEL_AIRGAPPED_DIR}/${BAZEL_CACHEDIR} \
//... \
@go_sdk//... \
@lowrisc_rv32imcb_files//... \
@local_config_platform//... \
@python3_toolchains//... \
Expand Down

0 comments on commit 8d54ddf

Please sign in to comment.