-
Notifications
You must be signed in to change notification settings - Fork 32
Upstream changes from Selenium's fork #118
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
Changes from all commits
b7574c4
9ed01cb
69faf99
976ee03
299c4d8
4b1c480
36893fe
7f192df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,8 +143,16 @@ ruby_bundle( | |
| # You can specify more than one bundle in the WORKSPACE file | ||
| ruby_bundle( | ||
| name = "bundle_app_shopping", | ||
| gemfile = "//apps/shopping:Gemfile", | ||
| gemfile_lock = "//apps/shopping:Gemfile.lock", | ||
| gemfile = "//:apps/shopping/Gemfile", | ||
| gemfile_lock = "//:apps/shopping/Gemfile.lock", | ||
| ) | ||
|
|
||
| # You can also install from Gemfile using `gemspec`. | ||
| ruby_bundle( | ||
| name = "bundle_gemspec", | ||
| srcs = ["//:lib/my_gem/my_gem.gemspec"], | ||
| gemfile = "//:lib/my_gem/Gemfile", | ||
| gemfile_lock = "//:lib/my_gem/Gemfile.lock", | ||
| ) | ||
| ---- | ||
|
|
||
|
|
@@ -477,6 +485,7 @@ ruby_bundle( | |
| bundler_version = "2.1.4", | ||
| includes = {}, | ||
| excludes = {}, | ||
| srcs = [], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did we not have src here before?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added this attribute. |
||
| vendor_cache = False, | ||
| ruby_sdk = "@org_ruby_lang_ruby_toolchain", | ||
| ruby_interpreter = "@org_ruby_lang_ruby_toolchain//:ruby", | ||
|
|
@@ -497,12 +506,17 @@ A unique name for this rule. | |
| The `Gemfile` which Bundler runs with. | ||
|
|
||
| |`gemfile_lock` a| | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be now called
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. I'll fix it so that it still respects
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just pushed fixup commit 7f192df which addresses this and actually makes less changes to existing. If it's good, I'll rebase and squash the commits together. |
||
| `Label, required` | ||
| `Label, optional` | ||
|
|
||
| The `Gemfile.lock` which Bundler runs with. | ||
|
|
||
| NOTE: This rule never updates the `Gemfile.lock`. It is your responsibility to generate/update `Gemfile.lock` | ||
|
|
||
| |`srcs` a| | ||
| `List of Labels, optional` | ||
|
|
||
| List of additional files required for Bundler to install gems. This could usually include `*.gemspec` files. | ||
|
|
||
| |`vendor_cache` a| | ||
| `Bool, optional` | ||
|
|
||
|
|
@@ -529,10 +543,6 @@ List of glob patterns per gem to be excluded from the library. Keys are the name | |
| |=== | ||
|
|
||
|
|
||
| ==== Limitations | ||
|
|
||
| Installing using a `Gemfile` that uses the `gemspec` keyword is not currently supported. | ||
|
|
||
| ==== Conventions | ||
|
|
||
| `ruby_bundle` creates several targets that can be used downstream. In the examples below we assume that your `ruby_bundle` has a name `app_bundle`: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,24 +60,28 @@ | |
|
|
||
| # For ordinary gems, this path is like 'lib/ruby/3.0.0/gems/rspec-3.10.0'. | ||
| # For gems with native extension installed via prebuilt packages, the last part of this path can | ||
| # contain an OS-specific suffix like 'grpc-1.38.0-universal-darwin' or 'grpc-1.38.0-x86_64-linux' | ||
| # contain an OS-specific suffix like 'grpc-1.38.0-universal-darwin' or 'grpc-1.38.0-x86_64-linux' | ||
| # instead of 'grpc-1.38.0'. | ||
| # | ||
| # Since OS platform is unlikely to change between Bazel builds on the same machine, | ||
| # | ||
| # Since OS platform is unlikely to change between Bazel builds on the same machine, | ||
| # `#{gem_name}-#{gem_version}*` would be sufficient to narrow down matches to at most one. | ||
| # | ||
| # Library path differs across implementations as `lib/ruby` on MRI and `lib/jruby` on JRuby. | ||
| GEM_PATH = ->(ruby_version, gem_name, gem_version) do | ||
| Dir.glob("lib/ruby/#{ruby_version}/gems/#{gem_name}-#{gem_version}*").first | ||
| Dir.glob("lib/#{RbConfig::CONFIG['RUBY_INSTALL_NAME']}/#{ruby_version}/gems/#{gem_name}-#{gem_version}*").first | ||
| end | ||
|
|
||
| # For ordinary gems, this path is like 'lib/ruby/3.0.0/specifications/rspec-3.10.0.gemspec'. | ||
| # For gems with native extension installed via prebuilt packages, the last part of this path can | ||
| # contain an OS-specific suffix like 'grpc-1.38.0-universal-darwin.gemspec' or | ||
| # contain an OS-specific suffix like 'grpc-1.38.0-universal-darwin.gemspec' or | ||
| # 'grpc-1.38.0-x86_64-linux.gemspec' instead of 'grpc-1.38.0.gemspec'. | ||
| # | ||
| # Since OS platform is unlikely to change between Bazel builds on the same machine, | ||
| # `#{gem_name}-#{gem_version}*.gemspec` would be sufficient to narrow down matches to at most one. | ||
| # | ||
| # Library path differs across implementations as `lib/ruby` on MRI and `lib/jruby` on JRuby. | ||
| SPEC_PATH = ->(ruby_version, gem_name, gem_version) do | ||
| Dir.glob("lib/ruby/#{ruby_version}/specifications/#{gem_name}-#{gem_version}*.gemspec").first | ||
| Dir.glob("lib/#{RbConfig::CONFIG['RUBY_INSTALL_NAME']}/#{ruby_version}/specifications/#{gem_name}-#{gem_version}*.gemspec").first | ||
| end | ||
|
|
||
| require 'bundler' | ||
|
|
@@ -247,6 +251,9 @@ def remove_bundler_version! | |
| end | ||
|
|
||
| def register_gem(spec, template_out, bundle_lib_paths, bundle_binaries) | ||
| # Do not register local gems | ||
| return if spec.source.path? | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain that line?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not possible to register local gems as they are not linking to |
||
|
|
||
| gem_path = GEM_PATH[ruby_version, spec.name, spec.version] | ||
| spec_path = SPEC_PATH[ruby_version, spec.name, spec.version] | ||
| base_dir = "lib/ruby/#{ruby_version}" | ||
|
|
||
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.
Can you explain why the : is needed?
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.
I think the original documentation is not working because the colon should preceed directory name. At least that's what I had to do in Selenium where all Ruby code lives in
rbdirectory (https://github.com/SeleniumHQ/selenium/blob/trunk/WORKSPACE#L286):