-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: introduce rb_bundle_fetch()
repository rule
#48
Conversation
ffce7f1
to
79d5bc6
Compare
rb_bundle_fetch()
repository rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks pretty great!
966800e
to
99320aa
Compare
3288c92
to
fb005f4
Compare
""" | ||
Parses a Gemfile.lock purely in Starlark. | ||
|
||
Largely based on https://github.com/sushain97/rules_ruby/blob/master/tools/ruby/gemfile_parser.bzl (private). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sushain97 !
@@ -0,0 +1,191 @@ | |||
""" | |||
Parses a Gemfile.lock purely in Starlark. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we also inherit some unit tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there were no unit tests.
This repository rule deprecates existing `rb_bundle()` and provides a number of benefits over existing implementation: 1. Hermeticity of `bundle install` - it's run as a regular rule. 2. Ruby toolchain no longer needs to be installed during WORKSPACE loading. 2. Downloading of gems is taken care of by Bazel. This also means that gems are stored in a repository cache. 3. RBE is potentially supported (at least with JRuby). The new rule however is not complete yet and lacks few important features that will be added later. 1. Support for gems installed from Git repositories. 2. Support for checksums introduced in Bundler 2.50. For most cases, the migration from `rb_bundle()` to `rb_bundle_fetch()` is straightforward - use the same parameters with an extra `gemfile_lock`. The main breaking change is that your targets that used to depend on Bundler binstubs a new `bin` package. For example: | rb_bundle() | rb_bundle_fetch | |---------------------|--------------------| | @bundle//:bin/rspec | @bundle//bin:rspec |
46eb1ee
to
47a3a51
Compare
This repository rule deprecates existing
rb_bundle()
and provides anumber of benefits over existing implementation:
bundle install
- it's run as a regular rule.loading.
gems are stored in a repository cache.
The new rule however is not complete yet and lacks few important
features that will be added later.
For most cases, the migration from
rb_bundle()
torb_bundle_fetch()
is straightforward - use the same parameters with an extra
gemfile_lock
.The main breaking change is that your targets that used to depend on
Bundler binstubs a new
bin
package. For example:@bundle//:bin/rspec
@bundle//bin:rspec
Fixes #16 and #45.
UPD: I just made Selenium CI pass using
rb_bundle_fetch()
so IMO this is good enough to merge and improve over time - SeleniumHQ/selenium#13422.