-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[ruby] Unable to build grpc gem if a more recent version of re2 is installed in include path of Ruby's CPPFLAGS #33615
Labels
Comments
stanhu
added a commit
to stanhu/grpc
that referenced
this issue
Jul 6, 2023
re2 previously failed to compile if: 1. An old `re2` version is installed with a non-standard system prefix, such as `/opt/local`. 2. The environment variable is set: `CPPFLAGS=-I/opt/local/include`. Running `make` would result in function prototype mismatches because the Makefile would previously attempt to use the headers from `/opt/local/include/re2` before the `third_party/re2/re2` directory. To ensure the current directories receive priority, include the relevant re2 directories in the include path. Relates to grpc#33615
stanhu
added a commit
to stanhu/grpc
that referenced
this issue
Jul 6, 2023
re2 previously failed to compile if: 1. An old `re2` version is installed with a non-standard system prefix, such as `/opt/local`. 2. The Ruby interpreter has CPPFLAGS to include the prefix, such as `CPPFLAGS=-I/opt/local/include`. Running `make` would result in function prototype mismatches because the Makefile would previously attempt to use the headers from `/opt/local/include/re2` before the `third_party/re2/re2` directory. To ensure the current directories receive priority, include the relevant re2 directories in the include path. Relates to grpc#33615
stanhu
added a commit
to stanhu/grpc
that referenced
this issue
Jul 6, 2023
re2 previously failed to compile if: 1. An old `re2` version is installed with a non-standard system prefix, such as `/opt/local`. 2. The Ruby interpreter has CPPFLAGS to include the prefix, such as `CPPFLAGS=-I/opt/local/include`. Running `make` would result in function prototype mismatches because the Makefile would previously attempt to use the headers from `/opt/local/include/re2` before the `third_party/re2/re2` directory. To ensure the current directories receive priority, include the relevant re2 directories in the include path. Relates to grpc#33615
For now, I submitted #33616. It seems to me there should be a separate discussion about moving away from |
stanhu
added a commit
to stanhu/grpc
that referenced
this issue
Jul 6, 2023
re2 previously failed to compile if: 1. A different and incompatible `re2` version is installed with a non-standard system prefix, such as `/opt/local`. 2. The Ruby interpreter has CPPFLAGS to include the prefix, such as `CPPFLAGS=-I/opt/local/include`. Running `make` would result in method prototype mismatches because the Makefile would previously attempt to use the headers from `/opt/local/include/re2` before the `third_party/re2/re2` directory. To ensure the current directories receive priority, include the relevant re2 directories in the include path. Relates to grpc#33615
The same goes for abseil. I always need to run |
stanhu
added a commit
to stanhu/grpc
that referenced
this issue
Jul 10, 2023
…lled re2 or abseil previously failed to compile if: 1. A different and incompatible version is installed with a non-standard system prefix, such as `/opt/local`. 2. The Ruby interpreter has CPPFLAGS to include the prefix, such as `CPPFLAGS=-I/opt/local/include`. Running `make` would result in method prototype mismatches because the Makefile would previously attempt to use the headers from `/opt/local/include/re2` before the `third_party/re2/re2` directory. To ensure the current directories receive priority, include the relevant re2 and abseil directories in the include path. Relates to grpc#33615
This might be fixed by #33803, but I'd have to verify. |
Unfortunately, the build still fails with v1.58.0.pre1. |
maxlazio
pushed a commit
to gitlabhq/omnibus-gitlab
that referenced
this issue
Sep 15, 2023
With the update to re2 gem v2.0 in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131273, we no longer need to build and ship libre2. The gem handles the building and compiling of all dependencies (libre2 and abseil-cpp), and it also ships with precompiled gems. This unblocks upgrades to the `grpc` gem since grpc/grpc#33615 no longer applies. Changelog: changed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the
grpc
gem cannot be compiled if:CPPFLAGS
with that prefix.For example, we have:
2023-03-01
compiled with aprefix
of/opt/gitlab/embedded
.CPPFLAGS
with-I/opt/gitlab/embedded/include
.When compiling the grpc gem, the grpc-core
Makefile
will attempt to include/opt/gitlab/embedded/include/re2/re2.h
instead of the localthird_party/re2/re2.h
file, which uses re22022-04-01
. The method definitions are different from re22023-03-01
, so the compilation fails.As discussed in #32580 (comment), the resulting behavior of
extconf.rb
changed over grpc versions:CPPFLAGS
while building grpc-core.ENV['CPPFLAGS']
while building grpc-core.RbConfig::CONFIG['CPPFLAGS']
instead ofENV['CPPFLAGS']
. However, I overlooked that the Ruby compiler flags may also haveCPPFLAGS
that give precedence to the newer re2 path:The key problem here is that no matter what flags are supplied by the Ruby
extconf.rb
, I believe grpc-core should always give precedence to the thethird_party
directory and ensurere2
headers are included during the build process.I attempted to do this in 37a6ff0, but according to #32580 (comment) building with the
Makefile
is deprecated.Describe the solution you'd like
I think we have a few options:
cmake
instead. (?)What do you think @veblush @eregon?
The text was updated successfully, but these errors were encountered: