Summary: | dev-ruby/rdoc-3.12: fails to build (racc fails to load properly) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Peter Savichev (proton) <psavichev> |
Component: | New packages | Assignee: | Gentoo Ruby Team <ruby> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aladjev.andrew, betelgeuse, prefix, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=832268 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Log of irb+tracing trying to require 'racc/static'.
Running racc itself seems to result in an error tracing racc execution With a ~/bin/ruby shim Fixing the racc loading path Successfully installing rdoc! |
Description
Peter Savichev (proton)
2012-06-26 07:06:53 UTC
[I] dev-ruby/racc Available versions: 1.4.6 1.4.6-r1 ~1.4.8 {doc elibc_FreeBSD ruby_targets_jruby ruby_targets_ree18 ruby_targets_ruby18 ruby_targets_ruby19 test} Installed versions: 1.4.6-r1(10:59:13 26.06.2012)(ruby_targets_ruby19 -elibc_FreeBSD -ruby_targets_jruby -ruby_targets_ree18 -ruby_targets_ruby18 -test) Homepage: http://www.loveruby.net/en/racc.html Description: A LALR(1) parser generator for Ruby This looks like a problem with your racc install. Can you include the output from 'equery files racc' to verify that all files got installed? You might also want to try and reinstall racc to check if it was an intermittent install issue. Shouldn't happen, but who knows. It also looks like you are only using ruby19. We currently don't support that setup, we still expect /usr/bin/ruby to point to ruby18. >>This looks like a problem with your racc install. Can you include the output from 'equery files racc' to verify that all files got installed? https://gist.github.com/2998744 >>You might also want to try and reinstall racc to check if it was an intermittent install issue. Shouldn't happen, but who knows. I did it before posting bug >>It also looks like you are only using ruby19. We currently don't support that setup, we still expect /usr/bin/ruby to point to ruby18. Oh... Thanks. What's my next actions? (In reply to comment #3) > >>This looks like a problem with your racc install. Can you include the output from 'equery files racc' to verify that all files got installed? > > https://gist.github.com/2998744 That looks normal. > >>You might also want to try and reinstall racc to check if it was an intermittent install issue. Shouldn't happen, but who knows. > > I did it before posting bug > > >>It also looks like you are only using ruby19. We currently don't support that setup, we still expect /usr/bin/ruby to point to ruby18. > > Oh... Thanks. > What's my next actions? Try to find out why exactly racc won't load on your system. You might want to try and narrow down if the file isn't found or if the file can't be loaded. I'm sorry that I can't be more helpful, but I can't reproduce this (and I doubt it is related to only having ruby19 installed). This is still happening for me - I am using a clean Gentoo Prefix on OSX. Exact same error. I will try to discern what the problem is. Created attachment 341944 [details]
Log of irb+tracing trying to require 'racc/static'.
I ran irb with tracing and did a require rubygems, then a require racc. Here is the error for require 'racc'.
It can't find the file. I have no idea why.
(In reply to comment #6) > Created attachment 341944 [details] > Log of irb+tracing trying to require 'racc/static'. This log doesn't seem useful. racc/static.rb doens't contain any code but just loads a bunch of other files. It may be useful to see if you can load the individual files in it. Perhaps that narrows down the problem. If you are using prefix then you can also doublecheck that you are using the ruby supplied by prefix. Created attachment 342124 [details]
Running racc itself seems to result in an error
Here is a log of me doing the following things:
Enter prefix
set a safe path (I am trying to wean this system of homebrew)
echo $PATH
which ruby
which irb
echo $RUBYOPT
emerge rdoc
ruby -S racc
racc
which racc
eselect ruby list
Created attachment 342204 [details]
tracing racc execution
First error found while running dtruss (OSX version of strace, basically) on racc.
It looks like something is looking for ~/bin/ruby -- when that doesn't exist, racc dies.
Created attachment 342206 [details]
With a ~/bin/ruby shim
Adding a ~/bin/ruby shim, dtruss stops being useful to my untrained eyes, but racc still dies.
Created attachment 342208 [details]
Fixing the racc loading path
racc's path seems to not be loaded properly. Now, the good news is, I did a fresh Gentoo install on a virtual machine and racc installed without a problem. The bad news is, it does not work on a Gentoo prefix on OSX.
Attached are some edits I made to racc that brought us forward. Still not out of the hole... Hopefully you don't mind too much the flood of comments.
Created attachment 342214 [details]
Successfully installing rdoc!
The good news is, this obsoletes every other comment, apparently. Oh yeah, and it WORKS.
Unfortunately, these are changes made straight to the racc code - but really, they are changes to the load path.
I hope this helps you in figuring out how to fix this!
(In reply to comment #12) > > Unfortunately, these are changes made straight to the racc code - but > really, they are changes to the load path. > To get changes upstream here seems to be the current address to submit issues: https://github.com/tenderlove/racc/issues/new Btw I just stumbled on this issues on a machine that is not prefix. For me this was fixed by unsetting the following env variables: unset GEM_HOME GEM_PATH MY_RUBY_HOME The root env got polluted from them from the user I did su from (should clean that up). Maybe it makes sense to have some detection in the eclasses to prevent pebkac like this. rdoc-3.12 has been removed a while ago, please check again with rdoc-4. Hello. I think this issue is more serious than expected. Error message "cannot load such file -- racc/static (LoadError)" is too weak, it doesn't reveal what is happening. I've received same error while trying to use ruby26 on i686 system (racc 1.5.2-r1, rdoc 6.3.3-r1). ruby26 -e "require 'racc/compat'" >> cannot load such file -- racc/compat (LoadError) ruby26 -e "puts RbConfig::CONFIG['arch']" ruby26 -e "puts RbConfig::CONFIG['archdir']" >> i686-linux >> /usr/lib/ruby/2.6.0/i686-linux mv /usr/lib/ruby/gems/2.6.0/extensions/i686-linux /usr/lib/ruby/gems/2.6.0/extensions/x86-linux ruby26 -e "require 'racc/compat'" emerge -v1 rdoc > ok > ok We can see that old ruby 2.6 has some crazy bug that forces him to use "x86-linux" instead of "i686-linux". "x86-linux" folder should never be used as extensions source. This bug has been fixed somewhere between ruby 1.8 and ruby 2.7, ruby 2.7 and later 3.0 one has no such issue. I've grabbed tail of this bug: rm -r /usr/lib/ruby/gems/2.6.0/extensions/x86-linux ruby26 -e "require 'racc/compat'" > fail mkdir -p /usr/lib/ruby/gems/2.6.0/extensions/x86-linux/2.6.0/racc-1.5.2/ touch /usr/lib/ruby/gems/2.6.0/extensions/x86-linux/2.6.0/racc-1.5.2/gem.build_complete ruby26 -e "require 'racc/compat'" > ok emerge -v1 rdoc > ok So we can see that existence of just one single empty file "/usr/lib/ruby/gems/2.6.0/extensions/x86-linux/2.6.0/racc-1.5.2/gem.build_complete" provides success of kernel require. We can open ruby source v2_6_0 branch "lib/rubygems/specification.rb": ## # Is this specification missing its extensions? When this returns true you # probably want to build_extensions def missing_extensions? ... return false if File.exist? gem_build_complete_path ... end Than we can open "lib/rubygems/basic_specification.rb": def extensions_dir Gem.default_ext_dir_for(base_dir) || File.join(base_dir, 'extensions', Gem::Platform.local.to_s, Gem.extension_api_version) end This formula has never been changed between all ruby versions, this code comes from v2_1_0. Than I think we should use "Gem::Platform.local" instead of "RbConfig::CONFIG['arch']" for extensions directory, this formula is the most stable across versions. Ok, than I am going to create a pull request for eclass/ruby-fakegem.eclass fixing ruby_fakegem_extensionsdir replacing: echo "$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_value 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}" with: echo "$(ruby_fakegem_gemsdir)/extensions/$(ruby_gem_value 'Platform.local')/$(ruby_gem_value 'extension_api_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}" I may create pr tomorrow, today too busy. I've added a pull request here https://github.com/gentoo/gentoo/pull/23205. Fixed commit by adding sign of statement (as bot said), looks fine. I've tested fix on i686 system, it works fine. using the patch, re-emerging racc (stuff moves to usr/lib/ruby/gems/<vers>/gems/racc-1.5.2/lib/racc instead of the extensions path) and re-merging rdoc finally succeeds. (require 'racc/static' works, iso LoadError) Any thoughts on Andrew's patch here? It seems to fixes the problem for me (after re-emerging racc). Works on Solaris and Darwin here. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=977028cbd42c10e624205435f97f7f34ba2a8b29 commit 977028cbd42c10e624205435f97f7f34ba2a8b29 Author: Andrew Aladjev <aladjev.andrew@gmail.com> AuthorDate: 2021-12-06 21:44:43 +0000 Commit: Hans de Graaff <graaff@gentoo.org> CommitDate: 2022-02-06 07:08:43 +0000 eclass/ruby-fakegem.eclass: updated extensions dir according to formula from rubygems Closes: https://bugs.gentoo.org/423589 Closes: https://bugs.gentoo.org/832268 Signed-off-by: Andrew Aladjev <aladjev.andrew@gmail.com> Signed-off-by: Hans de Graaff <graaff@gentoo.org> eclass/ruby-fakegem.eclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) |