Skip to content

Fixed that build outputs are infinitely recursively processed#2740

Open
SanjeetBalamurugan wants to merge 3 commits into
premake:masterfrom
SanjeetBalamurugan:fix-issur-1940
Open

Fixed that build outputs are infinitely recursively processed#2740
SanjeetBalamurugan wants to merge 3 commits into
premake:masterfrom
SanjeetBalamurugan:fix-issur-1940

Conversation

@SanjeetBalamurugan

@SanjeetBalamurugan SanjeetBalamurugan commented Jul 22, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes infinite recursion when a custom rule generates a file with the same extension as its input. Previously, generated files could be treated as new inputs for the same rule, causing the rule to be applied repeatedly.

How does this PR change Premake's behavior?

Generated files from custom rules are now tracked with the rule that created them. Before applying a rule, Premake checks whether the file was already generated by that same rule and skips it if so.

This prevents recursive rule application while keeping existing custom rule behavior unchanged. No breaking changes are introduced.

Closes #1940

Anything else we should know?

This addresses issue 1940.

The fix was verified with a regression case where a custom rule generates another file with the same extension as its input. The generated output is created once and is not recursively processed.

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

@SanjeetBalamurugan SanjeetBalamurugan left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@SanjeetBalamurugan

Copy link
Copy Markdown
Author

May I know if there is any problem with my pull request? @Jarod42

@Jarod42

Jarod42 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

I'm a simple contributor to Premake, like you. I am not a member of Premake.
So I don't have any right.
As contributors, I also do review to spot issue. and for your PR, I don't see problem (There is the fact there are no tests though which might be problematic.)

@SanjeetBalamurugan

SanjeetBalamurugan commented Jul 22, 2026

Copy link
Copy Markdown
Author

@Jarod42, Sanjeet here.

Thanks for your review regarding my pull request. As for the tests, i still have doubts about how to add them. If its a really needed, I would try to add them. But i dont know how tests work in premake-core.

Thanks

Comment thread modules/gmake/tests/test_gmake_customrules.lua Outdated
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.

Build outputs are infinitely recursively processed

3 participants