Skip to content

Fix cmake test regeneration#5568

Open
nishant11-tchy wants to merge 3 commits intop4lang:mainfrom
nishant11-tchy:fix-cmake-test-regeneration
Open

Fix cmake test regeneration#5568
nishant11-tchy wants to merge 3 commits intop4lang:mainfrom
nishant11-tchy:fix-cmake-test-regeneration

Conversation

@nishant11-tchy
Copy link
Copy Markdown

Summary

Improve CMake performance by avoiding unnecessary regeneration of test files during repeated runs.

Problem

Currently, test files are generated unconditionally via the p4_add_tests macro every time CMake is executed. This leads to slower build configuration times, even when no relevant inputs have changed.

Solution

  • Updated the CMake logic to generate test files only when required
  • Introduced conditional generation so files are not recreated on every run
  • Ensured regeneration still happens when input files change

Result

  • Faster repeated CMake runs
  • Reduced unnecessary file operations
  • No change in existing functionality or test behavior

Notes

  • The fix is minimal and does not affect other parts of the build system
  • Verified locally by running CMake multiple times and confirming no redundant regeneration

Signed-off-by: nishant11-tchy <nishantnnnn11@gmail.com>
Signed-off-by: nishant11-tchy <nishantnnnn11@gmail.com>
@nishant11-tchy
Copy link
Copy Markdown
Author

Hi, I’ve worked on improving the CMake behavior to avoid unnecessary regeneration of test files.

The update ensures that test files are only generated when required, instead of on every CMake run. This helps reduce configuration time without affecting existing functionality.

I’ve verified the changes locally by running CMake multiple times and confirming that files are not regenerated unnecessarily.

Please let me know if any changes or improvements are needed. Thanks!

@fruffy
Copy link
Copy Markdown
Collaborator

fruffy commented Mar 27, 2026

There are 0 changed files.

@fruffy fruffy added the infrastructure Topics related to code style and build and test infrastructure. label Mar 28, 2026
Signed-off-by: nishant11-tchy <nishantnnnn11@gmail.com>
Made-with: Cursor
@jafingerhut
Copy link
Copy Markdown
Contributor

@nishant11-tchy I am not sure what is going on here, but given that you have two PRs with 0 changes, perhaps you are making changes to the main / master branch in your fork, creating a PR, then continuing to push additional changes to that same main/master branch in your fork? If you do that, it will affect all PRs using that branch.

That is why most github workflows for creating PRs say that you should create a unique branch name for each PR that you want to create. I'd suggest searching for github documentation on creating PRs that explain the sequence of commands required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Topics related to code style and build and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants