Skip to content

Conversation

@bbannier
Copy link
Member

Previously plugin dependencies declared with DEPENDENCIES would be PUBLIC to the plugin's target. This means that e.g., include directories from the plugin's dependency would be added to any of its dependents as well.

This not only increases the surface of what we might pull in inadvertently elsewhere, but also might cause unneeded rebuilds elsewhere if dependency paths change.

With this patch we declare any such dependencies PRIVATE. This should only break code which previously did not correctly declare all its dependencies. This code is used both for internal as well is external plugins, and it seems to work well for internal code. For user code this is technically a breaking change, but I expect complex CMake dependencies between multiple plugins to be rare.

Previously plugin dependencies declared with `DEPENDENCIES` would be
`PUBLIC` to the plugin's target. This means that e.g., include
directories from the plugin's dependency would be added to any of its
dependents as well.

This not only increases the surface of what we might pull in
inadvertently elsewhere, but also might cause unneeded rebuilds
elsewhere if dependency paths change.

With this patch we declare any such dependencies `PRIVATE`. This should
only break code which previously did not correctly declare all its
dependencies. This code is used both for internal as well is external
plugins, and it seems to work well for internal code. For user code this
is technically a breaking change, but I expect complex CMake
dependencies between multiple plugins to be rare.
@bbannier
Copy link
Member Author

See zeek/zeek#4460 for the Zeek-side effects.

@bbannier bbannier marked this pull request as ready for review May 15, 2025 11:54
@bbannier bbannier requested a review from timwoj May 15, 2025 11:54
@awelzel awelzel requested a review from Neverlord May 15, 2025 13:01
@timwoj timwoj merged commit 3eca611 into master May 19, 2025
1 check passed
@timwoj timwoj deleted the topic/bbannier/do-not-leak-plugin-dependencies branch May 19, 2025 17:53
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.

4 participants