Skip to content

Bazel support - #27

Merged
xtofalex merged 10 commits into
mainfrom
bazel-support
Jul 29, 2026
Merged

xtofalex merged 10 commits into
mainfrom
bazel-support

Conversation

@xtofalex

Copy link
Copy Markdown
Collaborator

No description provided.

xtofalex added 6 commits July 16, 2026 20:26
Adds MODULE.bazel + BUILD.bazel building naja_verilog as a real Bazel
module, so downstream consumers (e.g. najaeda/naja's own CMake-to-Bazel
migration) can depend on it via bazel_dep + git_override instead of a
non-module git_repository fetch with an external overlay BUILD file.

Custom Bison/Flex codegen rules (bazel/verilog_codegen.bzl) run the
system-installed bison/flex directly rather than using the community
rules_bison/rules_flex rules, because their generic bison_action() helper
doesn't account for the auxiliary location.hh header the
`%skeleton "lalr1.cc"` C++ skeleton also emits (VerilogScanner.h includes
it directly). bazel/system_tool.bzl locates bison/flex/m4 the same way
CMake's find_package(BISON REQUIRED)/find_package(FLEX REQUIRED) do, and
separately locates the FlexLexer.h matching the resolved flex binary
(mirroring src/CMakeLists.txt's FLEX_INCLUDE_DIRS handling), since a
mismatched system FlexLexer.h (e.g. Xcode's on macOS) fails to link
against flex-generated scanners.

Validated: `bazel build //:naja_verilog` compiles cleanly, and the
existing naja_verilog_test snippet (now also a Bazel cc_binary target)
correctly parses real Verilog from test/benchmarks/*.v.
@codecov

codecov Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.24%. Comparing base (8a13b59) to head (316db4d).

Additional details and impacted files
@@             Coverage Diff              @@
##              main      #27       +/-   ##
============================================
- Coverage   100.00%   83.24%   -16.76%     
============================================
  Files           10        8        -2     
  Lines          706      716       +10     
============================================
- Hits           706      596      -110     
- Misses           0      120      +120     
Flag Coverage Δ
unittests 83.24% <ø> (-16.76%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xtofalex
xtofalex merged commit 19c67f5 into main Jul 29, 2026
10 checks passed
@xtofalex
xtofalex deleted the bazel-support branch July 29, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant