google / fuzztest

Other
681 stars 66 forks source link

Fuzztest uses internal re2 headers #91

Open gjasny opened 1 year ago

gjasny commented 1 year ago

Hello,

The re2/prog.h header as used by regex.* is not part of the public API.

See: https://github.com/google/re2/blob/954656f47fe8fb505d4818da1e128417a79ea500/CMakeLists.txt#L149-L154

Could you please work-out a solution with the re2 authors?

Thanks, Gregor

gjasny commented 1 year ago

It's also not part of the hdrs of re2: https://github.com/google/re2/blob/2022-06-01/BUILD#L30 Why doesn't it trigger a sandbox violation?

gjasny commented 1 year ago

The Bazel layering_check finds it, too:

bazel build --features=layering_check //...
...
external/com_google_fuzztest/fuzztest/internal/regexp.cc:32:10: error: use of private header from outside its module: 're2/prog.h' [-Wprivate-header]
#include "re2/prog.h"
         ^
external/com_google_fuzztest/fuzztest/internal/regexp.cc:33:10: error: use of private header from outside its module: 're2/regexp.h' [-Wprivate-header]
#include "re2/regexp.h"
fniksic commented 1 year ago

Hey Gregor, thanks for pointing this out. We're working on a solution with the RE2 team, and will resolve this as soon as they release a public API with similar functionality.

gchatelet commented 7 months ago

I'm running in the same error trying to use FuzzTest with Bazel. Any status updates? As-is, the tutorial is broken.

lszekeres commented 5 months ago

Thanks! Previously we were hoping we could make this API public in RE2, but we dropped that idea.

As an alternative hack, could we add a patch to the re2 http_archive, that moves re2/prog.h to hdrs?

Ahajha commented 5 months ago

I'm working on a Conan package for fuzztest and this came up. Without a proper fix, our best bet is to include the extra headers in the re2 package, which is less than ideal.