Support native plugins in the static binary #1850
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📔 Description
The plugin scaffold has an auto-registration feature, but for static linking this requires the plugin library to be assembled with
-whole-archive
(or similar, depending on the linker and platform). libvast doesn't use that option, so auto-registration fails for the generated static binary because the symbols are omitted.The solution here is to extract native plugins from the libvast target into a separate library that is linked appropriately into the VAST binary directly, forcing the linker not to omit the symbols required for the auto-registration.
📝 Checklist
🎯 Review Instructions
Run the generated static binary from CI and check if the native plugins works. Or, alternatively, build this locally and patch out the code that removes natives plugins from the output of
vast version
.This is what it shows for me on this branch: