bazelruby / rules_ruby

Formerly canonical rules for ruby, that are about 2-3 years behind current Bazel. If they work for you great, but if not — please try the new rules ruby by Alex Radionov: https://github.com/bazel-contrib/rules_ruby
Apache License 2.0
99 stars 37 forks source link

Handle absolute extension paths #142

Closed cpederkoff-carbon closed 8 months ago

cpederkoff-carbon commented 1 year ago

Require_paths is not always a relative_path. When it is a path to a gem extension it is given to us as an absolute path like: /<bazel_cache_dir>/external/bundle/lib/ruby/2.7.0/extensions/x86_64-linux/2.7.0/pg-1.0.0 Previously this would be appended to gem_path and look like lib/ruby/2.7.0/gems/pg-1.0.0/<bazel_cache_dir>/external/bundle/lib/ruby/2.7.0/extensions/x86_64-linux/2.7.0/pg-1.0.0 which does not resolve to a real file. This new code converts that absolute path to a relative path from the expected directory and the output looks like: lib/ruby/2.7.0/extensions/x86_64-linux/2.7.0/pg-1.0.0

cpederkoff-carbon commented 1 year ago

Ping @yugui @kigster it looks like CircleCI is failing on the master branch https://app.circleci.com/pipelines/github/bazelruby/rules_ruby Not sure how to proceed.

kigster commented 1 year ago

I'll take a look at circle and then we can merge

kigster commented 8 months ago

Since #149 was merged, if you feel that using cleanpath is necessary, submit a PR that adds that.

Thanks!