google / libprotobuf-mutator

Library for structured fuzzing with protobuffers
Apache License 2.0
570 stars 113 forks source link

Consuming Abseil via Protobuf as transitive dependency is fragile #249

Open uilianries opened 1 month ago

uilianries commented 1 month ago

Hello!

We have packaged libprotobuf-mutator in Conan (see PR #24163). During this process, we noticed that the Abseil library is not only used by Protobuf but also directly by libprotobuf-mutator. For instance, the absl::StrCat function is used without a direct reference, such as a header include or CMake target.

This creates a fragile situation where the functionality may depend on Protobuf’s use of Abseil, leading to potential issues during linking. It would be beneficial to refactor the CMake configuration of this project to explicitly consume both Protobuf and Abseil. This can be achieved not only by using CMake targets but also by utilizing the official FindProtobuf module to avoid additional overhead.

I am willing to submit a PR with these changes, but I would first like to hear your thoughts on this matter.

vitalybuka commented 1 month ago

I am not sure how FindProtobuf will work if it's looking for system lib. For best effect we need proto library instrumented with coverage and sanitizer.

Explicit Abseil LGTM.