-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"warning: already initialized constant" with rack gem #100
Comments
I found this upstream issue with symlinked directories, which was fixed, but it seems Ruby still has issues when
This results in "b loaded" being printed twice. |
I opened a new upstream issue: https://bugs.ruby-lang.org/issues/17885. |
Great thanks for reporting it. I agree this is a Ruby issue, not the rules. In general I've been avoiding Does it make sense to keep this open, or can we close this issue? |
Do you think there's any possibility of working around the issue within rules_ruby? As it stands, at least one rather essential gem in the Ruby ecosystem uses |
So the result is that it breaks anything that relies on rack? Any chance you could submit a new example under the |
Looking for additional core maintainers: #146 |
Minimal reproduction: repro.zip
If you run
bazel run :main
in this workspace, you will get output which includes the following:I debugged a bit by placing a
puts caller
insiderack.rb
. It gets required via two call stacks:main.rb:1
, resolved as<outputBase>/execroot/__main__/bazel-out/darwin-fastbuild/bin/main.runfiles/bundle/lib/ruby/2.6.0/gems/rack-2.2.3/lib/rack.rb
require_relative
inrack/session/abstract/id.rb
, resolved as<outputBase>/external/bundle/lib/ruby/2.6.0/gems/rack-2.2.3/lib/rack.rb:20
It appears that
require_relative
is resolving the require relative to the resolved symlink location in bazel'sexternal
directory, rather than the runfiles location where the direct require was resolved to.The text was updated successfully, but these errors were encountered: