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

Create bazel ruby release target #10789

Closed
wants to merge 0 commits into from

Conversation

deannagarcia
Copy link
Member

Create ruby:release bazel target that builds 2 gems for release (one just source and one for java).

protobuf_version.bzl Outdated Show resolved Hide resolved
chmod -R 777 ./

# Build gem
bash --login -c "rvm use system && gem build google-protobuf.gemspec"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"system" could be jruby couldn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it could, what should I set this to to get a reasonable ruby version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave it alone and just require the caller to set the ruby version. The future plan for Bazel+Ruby is that our ruby rules will use the system ruby by default, with an optional flag to pin a specific version. So we could just run this twice, once with cruby and once with jruby

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave it alone meaning don't call rvm use and just call gem build google-protobuf.gemspec? Isn't that also just defaulting to the system version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. It defaults to the current version (which is distinct from rvm's "system" I believe), but it doesn't make any assumptions about what that version is. So if we want to produce both c-ruby and java-ruby artifacts, we'd use rvm to set our version and run this target twice

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved offline. Will wait to submit until we have implemented a flag to specify ruby versions.

ruby/BUILD.bazel Outdated Show resolved Hide resolved

set -ex

WORKING_DIR=$(dirname $(readlink $BASH_SOURCE))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use inline_sh_binary instead of sh_binary, you can take advantage of Bazel make variables. Right now, this is highly non-hermetic, and runs over the non-sandboxed source tree

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.

3 participants