Closed rofrankel closed 10 months ago
For posterity, @Alfus and I chatted about this on Slack (thanks Alfred!) and this isn't a protovalidate-cc bug, it's an issue with our using a slightly earlier version of Envoy that depends on an different version of https://github.com/google/cel-cpp that's incompatible with protovalidate, plus the fact that protovalidate loads its cel-cpp dependency with maybe
, which means it doesn't load it if any version of cel-cpp (even an incompatible one) is present. (This is a Bazel limitation, not something protovalidate can really fix.)
I think the "right" solution probably involves Bzlmod. Short term workarounds we discussed include A) upgrading our Envoy dependency (which hopefully depends on a compatible version of cel-cpp); or B) locally modifying protovalidate-cc to use the same version of cel-cpp as our current Envoy version, then creating a patch file representing those modifications, and having Bazel apply that patch when it pulls in the protovalidate dependency.
Description
I can build protovalidate-cc locally in isolation (with WSL2 running Debian), but when I try to include it via http_archive as part of another project (our internal Envoy proxy fork), I get these errors:
Steps to Reproduce
WORKSPACE
file:filter_lib
target:"@com_github_bufbuild_protovalidate_cc//buf/validate:validator"
.bazel-6.1.2 build --disk_cache=/bazel-cache --repository_cache=/bazel-repo-cache //:public_gateway
Expected Behavior
Build succeeds.
Actual Behavior
Build fails (see error above).
Screenshots/Logs
See above.
Environment
Possible Solution
I see that enable_regex_precompilation exists, and has for a while, so I don't have an explanation for that error.
I think I understand the other errors, on some level - comparing two different enum types does seem like something that might cause build errors in a stricter mode - and maybe building protovalidate-cc via bazel/http_archive from a project with its own C++ config is affecting how the C++ compiler gets invoked, because protovalidate-cc's build configuration isn't fully encapsulated?
Additional Context