-
Notifications
You must be signed in to change notification settings - Fork 730
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
Pruning generated files for .relative(subpath:) operations deletes only #2969
Comments
Ooooh! Thanks for this @jimisaacs! We definitely will look into it. |
Huh! We've struggled to be able to replicate this behaviour in the past - thank you for narrowing it down to a particular configuration setting @jimisaacs! |
@jimisaacs I am investigating the issue currently, and wondering if you could provide a little more info about your setup. Are any of the paths in your file structure Symlinks to another path? Possibly the "subpath" given in the |
@BobaFetters no symlinks, just a subpath that ends up in the Sources of multiple swift packages. |
@jimisaacs Would you be able to provide a small sample setup that replicates what you have in your project with the subpath and a swift package that uses that in its Sources to be able to test against? This would help in verifying the cause of the issue and ensuring the fix covers all use cases. |
@BobaFetters here you go! If you do this... cd ReducedCase/librares/Codegen
swift run Or... open ReducedCase/ReducedCase/ReducedCase.xcworkspace then run Both should alternate removing and creating generated files upon repeated execution. |
@jimisaacs Thanks so much for providing that! I believe I have a fix for the issue, few more tests to run to verify for sure, but this is super helpful. |
The fix for this has been merged into main and will go out in our next release |
Summary
When generating code with
operations: .relative(subpath: "somepath")
, and withpruneGeneratedFiles
not set (assuming defaulting to true), the after 1 generate run it only deletes the operations. Then after a second run it regenerates them.If you repeat this process it should repeat the pattern, i.e. delete only -> regenerate -> delete only -> regenerate -> etc.
Version
1.0.7
Steps to reproduce the behavior
Create a codegen project with
operations: .relative(subpath: "somepath")
, and withpruneGeneratedFiles
not set, then repeatedly execute codegen. You should see the operations be deleted and regenerated on each subsequent execution.Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: