Skip to content
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

Error parsing documentation when installing libxml-ruby-3.2.3 #193

Closed
xyzzy-plugh-plover opened this issue Oct 26, 2022 · 8 comments
Closed

Comments

@xyzzy-plugh-plover
Copy link

$ sudo gem install libxml-ruby 
Fetching libxml-ruby-3.2.3.gem
Building native extensions. This could take a while...
Successfully installed libxml-ruby-3.2.3
Parsing documentation for libxml-ruby-3.2.3
Before reporting this, could you check that the file you're documenting
has proper syntax:

  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -c ext/libxml/extconf.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

	(NoMethodError) undefined method `[]' for nil:NilClass

ERROR:  While executing gem ... (NoMethodError)
    undefined method `[]' for nil:NilClass

On macOS 12.6.1 with:

$ ruby --version
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin21]

$ gem --version
3.2.5

$ rdoc --version
6.4.0
@xyzzy-plugh-plover xyzzy-plugh-plover changed the title Error parsing documentation for libxml-ruby-3.2.3 Error parsing documentation when installing libxml-ruby-3.2.3 Oct 26, 2022
@cfis
Copy link
Member

cfis commented Oct 30, 2022

Hmm, not sure. I've never seen this and running rake rdoc I can't reproduce it.

@PierceLBrooks
Copy link
Contributor

PierceLBrooks commented May 24, 2023

I have been able to reproduce this on an Intel iMac with a Homebrew-installed LibXML package ( version 2.11.4 ):

Pierces-iMac:Development piercebrooks$ brew list --versions | grep libxml
libxml2 2.11.4
Pierces-iMac:Development piercebrooks$ sudo gem install libxml-ruby -- --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
Fetching libxml-ruby-4.1.1.gem
Building native extensions with: '--with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config'
This could take a while...
Successfully installed libxml-ruby-4.1.1
Parsing documentation for libxml-ruby-4.1.1
Before reporting this, could you check that the file you're documenting
has proper syntax:

  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -c ext/libxml/extconf.rb

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

	(NoMethodError) undefined method `[]' for nil:NilClass

ERROR:  While executing gem ... (NoMethodError)
    undefined method `[]' for nil:NilClass
Pierces-iMac:Development piercebrooks$ ruby --version
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin21]
Pierces-iMac:Development piercebrooks$ gem --version
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
3.0.3.1
Pierces-iMac:Development piercebrooks$ rdoc --version
6.1.2.1

@PierceLBrooks
Copy link
Contributor

I have been able to reproduce this on an Intel iMac with a Homebrew-installed LibXML package ( version 2.11.4 ):

This also occurs with my ARM M1 Macbook Pro that has pretty much identical versions of everything involved here.

@cfis
Copy link
Member

cfis commented May 25, 2023

Cool. Can you determine which file is causing it? Maybe just run rake just run rake rdoc ?

@PierceLBrooks
Copy link
Contributor

A simple rake command did not suffice, as it ended up being confused about some unit test require statements referring to libxml_ruby instead of libxml-ruby. I instead tried the bundle exec rake compile command from ~/libxml-ruby/.github/workflows/mri.yml, which caused the build to succeed. Afterwards, rake rdoc was able to execute successfully with no indication of which file is responsible for this issue. However the culprit is ultimately almost certainly ~/libxml-ruby/ext/libxml/extconf.rb. Perhaps an even better solution than my pull request would be to add another search path for external library & header inclusion according to a couple superdirectories above whichever directory is specified by the package installation user with --with-xml2-config.

@cfis
Copy link
Member

cfis commented May 30, 2023

Strange that it is fine on Windows and Linux. Seems to only happen on MacOS?

@nieder
Copy link

nieder commented Sep 6, 2023

Seems to be a ruby26 issue, because I get the same error installing the gem against ruby26, but it works with ruby27 and ruby32 using otherwise identical gem install commands and all 3rd party rubymods removed to avoid pollution.

/sw/bin/gem2.6 install \
	--local \
	--force \
	--verbose \
	--vendor \
	--platform=x86_64-apple-darwin \
	--build-root /sw/build.build/root-libxml2-rb26-4.1.1-1 \
	--document rdoc \
	--ignore-dependencies \
	libxml-ruby-4.1.1.gem \
	-- --with-xml2-config=/sw/bin/xml2-config

ruby26: 2.6.10p210
rdoc: 6.1.2.1
ruby27: 2.7.8p225
rdoc: 6.2.1.1
libxml2: v2.9.14

I'm also on macOS, but using Fink provided libraries and ruby.

ETA: libxml-ruby-4.1.1 also builds successfully with ruby2.5.

@cfis
Copy link
Member

cfis commented Jan 8, 2024

Since Ruby 2.6 is no longer supported (although I know MacOS ships with it), going to close this.

@cfis cfis closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants