Skip to content

Commit

Permalink
[bazel] Migrate rules_python and others to bzlmod
Browse files Browse the repository at this point in the history
Signed-off-by: James Wainwright <[email protected]>
  • Loading branch information
jwnrt committed Dec 16, 2024
1 parent 927278a commit 37938d1
Show file tree
Hide file tree
Showing 9 changed files with 268 additions and 120 deletions.
12 changes: 12 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ module(name = "lowrisc_opentitan")
bazel_dep(name = "bazel_skylib", version = "1.5.0")

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

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

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

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

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

bitstreams_repo = use_repo_rule("//rules:bitstreams.bzl", "bitstreams_repo")

bitstreams_repo(name = "bitstreams")
276 changes: 256 additions & 20 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

34 changes: 0 additions & 34 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@

workspace(name = "lowrisc_opentitan")

# Python Toolchain + PIP Dependencies
load("//third_party/python:repos.bzl", "python_repos")
python_repos()
load("//third_party/python:deps.bzl", "python_deps")
python_deps()
load("//third_party/python:pip.bzl", "pip_deps")
pip_deps()
load("@ot_python_deps//:requirements.bzl", install_ot_python_deps="install_deps")
install_ot_python_deps()

# Google/Bazel dependencies. This needs to be after Python initialization
# so that our preferred python configuration takes precedence.
load("//third_party/google:repos.bzl", "google_repos")
Expand Down Expand Up @@ -48,22 +38,11 @@ go_deps()
# Various linters
load("//third_party/lint:repos.bzl", "lint_repos")
lint_repos()
load("//third_party/lint:deps.bzl", "lint_deps")
lint_deps()
load("@lowrisc_misc_linters_pip//:requirements.bzl", install_lowrisc_lint_python_deps="install_deps")
install_lowrisc_lint_python_deps()

# Lychee link checker.
load("//third_party/lychee:repos.bzl", "lychee_repos")
lychee_repos()

load("//third_party/google:repos.bzl", "fuzzing_repos")
fuzzing_repos()
load("//third_party/google:fuzzing_deps.bzl", "fuzzing_deps")
fuzzing_deps()
load("@fuzzing_py_deps//:requirements.bzl", install_fuzzing_python_deps="install_deps")
install_fuzzing_python_deps()

# Rust Toolchain + crates.io Dependencies
load("//third_party/rust:repos.bzl", "rust_repos")
rust_repos()
Expand All @@ -72,15 +51,6 @@ rust_repos()
load("//third_party/shellcheck:repos.bzl", "shellcheck_repos")
shellcheck_repos()

# Tock dependencies.
load("//third_party/tock:repos.bzl", tock_repos="tock_repos")
tock_repos(
# For developing tock/libtock along side OpenTitan, set these parameters
# to your local checkout of tock and libtock-rs respectively.
#tock = "../tock",
#libtock = "../libtock-rs",
)

# OpenOCD
load("//third_party/openocd:repos.bzl", "openocd_repos")
openocd_repos()
Expand Down Expand Up @@ -127,10 +97,6 @@ wycheproof_repos()
load("//third_party/sphincsplus:repos.bzl", "sphincsplus_repos")
sphincsplus_repos()

# Bitstreams from https://storage.googleapis.com/opentitan-bitstreams/
load("//rules:bitstreams.bzl", "bitstreams_repo")
bitstreams_repo(name = "bitstreams")

# CBOR reader & writer from open-dice
load("//third_party/open-dice:repos.bzl", "open_dice_repos")
open_dice_repos()
Expand Down
10 changes: 0 additions & 10 deletions third_party/google/fuzzing_deps.bzl

This file was deleted.

8 changes: 0 additions & 8 deletions third_party/google/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,3 @@ def google_repos(
sha256 = "2a4d07cd64b0719b39a7c12218a3e507672b82a97b98c6a89d38565894cf7c51",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/refs/tags/0.9.0.tar.gz",
)

def fuzzing_repos():
http_archive_or_local(
name = "rules_fuzzing",
sha256 = "e6bc219bfac9e1f83b327dd090f728a9f973ee99b9b5d8e5a184a2732ef08623",
strip_prefix = "rules_fuzzing-0.5.2",
urls = ["https://github.com/bazelbuild/rules_fuzzing/releases/download/v0.5.2/rules_fuzzing-0.5.2.zip"],
)
10 changes: 0 additions & 10 deletions third_party/lint/deps.bzl

This file was deleted.

13 changes: 0 additions & 13 deletions third_party/python/deps.bzl

This file was deleted.

12 changes: 0 additions & 12 deletions third_party/python/pip.bzl

This file was deleted.

13 changes: 0 additions & 13 deletions third_party/python/repos.bzl

This file was deleted.

0 comments on commit 37938d1

Please sign in to comment.