Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Remove once #5066 is resolved.
common --enable_workspace
common --noenable_workspace
# Enable once #5066 is resolved.
common --noenable_bzlmod
common --enable_bzlmod

# Use C++20.
build --cxxopt=-std=c++20
Expand Down
110 changes: 110 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "rules_foreign_cc", version = "0.10.1")
bazel_dep(name = "rules_python", version = "0.29.0")
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "com_google_absl")
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf")
bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest")
bazel_dep(name = "nlohmann_json", version = "3.11.3")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_license", version = "0.0.8")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_go", version = "0.46.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "grpc", version = "1.66.0.bcr.3", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "z3", version = "4.15.2", repo_name = "com_github_z3prover_z3")

# Bison/Flex/M4
bazel_dep(name = "rules_bison", version = "0.4")
git_override(
module_name = "rules_bison",
remote = "https://github.com/jmillikin/rules_bison",
commit = "76287be70197dc91152d20cead288d336a39a7cf",
)

bazel_dep(name = "rules_flex", version = "0.4")
git_override(
module_name = "rules_flex",
remote = "https://github.com/jmillikin/rules_flex",
commit = "c58ff426f39fd4ca328363fa3148b470d59ae3f4",
)

bazel_dep(name = "rules_m4", version = "0.2.3")
git_override(
module_name = "rules_m4",
remote = "https://github.com/jmillikin/rules_m4",
commit = "52548b8ff716148d2c6e27bcedae1c1775350502",
)

# Inja
inja_ext = use_extension("//:repositories.bzl", "inja_repo")
use_repo(inja_ext, "inja")

# P4C Extension (local)
p4c_ext = use_extension("//:repositories.bzl", "p4c_ext_repo")
use_repo(p4c_ext, "com_github_p4lang_p4c_extension")

git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Boost
http_archive(
name = "boost",
build_file = "//:bazel/boost/boost.BUILD",
strip_prefix = "boost-1.84.0",
url = "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz",
sha256 = "4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95",
)

# Boost Deps
http_archive(
name = "zlib",
build_file = "//:bazel/boost/zlib.BUILD",
url = "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz",
sha256 = "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e",
strip_prefix = "zlib-1.3",
)

http_archive(
name = "org_bzip_bzip2",
build_file = "//:bazel/boost/bzip2.BUILD",
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
strip_prefix = "bzip2-1.0.8",
urls = [
"https://mirror.bazel.build/sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
"https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
],
)

http_archive(
name = "org_lzma_lzma",
build_file = "//:bazel/boost/lzma.BUILD",
url = "https://src.fedoraproject.org/lookaside/extras/xz/xz-5.4.6.tar.gz/sha512/b08a61d8d478d3b4675cb1ddacdbbd98dc6941a55bcdd81a28679e54e9367d3a595fa123ac97874a17da571c1b712e2a3e901c2737099a9d268616a1ba3de497/xz-5.4.6.tar.gz",
sha256 = "aeba3e03bf8140ddedf62a0a367158340520f6b384f75ca6045ccc6c0d43fd5c",
strip_prefix = "xz-5.4.6",
)

http_archive(
name = "com_github_facebook_zstd",
build_file = "//:bazel/boost/zstd.BUILD",
url = "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz",
sha256 = "8c29e06cf42aacc1eafc4077ae2ec6c6fcb96a626157e0593d5e82a34fd403c1",
strip_prefix = "zstd-1.5.6",
)

# P4Runtime
bazel_dep(name = "com_github_p4lang_p4runtime", version = "0.0.0")
archive_override(
module_name = "com_github_p4lang_p4runtime",
urls = ["https://github.com/p4lang/p4runtime/archive/ec4eb5ef70dbcbcbf2f8357a4b2b8c2f218845a5.tar.gz"],
strip_prefix = "p4runtime-ec4eb5ef70dbcbcbf2f8357a4b2b8c2f218845a5/proto",
patches = ["//:bazel/p4runtime.patch"],
patch_strip = 1,
)

# Buildifier
http_archive(
name = "buildifier_prebuilt",
integrity = "sha256-f4W2iKS1WOLZCZNAz7UQunF5+ClFT7qEI3C8z/tn1sw=",
strip_prefix = "buildifier-prebuilt-7.3.1",
urls = ["https://github.com/keith/buildifier-prebuilt/archive/7.3.1.tar.gz"],
)
Loading