Skip to content

Conversation

@tempoz
Copy link

@tempoz tempoz commented Sep 4, 2024

Documented here: https://idiosyncratic-ruby.com/42-ruby-config.html

Without this patch, I get:

create_bundle_build_file.rb:208:in `initialize': Cannot find directory named 3.1.0 within lib/ruby3.1 (RuntimeError)
        from create_bundle_build_file.rb:351:in `new'
        from create_bundle_build_file.rb:351:in `<main>'
INFO: Repository protobuf_bundle instantiated at:
  /home/zoey/src/software/protobuf/WORKSPACE:140:12: in <toplevel>
Repository rule ruby_bundle defined at:
  /home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/system_ruby/bundle.bzl:8:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'protobuf_bundle':
   Traceback (most recent call last):
        File "/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/system_ruby/bundle.bzl", line 6, column 21, in _ruby_bundle_impl
                ruby_bundle_impl(ctx, "/usr/bin/ruby3.1")
        File "/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/rules_ruby/ruby/private/bundle/def.bzl", line 220, column 31, in ruby_bundle_impl
                generate_bundle_build_file(runtime_ctx, result)
        File "/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/rules_ruby/ruby/private/bundle/def.bzl", line 174, column 13, in generate_bundle_build_file
                fail("build file generation failed: %s%s" % (result.stdout, result.stderr))
Error in fail: build file generation failed: create_bundle_build_file.rb:208:in `initialize': Cannot find directory named 3.1.0 within lib/ruby3.1 (RuntimeError)
        from create_bundle_build_file.rb:351:in `new'
        from create_bundle_build_file.rb:351:in `<main>'
ERROR: no such package '@@protobuf_bundle//': build file generation failed: create_bundle_build_file.rb:208:in `initialize': Cannot find directory named 3.1.0 within lib/ruby3.1 (RuntimeError)
        from create_bundle_build_file.rb:351:in `new'
        from create_bundle_build_file.rb:351:in `<main>'
ERROR: /home/zoey/src/software/protobuf/ruby/lib/google/BUILD.bazel:63:13: //ruby/lib/google:protobuf_lib depends on @@protobuf_bundle//:bigdecimal in repository @@protobuf_bundle which failed to fetch. no such package '@@protobuf_bundle
//': build file generation failed: create_bundle_build_file.rb:208:in `initialize': Cannot find directory named 3.1.0 within lib/ruby3.1 (RuntimeError)
        from create_bundle_build_file.rb:351:in `new'
        from create_bundle_build_file.rb:351:in `<main>'
ERROR: Analysis of target '//ruby/lib/google:protobuf_lib' failed; build aborted: Analysis failed
INFO: Elapsed time: 16.822s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

and if I only change enough to fix that specific error, I get:

/usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `initialize': no implicit conversion of nil into String (TypeError)
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open'
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open_file'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:114:in `data'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:173:in `extensions'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:331:in `have_extensions?'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:248:in `require_paths'
        from create_bundle_build_file.rb:277:in `register_gem'
        from create_bundle_build_file.rb:232:in `block in generate!'
        from create_bundle_build_file.rb:232:in `each'
        from create_bundle_build_file.rb:232:in `generate!'
        from create_bundle_build_file.rb:356:in `<main>'
INFO: Repository protobuf_bundle instantiated at:
  /home/zoey/src/software/protobuf/WORKSPACE:140:12: in <toplevel>
Repository rule ruby_bundle defined at:
  /home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/system_ruby/bundle.bzl:8:30: in <toplevel>
ERROR: An error occurred during the fetch of repository 'protobuf_bundle':
   Traceback (most recent call last):
        File "/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/system_ruby/bundle.bzl", line 6, column 21, in _ruby_bundle_impl
                ruby_bundle_impl(ctx, "/usr/bin/ruby3.1")
        File "/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/rules_ruby/ruby/private/bundle/def.bzl", line 220, column 31, in ruby_bundle_impl
                generate_bundle_build_file(runtime_ctx, result)
        File "/home/zoey/.cache/bazel/_bazel_zoey/48c075afba7cdea78ebdc9043475bc88/external/rules_ruby/ruby/private/bundle/def.bzl", line 174, column 13, in generate_bundle_build_file
                fail("build file generation failed: %s%s" % (result.stdout, result.stderr))
Error in fail: build file generation failed: /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `initialize': no implicit conversion of nil into String (TypeError)
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open'
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open_file'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:114:in `data'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:173:in `extensions'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:331:in `have_extensions?'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:248:in `require_paths'
        from create_bundle_build_file.rb:277:in `register_gem'
        from create_bundle_build_file.rb:232:in `block in generate!'
        from create_bundle_build_file.rb:232:in `each'
        from create_bundle_build_file.rb:232:in `generate!'
        from create_bundle_build_file.rb:356:in `<main>'
ERROR: no such package '@@protobuf_bundle//': build file generation failed: /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `initialize': no implicit conversion of nil into String (TypeError)
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open'
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open_file'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:114:in `data'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:173:in `extensions'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:331:in `have_extensions?'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:248:in `require_paths'
        from create_bundle_build_file.rb:277:in `register_gem'
        from create_bundle_build_file.rb:232:in `block in generate!'
        from create_bundle_build_file.rb:232:in `each'
        from create_bundle_build_file.rb:232:in `generate!'
        from create_bundle_build_file.rb:356:in `<main>'
ERROR: /home/zoey/src/software/protobuf/ruby/tests/BUILD.bazel:65:10: //ruby/tests:gc_test depends on @@protobuf_bundle//:test-unit in repository @@protobuf_bundle which failed to fetch. no such package '@@protobuf_bundle//': build file generation failed: /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `in
itialize': no implicit conversion of nil into String (TypeError)
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open'
        from /usr/lib/ruby/vendor_ruby/rubygems.rb:786:in `open_file'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:114:in `data'
        from /usr/lib/ruby/vendor_ruby/rubygems/stub_specification.rb:173:in `extensions'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:331:in `have_extensions?'
        from /usr/lib/ruby/vendor_ruby/rubygems/basic_specification.rb:248:in `require_paths'
        from create_bundle_build_file.rb:277:in `register_gem'
        from create_bundle_build_file.rb:232:in `block in generate!'
        from create_bundle_build_file.rb:232:in `each'
        from create_bundle_build_file.rb:232:in `generate!'
        from create_bundle_build_file.rb:356:in `<main>'
ERROR: Analysis of target '//ruby/tests:gc_test' failed; build aborted: Analysis failed
INFO: Elapsed time: 15.767s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

when trying to build https://github.com/protocolbuffers/protobuf

tempoz added a commit to tempoz/protobuf that referenced this pull request Sep 11, 2024
@JasonLunn JasonLunn added the question Further information is requested label Sep 26, 2024
@JasonLunn JasonLunn merged commit 38cc4e0 into protocolbuffers:main Oct 11, 2024
2 checks passed
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 11, 2024
See protocolbuffers/rules_ruby#38. This fixes the ruby portion of the protocolbuffers build for me.

Closes #18233

COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
FUTURE_COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
PiperOrigin-RevId: 684950047
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 11, 2024
See protocolbuffers/rules_ruby#38. This fixes the ruby portion of the protocolbuffers build for me.

Closes #18233

COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
FUTURE_COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
PiperOrigin-RevId: 684950047
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 11, 2024
See protocolbuffers/rules_ruby#38. This fixes the ruby portion of the protocolbuffers build for me.

Closes #18233

COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
FUTURE_COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
PiperOrigin-RevId: 684950047
copybara-service bot pushed a commit to protocolbuffers/protobuf that referenced this pull request Oct 11, 2024
See protocolbuffers/rules_ruby#38. This fixes the ruby portion of the protocolbuffers build for me.

Closes #18233

COPYBARA_INTEGRATE_REVIEW=#18233 from tempoz:tempoz-ruby-fix 2aee6e1
PiperOrigin-RevId: 684969223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants