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

Doesn't work on JRuby #712

Closed
barakcoh opened this issue May 24, 2016 · 28 comments
Closed

Doesn't work on JRuby #712

barakcoh opened this issue May 24, 2016 · 28 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. grpc status: acknowledged status: blocked Resolving the issue is dependent on other work. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@barakcoh
Copy link

Hi

Trying to upgrade my Logstash input https://github.com/Wondermall/logstash-input-google-cloud-pubsub
But gcloud-ruby's dependency on google-protobuf is causing it to trigger a native extensions build which is not supported by JRuby, making gcloud-ruby unusable for JRuby based environments which is a shame because it could be tremendously useful for Logstash.

I've tried JRUBY_OPTS="--2.0 -Xcext.enabled=true" but no dice, even though google-protobuf does check the RUBY_PLATFORM and it looks to me it shouldn't be running the native extensions build but I'm no expert in gem building.

Building native extensions.  This could take a while...
ERROR:  Error installing gcloud:
    ERROR: Failed to build gem native extension.

    /opt/logstash/vendor/jruby/bin/jruby -r ./siteconf20160524-809-1vt2zkd.rb extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

   (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1040
   (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
   (root) at extconf.rb:3

extconf failed, uncaught signal 1

Gem files will remain installed in /opt/logstash/vendor/bundle/jruby/1.9/gems/google-protobuf-3.0.0.alpha.5.0.5.1 for inspection.
Results logged to /opt/logstash/vendor/bundle/jruby/1.9/extensions/universal-java-1.8/1.9/google-protobuf-3.0.0.alpha.5.0.5.1/gem_make.out
@quartzmo quartzmo added grpc type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: pubsub Issues related to the Pub/Sub API. labels May 24, 2016
@quartzmo
Copy link
Member

@barakcoh Thanks for reporting this, and sorry about the trouble. My understanding is that JRuby should use protobuf/java instead of trying to install the Ruby C extensions. Can you try installing google-protobuf independently from gcloud in your environment, and if it still fails, open an issue in google/protobuf instead? We definitely want to resolve this.

@blowmage
Copy link
Contributor

I'm looking into this.

@blowmage
Copy link
Contributor

@barakcoh What platform are you seeing this behavior on? Mac? Linux? x86? x64?

@barakcoh
Copy link
Author

@quartzmo that was my understanding as well, however that doesn't seem to be the case.
@blowmage I'm building a docker container on Docker for Mac which is essentially running Alpine linux AFAIK.

git:(master) ✗ docker run -it logstash:2.3 bash
root@f7ae3cc8b987:/# GEM_HOME=/opt/logstash/vendor/bundle/jruby/1.9 JRUBY_OPTS="--2.0" /opt/logstash/vendor/jruby/bin/jruby /opt/logstash/vendor/jruby/bin/gem install gcloud
....
Successfully installed google-api-client-0.8.6
Fetching: google-protobuf-3.0.0.alpha.5.0.5.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing gcloud:
    ERROR: Failed to build gem native extension.

    /opt/logstash/vendor/jruby/bin/jruby -r ./siteconf20160525-7-fiydnu.rb extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

   (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1040
   (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
   (root) at extconf.rb:3

extconf failed, uncaught signal 1

Gem files will remain installed in /opt/logstash/vendor/bundle/jruby/1.9/gems/google-protobuf-3.0.0.alpha.5.0.5.1 for inspection.
Results logged to /opt/logstash/vendor/bundle/jruby/1.9/extensions/universal-java-1.8/1.9/google-protobuf-3.0.0.alpha.5.0.5.1/gem_make.out

@Damaotimlin
Copy link

Damaotimlin commented Jun 20, 2016

have same issue here +1
In Gemfile,
gem 'gcloud' will automatically install gcloud 0.6.0 which is a very old version.

And if I try to run bundle update, it will try to install google-protobuf 3.0.0.alpha.5.0.5.1
and get the error of "Gem::Ext::BuildError: ERROR: Failed to build gem native extension."

Please advise, thanks !

@quartzmo
Copy link
Member

@Damaotimlin Can you provide the details of your environment? Thank you!

@Damaotimlin
Copy link

Damaotimlin commented Jun 21, 2016

@quartzmo Please see below and let me know if you need any further information !

I'm currently running in Mac OS X 10.11.5
rails -v 5.0.0.rc1
ruby -v jruby 9.1.2.0 (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
gem -v 2.6.4
bundler -v 1.12.5
gcloud -v

Google Cloud SDK 114.0.0
bq 2.0.24
bq-nix 2.0.24
core 2016.06.09
core-nix 2016.06.06
gcloud
gsutil 4.19
gsutil-nix 4.19

Gemfile.lock

...
gcloud (0.6.0)
      beefcake (~> 1.0)
      digest-crc (~> 0.4)
      google-api-client (~> 0.8.3)
      mime-types (~> 2.4)
      zonefile (~> 1.04)
PLATFORMS
  java

DEPENDENCIES
  bundler (>= 1.12.5)
  byebug
  coffee-rails (~> 4.1.0)
  firebase
  gcloud (<= 0.6)
  haml
  jbuilder (~> 2.0)
  jquery-rails
  listen (~> 3.0.5)
  puma (~> 3.0)
  rails (>= 5.0.0.rc1, < 5.1)
  redis (~> 3.0)
  sass-rails (~> 5.0)
  spring
  spring-watcher-listen (~> 2.0.0)
  therubyrhino
  turbolinks (~> 5.x)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console

RUBY VERSION
   ruby 2.3.0p0 (jruby 9.1.2.0)

BUNDLED WITH
   1.12.5
...

Thanks !

@Damaotimlin
Copy link

After I successfully install google-protobuf (3.0.0.alpha.6.0.0) follow by java and ruby(jruby) guide.
https://github.com/google/protobuf/tree/master/java
https://github.com/google/protobuf/tree/master/ruby

While I try to install jruby -S gem install gcloud, it still force me to install google-protobuf (3.0.0.alpha.5.0.5.1) and run into C extensions error again and again.

Don't know how to keep my jrails move forward in google. I really like the ideas of GAE and NoSQL storage + Firebase, if which can plus jruby performance would be greater.

Please helps, thanks !

@quartzmo
Copy link
Member

@blowmage Any ideas, other than to fork gcloud-ruby?

@blowmage
Copy link
Contributor

The issue here isn't gcloud-ruby, it's the grpc and google-protobuf gems. What is needed is for those gems to support JRuby. That is where I would start.

@markluopp
Copy link

exactly same issue when install with jruby on Solaris10.

@ylastic
Copy link

ylastic commented Sep 17, 2016

Same issue on installing with JRuby, OSX El Capitan.

@pchaganti
Copy link

Trying to use JRuby so we can speed up some of our BigQuery analytics pieces. Any workarounds to get gcloud to install and work on JRuby?

thanks!

@blowmage
Copy link
Contributor

@pchaganti The grpc and google-protobuf gems are needed for services that connect using gRPC. However, BigQuery does not use gRPC and instead uses the JSON endpoints. So, instead of installing the google-cloud gem which contains all services, try just installing the google-cloud-bigquery gem which will only connect to BigQuery.

@quartzmo
Copy link
Member

@pchaganti Did you try installing just the google-cloud-bigquery gem? It has no dependency on gRPC, and thus it should work on JRuby.

@pchaganti
Copy link

Ah! @quartzmo @blowmage Thanks. Will try this out.

@JasonLunn
Copy link

google-cloud-datastore does have dependencies on grpc and google-protobuf so this workaround doesn't help. Any hope of this bug getting addressed soon?

@JasonLunn
Copy link

Trying to get this fixed via protocolbuffers/protobuf#2199

@quartzmo
Copy link
Member

@JasonLunn Thanks for pursuing this!

@JasonLunn
Copy link

JasonLunn commented Oct 11, 2016

@quartzmo / @blowmage - protocolbuffers/protobuf#2199 merged a week ago but I haven't yet seen a gem pushed to RubyGems for the JRuby platform. My last comment on the PR (about the release process) hasn't been answered - any ideas?

@blowmage
Copy link
Contributor

Unfortunately we don't have any visibility into the GRPC team or what their release schedule is.

@swcloud swcloud added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Mar 9, 2017
@swcloud swcloud added status: blocked Resolving the issue is dependent on other work. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 9, 2017
@swcloud
Copy link
Contributor

swcloud commented Mar 9, 2017

blocked by grpc team.

@JasonLunn
Copy link

CC: @remi

@JasonLunn
Copy link

I can confirm that protobuf has released version 3.1.0 with a java platform, which leaves grpc/grpc#6705 as the next known issue.

@JasonLunn
Copy link

For anyone still following along, JRuby support for gRPC is blocked on grpc/proposal#13 before work can begin in earnest...

@danoscarmike danoscarmike removed the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Nov 9, 2017
@danoscarmike
Copy link
Contributor

@geigerj @blowmage suggest we close this issue and move this to the feature backlog (wiki). @hsaliak and grpc team confirm that the user contributed route is the only viable and that is being tracked elsewhere.

@danoscarmike
Copy link
Contributor

@Goltergaul
Copy link

are there any news on this? I just stumbled upon this myself

gcf-owl-bot bot added a commit that referenced this issue Apr 12, 2022
Source-Link: googleapis/googleapis@fd16b6a

Source-Link: googleapis/googleapis-gen@d935b98
Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbXB1dGUtdjEvLk93bEJvdC55YW1sIiwiaCI6ImQ5MzViOTg0N2ExYjcwOGFiNGU2OTYzMjBiYTYwY2UwMzQxYzVkN2EifQ==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. grpc status: acknowledged status: blocked Resolving the issue is dependent on other work. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests