Skip to content

Handle generated files by cmake - #19

Merged
ekacnet merged 15 commits into
mainfrom
dev/handlegeneratingpregenerated
May 3, 2026
Merged

Handle generated files by cmake#19
ekacnet merged 15 commits into
mainfrom
dev/handlegeneratingpregenerated

Conversation

@ekacnet

@ekacnet ekacnet commented May 2, 2026

Copy link
Copy Markdown
Owner
  • Add posttreatments option
  • Add another post treatment for generating ProtocolVersion from cmakke templates
  • Generate load instruction for macros that are used related to cc_library, sh_binary ...
  • Add support for generating pregenerated files
  • Allow to provide some placeholders on the cli too
  • Add tool to post process bazel file from ninja2bazel to make it more useful
  • Deal with subfolders for configure_file
  • Generate some vars like CMAKE_SOURCE_DIR automatically
  • Move renderconfig to the target tree if needed
  • Deal with #cmakedefine values
  • ** Do not parse env_set as set**
  • Propagate the dependencies found in files generated to the target that use the generated files
  • Refactor how we discover that the command to run for genrule is python based
  • Do not add blindly deps for a genrule target as sources
  • Add .s/.S (assembly) that are generated to the sources rather than data.

@ekacnet
ekacnet force-pushed the dev/handlegeneratingpregenerated branch from 0b736d3 to a610d96 Compare May 2, 2026 22:08
@ekacnet
ekacnet force-pushed the dev/handlegeneratingpregenerated branch from a610d96 to 479952d Compare May 3, 2026 16:54
@ekacnet
ekacnet force-pushed the dev/handlegeneratingpregenerated branch from 479952d to 1d4bf75 Compare May 3, 2026 18:23
@codecov-commenter

codecov-commenter commented May 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.36634% with 94 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.36%. Comparing base (e7cb17f) to head (55d7948).

Files with missing lines Patch % Lines
parser.py 57.29% 41 Missing ⚠️
configure_file.py 82.46% 37 Missing ⚠️
build.py 83.90% 14 Missing ⚠️
bazel.py 94.44% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   74.19%   77.36%   +3.17%     
==========================================
  Files          20       23       +3     
  Lines        3790     4582     +792     
==========================================
+ Hits         2812     3545     +733     
- Misses        978     1037      +59     

☔ View full report in Codecov by Sentry.
📢 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.

@ekacnet
ekacnet force-pushed the dev/handlegeneratingpregenerated branch from 1d4bf75 to fe514e4 Compare May 3, 2026 18:27
Base automatically changed from dev/agents to main May 3, 2026 18:29
ekacnet added 15 commits May 3, 2026 11:30
Post treatment is to allow a custom per project treatment to manipulate
the resulting BUILD file
This might sound counter-intuitive but we might want to generate
pre-generated files ie the one that that are generated by cmake instead
by the build.
Why ? because it is a pain to have to copy the files all the time and
keep them in sync as code change.
Sometime the file is an subfolder so ${CMAKE_CURRENT_BINARY_DIR} points
to the folder in the work dir + the subfolder but we didn't handle that
before
…n based

This relies on better detecting the binary for python + also detecting
the argument to the python script.
When processsing the target we already parse through its sources output
and tools so we don't need to redo it
@ekacnet
ekacnet force-pushed the dev/handlegeneratingpregenerated branch from fe514e4 to 55d7948 Compare May 3, 2026 18:30
@ekacnet
ekacnet merged commit 6c62b8b into main May 3, 2026
3 checks passed
@ekacnet
ekacnet deleted the dev/handlegeneratingpregenerated branch May 3, 2026 18:31
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.

2 participants