-
-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build outputs are infinitely recursively processed #1940
Comments
It is an issue in all exporters though, you can just change the project kind to ConsoleApp or similar to observe said behavior. |
That is a project type. An exporter is Visual Studio, Gmake (not gmake2), xcode, etc. |
Well, my pull request does not modify anything other than gmake2's utility project type. And as i said, this can be observed in gmake2's cpp project type too. I can create a minimal reproducible example if you need that |
Ahh got it. Yes, please go ahead and attach a minimum premake5.lua file that can reproduce it (and any supporting files needed). |
premake5.lua: rule "sampleRule"
fileextension ".txt"
-- buildmessage and buildcommands dont seem to matter
buildmessage 'Copying %{file.relpath}'
buildcommands 'cp %{file.relpath} new_%{file.relpath}'
buildoutputs '%{file.basename}.txt'
workspace "sample"
configurations { "Debug", "Release" }
project "sample"
kind "ConsoleApp"
rules { "sampleRule" }
files { "**.txt" } alongside with an empty sample.txt file
|
So just to follow up, would you expect the generated files to not be included in the rule's outputs? |
Not really, i dont think that this is by any means good. Because then if you have 2 rules, i.e. one for .cpp>.so and the other one for .so, it will not pass it through the second rule, which im pretty sure isnt what someone would want. What im saying is that the rule's outputs should not be fed to itself again. |
Completely following now. I'll try to have a fix out this weekend, as I see where this needs to go. |
What seems to be the problem?
When using custom rules, if a buildoutput happens to use the same file extension as the rule itself, premake gets into an infinite recursion loop and later dies with stack smashing(?).
What did you expect to happen?
I had expected premake not to compile already compiled files again. Though, something like that can be by design, i.e. you do .bmp>.png>.jpg, but not .png>.png>... (unless specified so)
What have you tried so far?
A dirty hack: create a file with a different extension and then copy it to the output directory.
How can we reproduce this?
Keep in mind that for order for this to work you need to first have #1939 installed.
My premake script uses a required script and overrides the gmake utility project generator, so the version is still relevant, nothing is touched except that.
What version of Premake are you using?
5.0.0-beta1
The text was updated successfully, but these errors were encountered: