| """rules_vunit""" |
| |
| module( |
| name = "rules_vunit", |
| version = "0.5.0", |
| ) |
| |
| bazel_dep(name = "bazel_skylib", version = "1.8.2") |
| bazel_dep(name = "rules_verilog", version = "1.4.1") |
| bazel_dep(name = "rules_vhdl", version = "0.4.1") |
| bazel_dep(name = "platforms", version = "1.0.0") |
| bazel_dep(name = "rules_python", version = "1.7.0") |
| bazel_dep(name = "rules_venv", version = "0.23.0") |
| bazel_dep(name = "rules_cc", version = "0.2.4") |
| |
| bazel_dep(name = "ghdl", version = "6.0.0.bcr.2", dev_dependency = True) |
| bazel_dep(name = "nvc", version = "1.21.0", dev_dependency = True) |
| bazel_dep(name = "rules_req_compile", version = "1.1.0", dev_dependency = True) |
| bazel_dep(name = "rules_rust_mdbook", version = "0.69.0", dev_dependency = True) |
| bazel_dep(name = "rules_shell", version = "0.7.1", dev_dependency = True) |
| bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True, repo_name = "io_bazel_stardoc") |
| |
| register_toolchains( |
| "//vunit/toolchain", |
| dev_dependency = True, |
| ) |
| |
| # `vunit_hdl` is pulled in **only** for rules_vunit's own in-tree tests |
| # (`//tests/ghdl/...` + `//vunit/toolchain`). Downstream consumers are |
| # expected to acquire vunit_hdl themselves — common patterns are: |
| # * `http_archive(... build_file = "@rules_vunit//vunit/private:BUILD.vunit_hdl.bazel")` |
| # against the PyPI sdist, the way `examples/simple` does it; or |
| # * a `rules_python` `pip.parse` setup if you already maintain one. |
| # rules_req_compile can't be used: VUnit ships sdist-only and its |
| # `setup.py` triggers a circular import that defeats req-compile's |
| # metadata extraction. |
| http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| http_archive( |
| name = "vunit_hdl", |
| build_file = "//vunit/private:BUILD.vunit_hdl.bazel", |
| dev_dependency = True, |
| # Three carry patches against VUnit 4.7.1; each has a per-file |
| # header documenting the failure mode it closes and a |
| # "drop this patch when upstream takes a fix" note. |
| # * `llvm_jit_backend` — teach VUnit's GHDL backend detector |
| # about the `llvm-jit` backend (BCR `ghdl@6.0.0.bcr.1`'s |
| # non-x86_64 build emits a `--version` line VUnit's |
| # `determine_backend` regex set doesn't recognize). |
| # * `verilog_path` — drop `.resolve()` from `VERILOG_PATH` / |
| # `VHDL_PATH` so VUnit stays inside the action's runfiles |
| # sandbox; combined with the driver's `+`-stripping helper, |
| # this closes the Aldec-vlog `VCP1000 Cannot open file |
| # vunit_defines.svh` failure under bzlmod's `+http_archive+` |
| # external-repo layout. |
| # * `py_typed` — add PEP 561 marker so mypy consumes VUnit's |
| # shipped type hints instead of flagging every consumer |
| # `from vunit import ...` as `import-untyped`. |
| patch_args = ["-p1"], |
| patches = [ |
| "//vunit/private:vunit_hdl_llvm_jit_backend.patch", |
| "//vunit/private:vunit_hdl_verilog_path.patch", |
| "//vunit/private:vunit_hdl_py_typed.patch", |
| ], |
| sha256 = "3a6f0e19eaa1e79899676aa4cdce95ec8f649002362c4458c3e0412d0f7d0912", |
| strip_prefix = "vunit_hdl-4.7.1", |
| urls = ["https://files.pythonhosted.org/packages/18/a4/b8a53f6ba286cc5b37199859a65583b4a574be68700fd35f7debe99231c0/vunit_hdl-4.7.1.tar.gz"], |
| ) |
| |
| requirements = use_extension("@rules_req_compile//extensions:python.bzl", "requirements", dev_dependency = True) |
| requirements.parse( |
| name = "vunit_pip_deps", |
| requirements_locks = { |
| "//tools/requirements:requirements_linux_aarch64.txt": "//tools/constraints:linux-aarch64", |
| "//tools/requirements:requirements_linux_x86_64.txt": "//tools/constraints:linux-x86_64", |
| "//tools/requirements:requirements_macos_aarch64.txt": "//tools/constraints:macos-aarch64", |
| "//tools/requirements:requirements_windows_x86_64.txt": "//tools/constraints:windows-x86_64", |
| }, |
| ) |
| use_repo(requirements, "vunit_pip_deps") |
| |
| register_toolchains( |
| "//tools/toolchains:black_toolchain", |
| "//tools/toolchains:isort_toolchain", |
| "//tools/toolchains:mypy_toolchain", |
| "//tools/toolchains:pylint_toolchain", |
| "//tools/toolchains:pytest_toolchain", |
| dev_dependency = True, |
| ) |