Do not remove generated files from existing rules - #214
Conversation
jayconrod
left a comment
There was a problem hiding this comment.
Thanks for sending this fix.
A few comments. Please also add Signed-off-by: Your Name <your@email.com> to all commit messages (use git commit -s).
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
7b9d556 to
61ac7d3
Compare
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
|
Thank you for the review! I had to force push to change the commit message with Notably I added helpers to debug tests, similar to how we can debug examples. I can revert them, but I figure they could be useful to others. Btw, I tried to add support for |
Signed-off-by: Grégoire Geis <gregoire@seoulrobotics.org>
a934c0c to
d1fbf2f
Compare
|
As mentioned in the other PR, CI is failing because of a misconfiguration on my side: we enabled remote caching, but the secret needed to make that work isn't available on PRs from external contributors. I've verified tests pass locally, so that's good enough for now. |
Before, generated sources were removed from
srcsandhdrs; rules with only generated sources would be removed as well.With this PR,
srcsandhdrskeep their generated sources, and rules with only generated sources are kept.This also seems enough for Gazelle to add dependencies to targets when generated headers are included (e.g. in the example added in this PR, a dependency from
testtoaloneis correctly added based on#include "generated/alone.h").I decided to only preserve existing
srcsandhdrs, rather than adding new ones (e.g. by adding generated sources tofileInfos). I figured treating generated files as sources files would be nice, but would likely have more edge cases.I cooked this up pretty quickly. I guess there are better ways to add tests than modifying
example/bzlmod, but this was the fastest way to test things (and worked with the debugger).