This assumes that Re2 is installed following Google's guide. I am not sure
how we want to integrate it in the project, but I think a follow-up patch would
be more appropriate for such work.
As it stands, *not* having Re2 installed results in a compilation error, which
is a problem as it breaks install compatibility. Hence, this is gated behind
a non-default with-re2 compilation feature.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Does mercurial currently use RE2? If not then can you explain why we don't just use the rust regex crate?
rust/hg-core/src/re2/rust_re2.cpp | ||
---|---|---|
23 | This is never freed. Should we add a Drop implementation in rust? |
We have support for using re2 iff the correct Python bindings are installed. That said, I thought the rust regex crate would be compatible with re2? If we can't use that, we should document why so that future hackers (like me) don't try and simplify....
While I think the rust regex crate is heavily inspired by RE2 and uses a fairly compatible syntax I don't think there is a goal to be 100% compatible and I would be surprised if there weren't any differences. What I am trying to say is that if we are going to change engines we may as well change to regex. If we are using RE2 for backwards compatibility then this change makes sense.
This is never freed. Should we add a Drop implementation in rust?