Skip to content

Replace GNU Make Codegen with Python - #2241

Open
ni-jfitzger wants to merge 11 commits into
ni:masterfrom
ni-jfitzger:replace-gnu-make-with-python
Open

ni-jfitzger wants to merge 11 commits into
ni:masterfrom
ni-jfitzger:replace-gnu-make-with-python

Conversation

@ni-jfitzger

@ni-jfitzger ni-jfitzger commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator
  • This contribution adheres to CONTRIBUTING.md.
  • [ ] I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

The GNU Make code used for code generation was a barrier to entry for anyone not familar with GNU Make and, frankly, even for those who are familiar with it. Some of the code was very difficult to read. Variables and recipes were also scattered across the repo, making it more difficult to read.

Using GitHub Copilot, this PR replaces those files and some of their Python code with a consolidated build/codegen.py, which implements the codegen, clean and installers steps.

Included but unrleated: I've capped the pytest version used for system tests, because the latest release breaks our testing.

List issues fixed by this Pull Request below, if any.

What testing has been done?

Ran tox -e clean, tox -e codegen, tox -e installers, tox -e codegen -- -driver nidmm. No difference seen in the generated files.

Ran newly generated unit tests. These don't cover all of codegen.py, but it's more than we had for the MAKEFILE code. Our primary method of catching issues remains ensure_codegen_up_to_date.py, diffs and code review of PRs.

I carefully reviewed all of the new code and had GitHub Copilot scrutinize for any issues that I might have missed.

@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.33610% with 98 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.82%. Comparing base (609c4ee) to head (3f11006).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
build/codegen.py 58.64% 98 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2241      +/-   ##
==========================================
- Coverage   88.12%   87.82%   -0.31%     
==========================================
  Files          88       87       -1     
  Lines       22830    22776      -54     
==========================================
- Hits        20118    20002     -116     
- Misses       2712     2774      +62     
Flag Coverage Δ
codegenunittests 82.42% <59.33%> (-2.37%) ⬇️
nidcpowersystemtests 94.40% <ø> (+0.04%) ⬆️
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.04% <ø> (ø)
nidigitalunittests 68.43% <ø> (ø)
nidmmsystemtests 92.33% <ø> (ø)
nifakeunittests 86.08% <ø> (ø)
nifgensystemtests 94.34% <ø> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
nirfsasystemtests 82.71% <ø> (ø)
nirfsaunittests 63.37% <ø> (ø)
nirfsgsystemtests 81.22% <ø> (ø)
niscopesystemtests 89.99% <ø> (ø)
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 81.66% <ø> (ø)
nitclksystemtests ?
nitclkunittests 98.26% <ø> (ø)

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.

@ni-jfitzger

Copy link
Copy Markdown
Collaborator Author

Something seems off about the reported code coverage for build/helper.

@ni-jfitzger

Copy link
Copy Markdown
Collaborator Author

Something seems off about the reported code coverage for build/helper.

Apparently --source is supposed to be a comma-separated list. You can't pass it twice in the same command.

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.

Replace GNU Make Code with Python

2 participants