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
9 changes: 9 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ maven.artifact(
)

# Used both by XLS and rules_hdl.
bazel_dep(name = "eigen", version = "4.0.0-20241125.bcr.2")
bazel_dep(name = "rules_pkg", version = "1.2.0")

# Workaround suggested by a Bazel team member; only needed for WORKSPACE to work correctly.
Expand All @@ -127,6 +128,14 @@ proto_bazel_features(name = "proto_bazel_features")
bazel_dep(name = "rules_bison", version = "0.3")
bazel_dep(name = "rules_flex", version = "0.3")
bazel_dep(name = "rules_m4", version = "0.3")
bazel_dep(name = "swig", version = "4.3.0")

# TODO: rigge - Remove this override once the patch is in the main repo.
single_version_override(
module_name = "swig",
patch_strip = 1,
patches = ["//dependency_support/rules_hdl:swig_bzlmod.patch"],
)

# Dev dependencies
bazel_dep(name = "fuzztest", version = "20250805.0", dev_dependency = True, repo_name = "com_google_fuzztest")
Expand Down
3 changes: 2 additions & 1 deletion MODULE.bazel.lock

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

26 changes: 26 additions & 0 deletions dependency_support/rules_hdl/rename_eigen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel b/dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel
index ca6a2f7..b63fd7a 100644
--- dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel
+++ dependency_support/com_github_yosyshq_nextpnr/bundled.BUILD.bazel
@@ -42,7 +42,7 @@ DEPS = [
"@boost//:python",
"@boost//:system",
"@boost//:thread",
- "@eigen//:eigen3",
+ "@eigen//:eigen",
"@rules_python//python/cc:current_py_cc_headers",
]

diff --git a/dependency_support/org_theopenroadproject/build_helper.bzl b/dependency_support/org_theopenroadproject/build_helper.bzl
index fd4259c..2b58b21 100644
--- dependency_support/org_theopenroadproject/build_helper.bzl
+++ dependency_support/org_theopenroadproject/build_helper.bzl
@@ -299,7 +299,7 @@ OPENROAD_LIBRARY_DEPS = [
"@boost//:property_tree",
"@boost//:stacktrace",
"@boost//:thread",
- "@eigen//:eigen3",
+ "@eigen//:eigen",
"@com_github_quantamhd_lemon//:lemon",
"@org_llvm_openmp//:openmp",
"@com_github_gabime_spdlog//:spdlog",
29 changes: 29 additions & 0 deletions dependency_support/rules_hdl/rename_swig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
index b5c1242..7a43e4f 100644
--- dependency_support/org_theopenroadproject/tcl_wrap_cc.bzl
+++ dependency_support/org_theopenroadproject/tcl_wrap_cc.bzl
@@ -85,6 +85,9 @@ def _tcl_wrap_cc_impl(ctx):
outputs = [output_file],
inputs = src_inputs,
arguments = [args],
+ env = {
+ "SWIG_LIB": "external/swig~/Lib",
+ },
- tools = ctx.files._swig,
+ tools = ctx.files._swig_lib,
executable = ([file for file in ctx.files._swig if file.basename == "swig"][0]),
)
@@ -135,8 +138,13 @@ tcl_wrap_cc = rule(
"swig_options": attr.string_list(
doc = "args to pass directly to the swig binary",
),
+ "_swig_lib": attr.label(
+ default = "@swig//:lib_tcl",
+ allow_files = True,
+ cfg = "exec",
+ ),
"_swig": attr.label(
- default = "@org_swig//:swig_stable",
+ default = "@swig//:swig",
allow_files = True,
cfg = "exec",
),
42 changes: 42 additions & 0 deletions dependency_support/rules_hdl/rules_hdl_deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/dependency_support/dependency_support.bzl b/dependency_support/dependency_support.bzl
index 5f559a7..310c40f 100644
--- dependency_support/dependency_support.bzl
+++ dependency_support/dependency_support.bzl
@@ -32,10 +32,6 @@ load("//dependency_support/com_github_westes_flex:com_github_westes_flex.bzl", "
load("//dependency_support/com_github_yosyshq_nextpnr:com_github_yosyshq_nextpnr.bzl", "com_github_yosyshq_nextpnr")
load("//dependency_support/com_github_yosyshq_prjtrellis:com_github_yosyshq_prjtrellis.bzl", "com_github_yosyshq_prjtrellis")
load("//dependency_support/com_github_yosyshq_prjtrellis_db:com_github_yosyshq_prjtrellis_db.bzl", "com_github_yosyshq_prjtrellis_db")
-load("//dependency_support/com_google_absl:com_google_absl.bzl", "com_google_absl")
-load("//dependency_support/com_google_googletest:com_google_googletest.bzl", "com_google_googletest")
-load("//dependency_support/com_google_ortools:com_google_ortools.bzl", "com_google_ortools")
-load("//dependency_support/com_google_protobuf:com_google_protobuf.bzl", "com_google_protobuf")
load("//dependency_support/com_google_skywater_pdk:com_google_skywater_pdk.bzl", "com_google_skywater_pdk")
load("//dependency_support/com_icarus_iverilog:com_icarus_iverilog.bzl", "com_icarus_iverilog")
load("//dependency_support/com_opencircuitdesign_magic:com_opencircuitdesign_magic.bzl", "com_opencircuitdesign_magic")
@@ -55,7 +51,6 @@ load("//dependency_support/org_nixos_patchelf:org_nixos_patchelf.bzl", "org_nixo
load("//dependency_support/org_pcre_ftp:org_pcre_ftp.bzl", "org_pcre_ftp")
load("//dependency_support/org_sourceware_bzip2:org_sourceware_bzip2.bzl", "org_sourceware_bzip2")
load("//dependency_support/org_sourceware_libffi:org_sourceware_libffi.bzl", "org_sourceware_libffi")
-load("//dependency_support/org_swig:org_swig.bzl", "org_swig")
load("//dependency_support/org_theopenroadproject:org_theopenroadproject.bzl", "org_theopenroadproject")
load("//dependency_support/org_theopenroadproject_asap7_pdk_r1p7:org_theopenroadproject_asap7_pdk_r1p7.bzl", "org_theopenroadproject_asap7_pdk_r1p7")
load("//dependency_support/org_theopenroadproject_asap7sc6t_26:org_theopenroadproject_asap7sc6t_26.bzl", "org_theopenroadproject_asap7sc6t_26")
@@ -86,10 +81,6 @@ def dependency_support(register_toolchains = True):
com_github_yosyshq_nextpnr()
com_github_yosyshq_prjtrellis()
com_github_yosyshq_prjtrellis_db()
- com_google_absl()
- com_google_googletest()
- com_google_protobuf()
- com_google_ortools()
com_google_skywater_pdk()
com_icarus_iverilog()
com_opencircuitdesign_magic()
@@ -109,7 +100,6 @@ def dependency_support(register_toolchains = True):
org_pcre_ftp()
org_sourceware_bzip2()
org_sourceware_libffi()
- org_swig()
org_theopenroadproject()
org_theopenroadproject_asap7_pdk_r1p7()
org_theopenroadproject_asap7sc6t_26()
20 changes: 20 additions & 0 deletions dependency_support/rules_hdl/swig_bzlmod.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/BUILD b/BUILD
index a2b99dc83..d5e6f7a8b 100644
--- a/BUILD
+++ b/BUILD
@@ -161,3 +161,15 @@ filegroup(
licenses = ["notice"], # simple notice license for Lib/
visibility = ["//visibility:public"],
)
+
+filegroup(
+ name = "lib_tcl",
+ srcs = glob([
+ "Lib/*",
+ "Lib/tcl/*",
+ "Lib/std/*",
+ "Lib/typemaps/*",
+ ]),
+ licenses = ["notice"], # simple notice license for Lib/
+ visibility = ["//visibility:public"],
+)
11 changes: 8 additions & 3 deletions dependency_support/rules_hdl/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@ def repo():
sha256 = "fd9e99f6ccb9e946755f9bc444abefbdd1eedb32c372c56dcacc7eb486aed178",
)

# Current as of 2025-11-07
git_hash = "d17bb1646fa36e6172b349cc59af8d31a427cf23"
# Current as of 2026-01-26
git_hash = "af93b9a5893e482f9959ce351834960e09a45a7b"

maybe(
http_archive,
name = "rules_hdl",
integrity = "sha256-aWjEZVtMMTiO80C3a2c3WBtKJA0WzUgUzqMkA0QLsjs=",
integrity = "sha256-qphNuOxqovqNpGtk7sKxclWLPtxnoPm8ViyT+hiMaiw=",
strip_prefix = "bazel_rules_hdl-%s" % git_hash,
urls = [
"https://github.com/hdl/bazel_rules_hdl/archive/%s.tar.gz" % git_hash,
],
patches = [
Label("@//dependency_support/rules_hdl:rules_hdl_deps.patch"),
Label("@//dependency_support/rules_hdl:rename_eigen.patch"),
Label("@//dependency_support/rules_hdl:rename_swig.patch"),
],
)
6 changes: 3 additions & 3 deletions xls/dslx/stdlib/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ cc_test(
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/status",
"@com_google_absl//absl/types:span",
"@eigen//:eigen3",
"@eigen",
],
)

Expand Down Expand Up @@ -546,7 +546,7 @@ cc_test(
"@com_google_absl//absl/log",
"@com_google_absl//absl/random",
"@com_google_absl//absl/status:statusor",
"@eigen//:eigen3",
"@eigen",
"@googletest//:gtest",
] + [":bfloat16_" + top + "_jit_wrapper" for top in BFLOAT16_CMP_TOPS],
)
Expand Down Expand Up @@ -582,7 +582,7 @@ cc_test(
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/random",
"@com_google_absl//absl/status:statusor",
"@eigen//:eigen3",
"@eigen",
"@googletest//:gtest",
],
)