From 964b04c97334a9e817330f6b2f6b7fb599a3565d Mon Sep 17 00:00:00 2001 From: James Wainwright Date: Tue, 9 Jul 2024 08:31:02 +0100 Subject: [PATCH] Remove WORKSPACE dependency style This reduces maintenence burden. The ARM toolchain was not working entirely correctly in the `WORKSPACE` configuration either for unknown reasons. Signed-off-by: James Wainwright --- .bazelrc | 3 +++ WORKSPACE.bazel | 23 --------------------- WORKSPACE.bzlmod | 6 ------ third_party/bazel/BUILD.bazel | 5 ----- third_party/bazel/deps.bzl | 10 --------- third_party/bazel/repos.bzl | 24 ---------------------- third_party/chromium/deps.bzl | 6 ------ third_party/toolchains_arm_gnu/BUILD.bazel | 5 ----- third_party/toolchains_arm_gnu/deps.bzl | 8 -------- third_party/toolchains_arm_gnu/repos.bzl | 22 -------------------- 10 files changed, 3 insertions(+), 109 deletions(-) delete mode 100644 WORKSPACE.bazel delete mode 100644 WORKSPACE.bzlmod delete mode 100644 third_party/bazel/BUILD.bazel delete mode 100644 third_party/bazel/deps.bzl delete mode 100644 third_party/bazel/repos.bzl delete mode 100644 third_party/chromium/deps.bzl delete mode 100644 third_party/toolchains_arm_gnu/BUILD.bazel delete mode 100644 third_party/toolchains_arm_gnu/deps.bzl delete mode 100644 third_party/toolchains_arm_gnu/repos.bzl diff --git a/.bazelrc b/.bazelrc index 234ec82..977681f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -8,3 +8,6 @@ build --workspace_status_command=util/get_workspace_status.sh # Import site-specific configuration. try-import .bazelrc-site + +# This repo no longer supports `WORKSPACE` dependencies. +common --enable_bzlmod diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel deleted file mode 100644 index 7b32707..0000000 --- a/WORKSPACE.bazel +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -workspace(name = "lowrisc_hyperdebug") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -load("//third_party/toolchains_arm_gnu:repos.bzl", "toolchains_arm_gnu_repos") -toolchains_arm_gnu_repos() -load("//third_party/toolchains_arm_gnu:deps.bzl", "toolchains_arm_gnu_deps") -toolchains_arm_gnu_deps() - -register_toolchains("@arm_none_eabi//toolchain:all") - -load("//third_party/bazel:repos.bzl", "bazel_repos") -bazel_repos() -load("//third_party/bazel:deps.bzl", "bazel_deps") -bazel_deps() - -load("//third_party/chromium:repos.bzl", "chromium_repos") -chromium_repos() -load("//third_party/chromium:deps.bzl", "chromium_deps") -chromium_deps() diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod deleted file mode 100644 index b98892a..0000000 --- a/WORKSPACE.bzlmod +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# This file is intentionally blank and overrides `WORKSPACE.bazel` when using -# Bzlmod. diff --git a/third_party/bazel/BUILD.bazel b/third_party/bazel/BUILD.bazel deleted file mode 100644 index f29bca3..0000000 --- a/third_party/bazel/BUILD.bazel +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -package(default_visibility = ["//visibility:public"]) diff --git a/third_party/bazel/deps.bzl b/third_party/bazel/deps.bzl deleted file mode 100644 index 8db2f86..0000000 --- a/third_party/bazel/deps.bzl +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -def bazel_deps(): - rules_foreign_cc_dependencies() - rules_pkg_dependencies() diff --git a/third_party/bazel/repos.bzl b/third_party/bazel/repos.bzl deleted file mode 100644 index 8999d74..0000000 --- a/third_party/bazel/repos.bzl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def bazel_repos(): - http_archive( - name = "rules_foreign_cc", - sha256 = "4b33d62cf109bcccf286b30ed7121129cc34cf4f4ed9d8a11f38d9108f40ba74", - strip_prefix = "rules_foreign_cc-0.11.1", - url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/0.11.1/rules_foreign_cc-0.11.1.tar.gz", - ) - - maybe( - http_archive, - name = "rules_pkg", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", - "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", - ], - sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", - ) diff --git a/third_party/chromium/deps.bzl b/third_party/chromium/deps.bzl deleted file mode 100644 index 92ef005..0000000 --- a/third_party/chromium/deps.bzl +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -def chromium_deps(): - pass diff --git a/third_party/toolchains_arm_gnu/BUILD.bazel b/third_party/toolchains_arm_gnu/BUILD.bazel deleted file mode 100644 index f29bca3..0000000 --- a/third_party/toolchains_arm_gnu/BUILD.bazel +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -package(default_visibility = ["//visibility:public"]) diff --git a/third_party/toolchains_arm_gnu/deps.bzl b/third_party/toolchains_arm_gnu/deps.bzl deleted file mode 100644 index 2e41d31..0000000 --- a/third_party/toolchains_arm_gnu/deps.bzl +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -load("@toolchains_arm_gnu//:deps.bzl", "arm_none_eabi_deps") - -def toolchains_arm_gnu_deps(): - arm_none_eabi_deps() diff --git a/third_party/toolchains_arm_gnu/repos.bzl b/third_party/toolchains_arm_gnu/repos.bzl deleted file mode 100644 index 9714ef0..0000000 --- a/third_party/toolchains_arm_gnu/repos.bzl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright lowRISC contributors. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def toolchains_arm_gnu_repos(): - http_archive( - name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], - sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", - strip_prefix = "rules_cc-0.0.9", - ) - - http_archive( - name = "toolchains_arm_gnu", - urls = [ - "https://github.com/hexdae/toolchains_arm_gnu/releases/download/v1.0.2/toolchains_arm_gnu-v1.0.2.tar.gz", - ], - strip_prefix = "toolchains_arm_gnu-1.0.2", - sha256 = "62e4a770230aebcf5f62d63c6d221d2ef5969dd3188a0cd073e55ce61a5fab50", - )