Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building fails with latest re2 from GIT installed #40

Closed
buzzdeee opened this issue Apr 17, 2020 · 2 comments · Fixed by #42
Closed

building fails with latest re2 from GIT installed #40

buzzdeee opened this issue Apr 17, 2020 · 2 comments · Fixed by #42
Assignees

Comments

@buzzdeee
Copy link

latest re2 removed deprecated interfaces, see GIT commit:
https://code.googlesource.com/re2/+/ac65d4531798ffc9bf807d1f7c09efb0eec70480

so trying to install re2 gem fails building native extensions:
make
compiling re2.cc
In file included from re2.cc:9:
In file included from /usr/local/include/ruby-2.6/ruby.h:33:
In file included from /usr/local/include/ruby-2.6/ruby/ruby.h:2111:
/usr/local/include/ruby-2.6/ruby/intern.h:56:19: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
/usr/local/include/ruby-2.6/ruby/intern.h:56:36: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
re2.cc:261:37: error: no member named 'utf8' in 're2::RE2::Options'
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1"));
~~~~~~~~~~~~~~~~~~~~~ ^
re2.cc:37:36: note: expanded from macro 'ENCODED_STR_NEW'
int _enc = rb_enc_find_index(encoding);
^~~~~~~~
re2.cc:459:35: error: no member named 'utf8' in 're2::RE2::Options'
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1"));

and quite more.

The utf8() member function was removed.

mudge added a commit that referenced this issue Apr 18, 2020
GitHub: #40

As re2 has deprecated [0] and now removed [1] the utf8 option,
re-implement the option in the gem in terms of the encoding and
set_encoding API.

This should be entirely backward-compatible as the encoding API has been
present since the initial release in 2010.

Thanks to @buzzdeee for reporting this upcoming breaking change.

  [0]: google/re2@58141dc#diff-6dc69df7618951357bb5fb674c66aa34R640
  [1]: google/re2@ac65d45#diff-6dc69df7618951357bb5fb674c66aa34L640-L649
@mudge
Copy link
Owner

mudge commented Apr 18, 2020

Hi @buzzdeee,

I've just published v1.2.0 which should hopefully fix this in a backward compatible way. I've switched from using the now-deprecated utf8 API and am using only encoding under the hood which has been in the library since its initial release in 2010.

I've tested it locally and have added the current (unreleased) version of re2 to the CI build matrix but please let me know if this resolves your issue.

@mudge mudge self-assigned this Apr 18, 2020
@mudge mudge linked a pull request Apr 18, 2020 that will close this issue
@buzzdeee
Copy link
Author

Hi @mudge

thanks for the quick fix, tested 1.2.0 against git checkout with and without the deprecated APIs, in both cases, it builds fine.

terrchen pushed a commit to terrchen/gitlab that referenced this issue May 4, 2020
The latest re2 library released on Homebrew does not compile with this
gem: mudge/re2#40. Update this gem to make
that work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants