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

Build extensions for Ruby 2.7 #7027

Merged
merged 10 commits into from Apr 17, 2020
Merged

Conversation

qnighy
Copy link
Contributor

@qnighy qnighy commented Dec 18, 2019

I've made two groundworks for building protobuf extensions for Ruby 2.7:

Now that 2.7.0-rc2 has been released, can we start building extensions for Ruby 2.7?

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@qnighy qnighy force-pushed the ruby-2.7.0-rc1 branch 2 times, most recently from 77edea4 to 165bdc3 Compare December 26, 2019 02:31
@casperisfine
Copy link
Contributor

@haberman sorry for the ping, but any change for this to be merged ?

@haberman
Copy link
Member

haberman commented Jan 8, 2020

No worries about the ping, please take a look at the test failures. Feel free to ping me again.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Jan 8, 2020
@qnighy qnighy force-pushed the ruby-2.7.0-rc1 branch 2 times, most recently from c2a88ad to 5782756 Compare January 8, 2020 02:39
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jan 8, 2020
@qnighy
Copy link
Contributor Author

qnighy commented Jan 8, 2020

Ah OK, the CI doesn't run automatically.

@qnighy
Copy link
Contributor Author

qnighy commented Jan 8, 2020

From https://source.cloud.google.com/results/invocations/ac6df955-314c-45f7-8e2e-a9a2cbfdedbc/targets/protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby_release%2Fpresubmit/log ...

/usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
	from /usr/local/rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
	from /usr/local/rvm/gems/ruby-2.5.3/bin/bundle:23:in `<main>'
	from /usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
	from /usr/local/rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
rake aborted!
Command failed with status (1): [docker run -v /tmpfs/src/github/protobuf/ruby:/tmpfs/src/github/protobuf/ruby -e UID\=1000 -e GID\=1000 -e USER\=kbuilder -e GROUP\=kbuilder -e ftp_proxy\= -e http_proxy\= -e https_proxy\= -e RCD_HOST_RUBY_PLATFORM\=x86_64-linux -e RCD_HOST_RUBY_VERSION\=2.4.1 -e RCD_IMAGE\=protobuftesting/ruby_rake_compiler_52bbc96c6d72ba1b25e99e19bdcfeb240438566c -w /tmpfs/src/github/protobuf/ruby --rm -i protobuftesting/ruby_rake_compiler_52bbc96c6d72ba1b25e99e19bdcfeb240438566c runas sigfw bash -c bundle\ \&\&\ IN_DOCKER\=true\ rake\ cross\ native\ gem\ RUBY_CC_VERSION\=2.7.0:2.6.0:2.5.0:2.4.0:2.3.0]

I guess there's a mismatch in bundler versions? one is from kokoro/linux/dockerfile/release/ruby_rake_compiler/Dockerfile and the other is from kokoro/release/ruby/linux/ruby/ruby_build_environment.sh.

@casperisfine
Copy link
Contributor

I guess there's a mismatch in bundler versions?

Yeah that's a classic error with Ruby 2.7

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot removed the cla: yes label Jan 9, 2020
@haberman
Copy link
Member

haberman commented Apr 9, 2020

@qnighy Looks like we're still getting an error. :(

/Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-darwin18/rbconfig.rb:13:in `<module:RbConfig>': ruby lib version (2.7.0) doesn't match executable version (2.6.0) (RuntimeError)
	from /Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-darwin18/rbconfig.rb:11:in `<top (required)>'
	from /Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/fileutils.rb:4:in `require'
	from /Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/fileutils.rb:4:in `<top (required)>'
	from /Users/kbuilder/.rake-compiler/sources/ruby-2.6.0/tool/transform_mjit_header.rb:5:in `require'
	from /Users/kbuilder/.rake-compiler/sources/ruby-2.6.0/tool/transform_mjit_header.rb:5:in `<main>'
make: *** [.ext/include/x86_64-darwin11/rb_mjit_min_header-2.6.0.h] Error 1

@qnighy
Copy link
Contributor Author

qnighy commented Apr 10, 2020

grpc/grpc@4c66747 do we perhaps need to get rid of grpctesting/rake-compiler-dock_53c22085d091183c528303791e7771359f699bcf?

@qnighy
Copy link
Contributor Author

qnighy commented Apr 10, 2020

@haberman I'd like to see what happens when I remove the custom RCD image. Could you kick the CI again?

@qnighy
Copy link
Contributor Author

qnighy commented Apr 13, 2020

Okay, this change must be important: grpc/grpc@4c66747#diff-52c976fc38ed2b4e3b1192f8a8e24cffL131-R150

@haberman one more kick, please? Thanks in advance!

@haberman
Copy link
Member

Looks like we're still getting an error:

/Users/kbuilder/.rvm/rubies/ruby-2.7.0/bin/ruby --disable=gems -I/Users/kbuilder/.rake-compiler/builds/x86_64-darwin11/ruby-2.6.0 -rx86_64-darwin11-fake  /Users/kbuilder/.rake-compiler/sources/ruby-2.6.0/tool/transform_mjit_header.rb "clang " rb_mjit_header.h .ext/include/x86_64-darwin11/rb_mjit_min_header-2.6.0.h
/Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-darwin18/rbconfig.rb:13:in `<module:RbConfig>': ruby lib version (2.7.0) doesn't match executable version (2.6.0) (RuntimeError)
	from /Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/x86_64-darwin18/rbconfig.rb:11:in `<top (required)>'
	from /Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/fileutils.rb:4:in `require'
	from /Users/kbuilder/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/fileutils.rb:4:in `<top (required)>'
	from /Users/kbuilder/.rake-compiler/sources/ruby-2.6.0/tool/transform_mjit_header.rb:5:in `require'
	from /Users/kbuilder/.rake-compiler/sources/ruby-2.6.0/tool/transform_mjit_header.rb:5:in `<main>'
make: *** [.ext/include/x86_64-darwin11/rb_mjit_min_header-2.6.0.h] Error 1

Do you think it's worth trying ruby-install and chruby instead of rvm?

In my experience, ruby-install and chruby (along with bundle exec) have been really solid ways of switching between Ruby versions.

@qnighy
Copy link
Contributor Author

qnighy commented Apr 14, 2020

Do you think it's worth trying ruby-install and chruby instead of rvm?

I'll instead follow the grpc/grpc's approach: grpc/grpc@09bc1ee

@qnighy
Copy link
Contributor Author

qnighy commented Apr 16, 2020

I guess when I update dockerfiles in kokoro/linux/dockerfile/test, someone with a certain privilege has to invoke kokoro/linux/dockerfile/push_testing_images.sh manually?

Then, in this PR, I'd like to focus on building extensions for Ruby 2.7. I'll prepare another PR for testing protobuf in Ruby 2.7.

@qnighy
Copy link
Contributor Author

qnighy commented Apr 17, 2020

@haberman can it be merged? I think the remaining CI failures are unrelated to this PR.

スクリーンショット 2020-04-17 14 22 03

@haberman haberman merged commit 64f6c59 into protocolbuffers:master Apr 17, 2020
@qnighy
Copy link
Contributor Author

qnighy commented Apr 17, 2020

Thanks a lot! I'm really glad to see this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants