rules_ruby
rules_ruby copied to clipboard
Generated BUILD.bazel files should use `allow_empty`
Some Gems result in an empty glob inside the generated BUILD files, which causes Bazel to fail. Generated globs which may be empty should probably pass allow_empty = True to the glob() function. This is notably a problem for nokogiri.
Do you have an example or a repro case?
Perhaps you can add Nokogiri to the Gemfile in examples/simple_script and if you are right then it should fail on CI
I can't even get that far any more as now I'm hitting:
/usr/lib/ruby/vendor_ruby/rubygems.rb:783:in `initialize': no implicit conversion of nil into String (TypeError)
from /usr/lib/ruby/vendor_ruby/rubygems.rb:783:in `open'
from /usr/lib/ruby/vendor_ruby/rubygems.rb:783:in `open_file'
from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:113:in `data'
from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:169:in `extensions'
from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:330:in `have_extensions?'
from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:247:in `require_paths'
from create_bundle_build_file.rb:270:in `register_gem'
from create_bundle_build_file.rb:215:in `block in generate!'
from create_bundle_build_file.rb:215:in `each'
from create_bundle_build_file.rb:215:in `generate!'
from create_bundle_build_file.rb:350:in `<main>'
(Which may also be glob related as it seems the SPEC_PATH is what's nil)