rules_ruby icon indicating copy to clipboard operation
rules_ruby copied to clipboard

Generated BUILD.bazel files should use `allow_empty`

Open shahms opened this issue 4 years ago • 3 comments

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.

shahms avatar Mar 01 '21 16:03 shahms

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

kigster avatar Jul 08 '21 18:07 kigster

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>'

shahms avatar Apr 12 '23 23:04 shahms

(Which may also be glob related as it seems the SPEC_PATH is what's nil)

shahms avatar Apr 13 '23 00:04 shahms