diff --git a/README.adoc b/README.adoc index bc7fc9b7..d5cac3c6 100644 --- a/README.adoc +++ b/README.adoc @@ -10,20 +10,12 @@ :icons: font :license: apache -== Please Donate +== New Rules Ruby! -I need to go through a long backlog of items, but my hands are tied with paid projects. Please consider donating to expedite pull request merges. You can also apply to join to become one of the primary maintainers. +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 -https://liberapay.com/kigster/donate[image:https://liberapay.com/assets/widgets/donate.svg[Donate using Liberapay,height=30]]   https://liberapay.com/kigster/donate[image:https://img.shields.io/liberapay/goal/kigster.svg?logo=liberapay[https://img.shields.io/liberapay/goal/kigster,height=30]] -== Contributors Wanted - -This repo is primarily maintained by https://github.com/kigster[Konstantin Gredeskoul] and https://github.com/yugui[Yuki "Yugui" Sonoda]. - -We are both very busy and would really *love more contributors to join the core team*. - -If you are interested in developing Ruby Rules for Bazel, please submit a couple of PRs and then lets talk! TIP: You can read or print this README in a proper PDF format by grabbing our link:README.pdf[README.pdf]. @@ -216,7 +208,7 @@ ruby_rspec( specs = glob(["spec/**/*.rb"]), rspec_args = { "--format": "progress" }, deps = [":foo"] -} +) ---- ==== Package Ruby files as a Gem diff --git a/examples/simple_rails_api/Gemfile.lock b/examples/simple_rails_api/Gemfile.lock index 9da3cb42..a4ffd85a 100644 --- a/examples/simple_rails_api/Gemfile.lock +++ b/examples/simple_rails_api/Gemfile.lock @@ -60,13 +60,13 @@ GEM msgpack (~> 1.0) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) crass (1.0.6) erubi (1.10.0) ffi (1.15.4) - globalid (0.5.2) + globalid (1.0.1) activesupport (>= 5.0) - i18n (1.8.10) + i18n (1.12.0) concurrent-ruby (~> 1.0) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) @@ -80,7 +80,7 @@ GEM method_source (1.0.0) mini_mime (1.1.1) mini_portile2 (2.8.0) - minitest (5.14.4) + minitest (5.17.0) msgpack (1.4.2) nio4r (2.5.8) nokogiri (1.13.4) @@ -89,7 +89,7 @@ GEM puma (4.3.12) nio4r (~> 2.0) racc (1.6.0) - rack (2.2.3) + rack (2.2.3.1) rack-test (1.1.0) rack (>= 1.0, < 3) rails (6.0.4.1) @@ -136,12 +136,12 @@ GEM sqlite3 (1.4.2) thor (1.1.0) thread_safe (0.3.6) - tzinfo (1.2.9) + tzinfo (1.2.10) thread_safe (~> 0.1) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.4.2) + zeitwerk (2.6.6) PLATFORMS ruby diff --git a/ruby/private/bundle/create_bundle_build_file.rb b/ruby/private/bundle/create_bundle_build_file.rb index 74de1d2b..2dcc6d4a 100755 --- a/ruby/private/bundle/create_bundle_build_file.rb +++ b/ruby/private/bundle/create_bundle_build_file.rb @@ -84,6 +84,8 @@ Dir.glob("lib/#{RbConfig::CONFIG['RUBY_INSTALL_NAME']}/#{ruby_version}/specifications/#{gem_name}-#{gem_version}*.gemspec").first end +HERE = File.absolute_path '.' + require 'bundler' require 'json' require 'stringio' @@ -271,7 +273,15 @@ def register_gem(spec, template_out, bundle_lib_paths, bundle_binaries) # Usually, registering the directory paths listed in the `require_paths` of gemspecs is sufficient, but # some gems also require additional paths to be included in the load paths. require_paths += include_array(spec.name) - gem_lib_paths = require_paths.map { |require_path| File.join(gem_path, require_path) } + gem_lib_paths = require_paths.map do |require_path| + # Gems with native extensions (like ffi) will sometimes have elements of + # require_paths that are absolute rather than gem-path relative paths. + # It is incorrect to prepend those paths with the gem_path and Bazel will + # only allow relative paths as inputs to its glob() function. + pathname = Pathname.new(require_path) + pathname.absolute? ? pathname.relative_path_from(HERE).to_s : File.join(gem_path, require_path) + end + bundle_lib_paths.push(*gem_lib_paths) # paths to search for executables