feat: introduce rb_bundle_fetch() repository rule#48
Merged
Conversation
ffce7f1 to
79d5bc6
Compare
rb_bundle_fetch() repository rule
p0deje
commented
Jan 9, 2024
p0deje
commented
Jan 9, 2024
alexeagle
reviewed
Jan 11, 2024
Collaborator
alexeagle
left a comment
There was a problem hiding this comment.
Generally looks pretty great!
p0deje
commented
Jan 12, 2024
966800e to
99320aa
Compare
p0deje
commented
Jan 13, 2024
3288c92 to
fb005f4
Compare
alexeagle
reviewed
Jan 15, 2024
| """ | ||
| Parses a Gemfile.lock purely in Starlark. | ||
|
|
||
| Largely based on https://github.com/sushain97/rules_ruby/blob/master/tools/ruby/gemfile_parser.bzl (private). |
alexeagle
approved these changes
Jan 15, 2024
| @@ -0,0 +1,191 @@ | |||
| """ | |||
| Parses a Gemfile.lock purely in Starlark. | |||
Collaborator
There was a problem hiding this comment.
did we also inherit some unit tests for this?
Member
Author
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
binpackage. For example:@bundle//:bin/rspec@bundle//bin:rspecFixes #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.