Skip to content

Commit 99db0a6

Browse files
authored
Merge branch 'master' into dependabot/bundler/examples/simple_rails_api/globalid-1.0.1
2 parents 8e7f62f + 8a03f6c commit 99db0a6

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

README.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
:icons: font
1111
:license: apache
1212

13+
== New Rules Ruby!
1314

14-
== Contributors Wanted
15+
This repo will be retired eventually, as these rules have not been actively maintained and are in the process of being replaced by the new rules, which you can find here: https://github.com/bazel-contrib/rules_ruby
1516

16-
This repo is primarily maintained by https://github.com/kigster[Konstantin Gredeskoul] and https://github.com/yugui[Yuki "Yugui" Sonoda].
1717

18-
We are both very busy and would really *love more contributors to join the core team*.
1918

20-
If you are interested in developing Ruby Rules for Bazel, please submit a couple of PRs and then lets talk!
2119

2220

2321
TIP: You can read or print this README in a proper PDF format by grabbing our link:README.pdf[README.pdf].
@@ -210,7 +208,7 @@ ruby_rspec(
210208
specs = glob(["spec/**/*.rb"]),
211209
rspec_args = { "--format": "progress" },
212210
deps = [":foo"]
213-
}
211+
)
214212
----
215213

216214
==== Package Ruby files as a Gem

ruby/private/bundle/create_bundle_build_file.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
Dir.glob("lib/#{RbConfig::CONFIG['RUBY_INSTALL_NAME']}/#{ruby_version}/specifications/#{gem_name}-#{gem_version}*.gemspec").first
8585
end
8686

87+
HERE = File.absolute_path '.'
88+
8789
require 'bundler'
8890
require 'json'
8991
require 'stringio'
@@ -271,7 +273,15 @@ def register_gem(spec, template_out, bundle_lib_paths, bundle_binaries)
271273
# Usually, registering the directory paths listed in the `require_paths` of gemspecs is sufficient, but
272274
# some gems also require additional paths to be included in the load paths.
273275
require_paths += include_array(spec.name)
274-
gem_lib_paths = require_paths.map { |require_path| File.join(gem_path, require_path) }
276+
gem_lib_paths = require_paths.map do |require_path|
277+
# Gems with native extensions (like ffi) will sometimes have elements of
278+
# require_paths that are absolute rather than gem-path relative paths.
279+
# It is incorrect to prepend those paths with the gem_path and Bazel will
280+
# only allow relative paths as inputs to its glob() function.
281+
pathname = Pathname.new(require_path)
282+
pathname.absolute? ? pathname.relative_path_from(HERE).to_s : File.join(gem_path, require_path)
283+
end
284+
275285
bundle_lib_paths.push(*gem_lib_paths)
276286

277287
# paths to search for executables

ruby/private/sdk.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def rules_ruby_select_sdk(version = "host"):
2323
"3.1.0",
2424
"3.1.1",
2525
"3.1.2",
26+
"3.2.0",
2627
]
2728

2829
if version in supported_versions:

0 commit comments

Comments
 (0)