From aaa7949fecf32a1f7059fd4895131fb94b8416eb Mon Sep 17 00:00:00 2001 From: Jason Lunn Date: Fri, 14 Jul 2023 10:26:58 -0400 Subject: [PATCH 1/4] Handle absolute paths in required_paths --- ruby/private/bundle/create_bundle_build_file.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 From 40f403adc542b20d05801f52152ae6ceb8754b92 Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Tue, 28 Nov 2023 03:16:31 -0800 Subject: [PATCH 2/4] Update README.adoc --- README.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.adoc b/README.adoc index bc7fc9b7..ceec91bd 100644 --- a/README.adoc +++ b/README.adoc @@ -10,6 +10,8 @@ :icons: font :license: apache +CAUTION: 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/p0deje/rules_ruby + == Please Donate 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. From ecefcd0861c630a3e3ad597a5c8649faea14b242 Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Wed, 13 Dec 2023 12:25:04 -0800 Subject: [PATCH 3/4] Removing donations and emphasizing the new rules --- README.adoc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/README.adoc b/README.adoc index ceec91bd..5dab5592 100644 --- a/README.adoc +++ b/README.adoc @@ -10,23 +10,13 @@ :icons: font :license: apache -CAUTION: 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/p0deje/rules_ruby +== New Rules Ruby! -== Please Donate +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 -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. -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]. From 7ace2b7a804c3a7d42b325bad01ba14c6a49921a Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa <583144+Morriar@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:24:42 -0500 Subject: [PATCH 4/4] Fix typo in README code examples Replacing `}` by `)`. --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 5dab5592..d5cac3c6 100644 --- a/README.adoc +++ b/README.adoc @@ -208,7 +208,7 @@ ruby_rspec( specs = glob(["spec/**/*.rb"]), rspec_args = { "--format": "progress" }, deps = [":foo"] -} +) ---- ==== Package Ruby files as a Gem