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

Support the Nokogiri gem #62

Closed
chrisseaton opened this issue Feb 15, 2017 · 27 comments
Closed

Support the Nokogiri gem #62

chrisseaton opened this issue Feb 15, 2017 · 27 comments
Assignees
Milestone

Comments

@chrisseaton
Copy link
Collaborator

chrisseaton commented Feb 15, 2017

We need to support Nokogiri, particular as it's used so much in testing gems. As with openssl (#61) we are using Sulong as described in our RubyConf talk Ruby's C Extension Problem and How We're Fixing It.

Current status:
It should just work, TruffleRuby passes all Nokogiri tests, and by default TruffleRuby installs nokogiri with the packaged libxml2/libxslt like on CRuby. The only difference is that prebuilt binary gems are not available for TruffleRuby currently. One can also use --use-system-libraries if they like, but it's not faster, especially if those system libraries need to be installed.

Older status:
We now support Nokogiri, but it always uses a shared installation of libxml2, and so you need the libxml2 headers (and libraries) on the system (e.g., apt-get install libxml2-dev libxslt-dev on Debian-based).

On GitHub Actions, that means you need:

    - run: sudo apt-get -yqq install libxml2-dev libxslt-dev
      if: startsWith(matrix.ruby, 'truffleruby')
# before
    - uses: ruby/setup-ruby@v1

If you use ruby/setup-ruby with bundler-cache: true, then that is automatically done by setup-ruby:

    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: truffleruby
        bundler-cache: true # automatically installs libxml2-dev libxslt-dev if nokogiri is in the lockfile

At some point we hope to be able to support building the in-tree libxml2 library like is done on MRI.

@sbehrens
Copy link

how's this coming along? any progress on nokogiri or openssl?

@ylluminate
Copy link

@sbehrens I believe this primarily depends on the OpenSSL support issue that appears to be nearly sorted out. As I understood it, since OpenSSL was precursory to this and facilitates Sulong testing / experience, then this would be coming next and probably be a bit quicker to implement. Please definitely correct me if I'm wrong or add details @chrisseaton!

I've not had much time lately to follow his progress on these unfortunately.

@chrisseaton
Copy link
Collaborator Author

Yes nothing new to report here, but openssl support will be shipping soon.

@aardvark179
Copy link
Contributor

I'm working on nokogiri at the moment.

With some patching it is now partially working, though I'm still going through tests and fixing issues. Mostly these are to do with accessing some properties of document nodes after the document has been parsed and the tree built.

We currently need to use a native shared lib version of libxml2 which is quite fragile as libxml2 was not designed with multiple users in mind. It would be better for a release to either run the whole of libxml2 under sulong, have a way to link to a static lib stored in the .su archive, or perform some symbol transformation so nokogiri can use a separate copy from anything else in the system.

@ylluminate
Copy link

Have you looked at running libxml2 entirely under sulong yet? That leaves me with the impression of being the best path...

@nirvdrum
Copy link
Collaborator

We now support Nokogiri, but only with a shared installation of libxml2. This means you'll need to configure Bundler to build Nokogiri that way with bundle config build.nokogiri --use-system-libraries. At some point we hope to be able to support building the in-tree libxml2 library like is done on MRI.

@ylluminate
Copy link

What great news @nirvdrum! That means we're pretty darn close to full Rails support, right?

Also, where can we find status for Truffle with Ruby managers such as rvm? Seems to be a bit of convolution with previous issues from when this was on ruby to here and finding where things really presently stand. Still not seeing a clear rvm install truffle path available and I think this is pretty critical to really get everyone to start dabbling with and testing truffle.

@thbar
Copy link
Contributor

thbar commented Jan 31, 2018

I second what @ylluminate said - having rvm supporting truffle will likely increase exposure, tests & reports. Can't wait to have that 😄

@ThomasKoppensteiner
Copy link

@ylluminate there was already a discussion about the integration into ruby version managers. SEE: #9

@ylluminate
Copy link

ylluminate commented Feb 1, 2018

Yes @ThomasKoppensteiner thus my mentioning it here and thanks for bringing that thread back up. Note the date on that thread and the need for attention. We most certainly can carry on with this topic over there, but with being where things are presently with Truffle, I can't see any other subject being as important as this at this point. Just getting hands around it (conveniently & reliably since folks are not, en masse, prone to manual building) and getting it out there seem to be paramount as @thbar also seems to allude to in his comment.

@brauliobo
Copy link
Contributor

Got this error while running gem install nokogiri:

~/P/o/scripts ❯❯❯ gem install nokogiri                                                                                                                                       master ◼ 
Fetching: mini_portile2-2.3.0.gem (100%)                                                                                                                                              
Successfully installed mini_portile2-2.3.0                                                                                                                                            
Fetching: nokogiri-1.8.2.gem (100%)                                                                                                                                                   
[truffle] opt fail         #clock_gettime resource:/truffleruby/core/process.rb:116    |Reason org.graalvm.compiler.code.SourceStackTraceBailoutException$1: Object of type Lorg/graal
vm/compiler/truffle/runtime/FrameWithoutBoxing; should not be materialized (must not pass virtual object into an invoke that cannot be inlined):                                      
org.graalvm.compiler.code.SourceStackTraceBailoutException$1: Object of type Lorg/graalvm/compiler/truffle/runtime/FrameWithoutBoxing; should not be materialized (must not pass virtual object into an invoke that cannot be inlined):                                                                                                                                     
        at org.truffleruby.builtins.InvokePrimitiveNode.execute(InvokePrimitiveNode.java:33)                                                                                          
        at org.truffleruby.core.inlined.InlinedMulNodeGen.execute(InlinedMulNodeGen.java:46)                                                                                          
        at org.truffleruby.language.locals.WriteLocalVariableNode.execute(WriteLocalVariableNode.java:36)                                                                             
        at org.truffleruby.language.control.IfElseNode.execute(IfElseNode.java:35) 
        at org.truffleruby.language.control.IfElseNode.execute(IfElseNode.java:37)                                                                                            [27/259]
        at org.truffleruby.language.RubyNode.doExecuteVoid(RubyNode.java:39)                                                                                                         
        at org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:31)
        at org.truffleruby.language.methods.CatchForMethodNode.execute(CatchForMethodNode.java:38)
        at org.truffleruby.language.methods.ExceptionTranslatingNode.execute(ExceptionTranslatingNode.java:51)
        at org.truffleruby.language.LazyRubyNode.execute(LazyRubyNode.java:42)         
        at org.truffleruby.language.RubyRootNode.execute(RubyRootNode.java:50)        
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:260)
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:249)
Caused by: org.graalvm.compiler.graph.VerificationError: Object of type Lorg/graalvm/compiler/truffle/runtime/FrameWithoutBoxing; should not be materialized (must not pass virtual object into an invoke that cannot be inlined):                              
        at java.lang.Throwable.<init>(Throwable.java:265)                 
        at java.lang.Error.<init>(Error.java:70)                                       
        at org.graalvm.compiler.debug.GraalError.<init>(GraalError.java:157)      
        at org.graalvm.compiler.graph.GraalGraphError.<init>(GraalGraphError.java:46)  
        at org.graalvm.compiler.graph.VerificationError.<init>(VerificationError.java:43)                                                                                            
        at org.graalvm.compiler.nodes.virtual.EnsureVirtualizedNode.ensureVirtualFailure(EnsureVirtualizedNode.java:96)                                                              
        at org.graalvm.compiler.nodes.virtual.CommitAllocationNode.lower(CommitAllocationNode.java:115)                                                                              
        at org.graalvm.compiler.phases.common.LoweringPhase$Round.process(LoweringPhase.java:460)                                                                                    
        at org.graalvm.compiler.phases.common.LoweringPhase$Round.access$200(LoweringPhase.java:336)
        at org.graalvm.compiler.phases.common.LoweringPhase$Round$ProcessFrame.preprocess(LoweringPhase.java:400)                                                                    
        at org.graalvm.compiler.phases.common.LoweringPhase.processBlock(LoweringPhase.java:559)                                                                                     
        at org.graalvm.compiler.phases.common.LoweringPhase$Round.run(LoweringPhase.java:385)                                                                                        
        at org.graalvm.compiler.phases.Phase.run(Phase.java:47)                   
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:195)
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:137)                
        at org.graalvm.compiler.phases.PhaseSuite.run(PhaseSuite.java:210)                
        at org.graalvm.compiler.phases.common.IncrementalCanonicalizerPhase.run(IncrementalCanonicalizerPhase.java:54)
        at org.graalvm.compiler.phases.common.IncrementalCanonicalizerPhase.run(IncrementalCanonicalizerPhase.java:36)
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:195)                                                                                                           
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:137)                                                                                                                    at org.graalvm.compiler.phases.common.LoweringPhase.lower(LoweringPhase.java:256) 
        at org.graalvm.compiler.phases.common.LoweringPhase.run(LoweringPhase.java:249)
        at org.graalvm.compiler.phases.common.LoweringPhase.run(LoweringPhase.java:89)
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:195)
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:137)
        at org.graalvm.compiler.phases.PhaseSuite.run(PhaseSuite.java:210)
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:195)                                                                                                           
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:137)
        at org.graalvm.compiler.core.GraalCompiler.emitFrontEnd(GraalCompiler.java:247)
        at org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:174)
        at org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:160)
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compilePEGraph(TruffleCompilerImpl.java:445)                                                                    
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compileAST(TruffleCompilerImpl.java:391)                                                                        
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:544)                                      
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:493)                                      
        at org.graalvm.compiler.core.CompilationWrapper.run(CompilationWrapper.java:167)
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.doCompile(TruffleCompilerImpl.java:222)                                                                         
        at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime.doCompile(GraalTruffleRuntime.java:679)                                                                          
        at org.graalvm.compiler.truffle.runtime.GraalTruffleRuntime$1.run(GraalTruffleRuntime.java:745)                                                                              
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        at org.graalvm.compiler.core.CompilerThread.run(CompilerThread.java:40)
        at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:222)                                                                          
        at Lcom/oracle/svm/core/code/CEntryPointCallStubs;.com_002eoracle_002esvm_002ecore_002eposix_002ethread_002ePosixJavaThreads_002epthreadStartRoutine_0028com_002eoracle_002esvm_002ecore_002eposix_002ethread_002ePosixJavaThreads_0024ThreadStartData_0029(generated:0)

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    current directory: /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.2/ext/nokogiri
/home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/bin/truffleruby -r ./siteconf20180419-32296-1xuv5v8.rb extconf.rb
/home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/rbconfig-for-mkmf.rb:33:in `block in <top (required)>': unsupported clang version: 6.0.0 - see doc/user/installing-llvm.md (RuntimeError)
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/rbconfig-for-mkmf.rb:19:in `each'
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/rbconfig-for-mkmf.rb:19:in `<top (required)>'
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/truffle/lazy-rubygems.rb:20:in `gem_original_require'
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/truffle/lazy-rubygems.rb:20:in `require'
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/mri/mkmf.rb:11:in `<top (required)>'
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/truffle/lazy-rubygems.rb:20:in `gem_original_require'
        from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/truffle/lazy-rubygems.rb:20:in `require'
        from extconf.rb:4:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.2 for inspection.
Results logged to /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.2/gem_make.out

@eregon
Copy link
Member

eregon commented Apr 19, 2018

@brauliobo The [truffle] opt fail is just warning that a compilation failed, it shouldn't matter.
The real error is below:

/home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/rbconfig-for-mkmf.rb:33:in `block in <top (required)>':
unsupported clang version: 6.0.0 - see doc/user/installing-llvm.md (RuntimeError)

https://github.com/oracle/truffleruby/blob/master/doc/user/installing-llvm.md
We don't support LLVM 6 currently (it's untested).
Currently, the script accepts LLVM 3.8, 3.9, 4.0 and 5.0.

@brauliobo
Copy link
Contributor

@eregon is there a way to bypass the version check? llvm 6.0 might work or cause errors later

@eregon
Copy link
Member

eregon commented Apr 21, 2018

@brauliobo The only way I see (without a different release) would be to tweak the check in
/home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/truffle/rbconfig-for-mkmf.rb.
Something like (around line 30):

-    elsif major == 5 && minor == 0
+    elsif major >= 5
      extra_cflags = '-Xclang -disable-O0-optnone'

Can you try that?

@brauliobo
Copy link
Contributor

brauliobo commented Apr 21, 2018

thank you @eregon, it didn't work :P the error was in the end while linking:

linking shared-object nokogiri/nokogiri.su
llvm-link: /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.2/ports/x86_64-unknown-linux-gnu/libxslt/1.1.32/lib/libexslt.a:1:2: error: expected integer
!<arch>
 ^
llvm-link: error loading file '/home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/nokogiri-1.8.2/ports/x86_64-unknown-linux-gnu/libxslt/1.1.32/lib/libexslt.a'
/home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/cext/linker.rb:54:in `link_bitcode': Linker failed (RuntimeError)
	from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/cext/linker.rb:48:in `main'
	from /home/braulio/Projects/graalvm-1.0.0-rc1/jre/languages/ruby/lib/cext/linker.rb:108:in `<main>'

full output at https://pastebin.com/Q8VN5VAG

@brauliobo
Copy link
Contributor

moving this discussion to #1340 as it isn't directly related to nokogiri but rather to LLVM 6.0

chrisseaton added a commit that referenced this issue May 30, 2018
* commit 'b2d83aa61f9430f99c00f46951f9fa37d43b5188':
  Fix relative links
@obrie
Copy link

obrie commented Jun 27, 2018

@brauliobo For reference, the above compilation error is seen on LLVM 3.8 as well: https://gist.github.com/obrie/95cfa2aa1569f935b4cb58b46dbff527

@obrie
Copy link

obrie commented Jun 27, 2018

I had missed the comment here -- #62 (comment)

Compilation works on 3.8 if you run bundle config build.nokogiri --use-system-libraries

🎆

@rsmything
Copy link

rsmything commented Jul 24, 2018

Hello, can anyone explain how to compile nokogiri with truffleruby?
I've tried with llvm@4, llvm@4, llvm@6

macOS 10.14
Xcode 10 Beta 4
rvm 1.29.4 (master)
truffleruby-1.0.0-rc3 [ x86_64 ] (installed throw RVM)
llvm@4, llvm@5, llvm@6 installed throw Brew

bundle config build.nokogiri --use-system-libraries
bundle install
[mongoid] Warning: No private key present, creating unsigned gem.
[mongo] Warning: No private key present, creating unsigned gem.
[bson] Warning: No private key present, creating unsigned gem.
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...............................................................................................................................
Using rake 12.3.1
Using concurrent-ruby 1.0.5
Using i18n 1.0.1
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 6.0.0.alpha from https://github.com/rails/rails.git (at master@a4398e4)
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Fetching nokogiri 1.8.4
Installing nokogiri 1.8.4 with native extensions
[ruby] PERFORMANCE keyword arguments are not yet optimized
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/User/.rvm/gems/truffleruby-1.0.0-rc3@project/gems/nokogiri-1.8.4/ext/nokogiri
/Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/bin/truffleruby -r ./siteconf20180724-72143-1i6ykv1.rb extconf.rb --use-system-libraries
/Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/rbconfig-for-mkmf.rb:23:in `block in <top (required)>': opt does not appear to be available - you may need to install LLVM - see
doc/user/installing-llvm.md (RuntimeError)
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/rbconfig-for-mkmf.rb:19:in `each'
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/rbconfig-for-mkmf.rb:19:in `<top (required)>'
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/truffle/lazy-rubygems.rb:20:in `gem_original_require'
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/truffle/lazy-rubygems.rb:20:in `require'
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/mri/mkmf.rb:11:in `<top (required)>'
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/truffle/lazy-rubygems.rb:20:in `gem_original_require'
  from /Users/User/.rvm/rubies/truffleruby-1.0.0-rc3/lib/truffle/truffle/lazy-rubygems.rb:20:in `require'
  from extconf.rb:4:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/User/.rvm/gems/truffleruby-1.0.0-rc3@project/gems/nokogiri-1.8.4 for inspection.
Results logged to /Users/User/.rvm/gems/truffleruby-1.0.0-rc3@project/extensions/x86_64-darwin/2.4.0/nokogiri-1.8.4/gem_make.out

An error occurred while installing nokogiri (1.8.4), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.4' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rails was resolved to 6.0.0.alpha, which depends on
    actioncable was resolved to 6.0.0.alpha, which depends on
      actionpack was resolved to 6.0.0.alpha, which depends on
        actionview was resolved to 6.0.0.alpha, which depends on
          rails-dom-testing was resolved to 2.0.3, which depends on
            nokogiri

@eregon
Copy link
Member

eregon commented Jul 24, 2018

@rsmything You need to have LLVM on PATH for 1.0.0-rc3:
https://github.com/oracle/truffleruby/blob/vm-1.0.0-rc3/doc/user/installing-llvm.md#macos

export PATH="/usr/local/opt/llvm@4/bin:$PATH"

This is already fixed (no longer necessary) for the next release.

@deepj
Copy link

deepj commented Nov 29, 2018

Sequel specs on Travis fails due to nonsupport of in-tree libxml2.

https://travis-ci.org/jeremyevans/sequel/jobs/460952287

chrisseaton pushed a commit to Shopify/truffleruby that referenced this issue Nov 13, 2019
Test cacheable

Merge-Requested-By: chrisseaton
Merge-Queue-Digest: 143d56988867ae5b1fb4598fc2876caee5b8dd662909f06d94a9419766e68fc7
@chrisseaton chrisseaton removed their assignment Dec 30, 2019
@norswap
Copy link
Contributor

norswap commented Mar 11, 2020

Update: the sharing of libxml2 is now handled transparently, so bundle config build.nokogiri --use-system-libraries is no longer necessary.

However, a proper version of libxml2 needs to be installed. The setup on macOS is slightly fussy:

# Easy way to get the right version number for nokogiri.
rails --version

brew install libxml2

# Below: replace with paths suggested by brew, and nokogiri version
# reported by the warnings in rails --version.
# (using gem pristine in case you already ran gem install rails)
LDFLAGS="-L/usr/local/opt/libxml2/lib" \
  CPPFLAGS="-I/usr/local/opt/libxml2/include" \
  PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig" \
    gem pristine nokogiri --version 1.10.9

Edit: this was due to issues in my rbenv setup (in particular, rbenv does not add $GEM_HOME/bin to the path, maybe other issues). If you're not manipulating GEM_HOME, things should work out of the box.

@eregon
Copy link
Member

eregon commented Jul 18, 2020

Nokogiri seems to basically work now (and has been for a while).
TruffleRuby always uses the system libraries (automatically), that's the only significant difference.

I ran the Nokogiri tests on TruffleRuby and almost everything passes (GR-25734):
https://github.com/eregon/nokogiri/runs/885501695

  1) Failure:
TestXsltTransforms#test_0001_should not crash when given XPath 2.0 features [/home/runner/work/nokogiri/nokogiri/test/test_xslt_transforms.rb:359]:
Expected /decimal/ to match # encoding: ASCII-8BIT
#    valid: true
"Generic errorGeneric error".

  2) Failure:
Nokogiri::XML::TestSaxEntityReference#test_more_sax_entity_reference [/home/runner/work/nokogiri/nokogiri/test/xml/test_entity_reference.rb:209]:
Expected: ["Entity 'bar' not defined"]
  Actual: ["Warning."]

  3) Failure:
Nokogiri::XML::TestSaxEntityReference#test_more_sax_entity_reference_with_absolute_path [/home/runner/work/nokogiri/nokogiri/test/xml/test_entity_reference.rb:209]:
Expected: ["Entity 'bar' not defined"]
  Actual: ["Warning."]

  4) Failure:
Nokogiri::XML::TestSaxEntityReference#test_sax_entity_reference [/home/runner/work/nokogiri/nokogiri/test/xml/test_entity_reference.rb:196]:
Expected: ["Entity 'bar' not defined"]
  Actual: ["Warning."]

  5) Failure:
Nokogiri::XML::TestSaxEntityReference#test_sax_entity_reference_with_absolute_path [/home/runner/work/nokogiri/nokogiri/test/xml/test_entity_reference.rb:196]:
Expected: ["Entity 'bar' not defined"]
  Actual: ["Warning."]

1517 runs, 4247 assertions, 5 failures, 0 errors, 10 skips

Remaining failures are also tracked in sparklemotion/nokogiri#1882

@gogainda
Copy link
Contributor

Nice progress!

@eregon
Copy link
Member

eregon commented Mar 12, 2021

We now use the libxml2/libxslt from nokogiri and not from the system, similar to CRuby, since dfc60c6.
With that, we also pass all tests of nokogiri, so it's time to close this :)

@eregon eregon added this to the 21.1.0 milestone Mar 12, 2021
@skunkworker
Copy link

I'm still getting errors trying to install nokogiri -> 1.11.2 on truffleruby-21.0.0.

I've tried with bundle config build.nokogiri --use-system-libraries and gem install nokogiri -- --use-system-libraries.

But I'm still getting errors about polyglot.h:

In file included from /Users/john/.rvm/rubies/truffleruby-21.0.0/lib/cext/include/ruby/ruby.h:27:
/Users/john/.rvm/rubies/truffleruby-21.0.0/lib/cext/include/truffleruby/truffleruby-pre.h:23:10: fatal error: 'graalvm/llvm/polyglot.h' file not found
#include <graalvm/llvm/polyglot.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Process failed: #<Process::Status: pid 37097 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"

@eregon
Copy link
Member

eregon commented Mar 15, 2021

@skunkworker Could you report as a separate issue?
The recent change I mentioned just above applies to truffleruby-head and will in 21.1 (see milestone above), it's not in 21.0.

eregon added a commit to eregon/setup-ruby that referenced this issue Aug 7, 2021
* TruffleRuby >= 21.1 installs nokogiri with the packaged libxml2/libxslt
  like on CRuby by default. See oracle/truffleruby#62
eregon added a commit to eregon/setup-ruby that referenced this issue Aug 7, 2021
* TruffleRuby >= 21.1 installs nokogiri with the packaged libxml2/libxslt
  like on CRuby by default. See oracle/truffleruby#62
eregon added a commit to eregon/setup-ruby that referenced this issue Aug 7, 2021
* TruffleRuby >= 21.1 installs nokogiri with the packaged libxml2/libxslt
  like on CRuby by default. See oracle/truffleruby#62
eregon added a commit to ruby/setup-ruby that referenced this issue Aug 7, 2021
* TruffleRuby >= 21.1 installs nokogiri with the packaged libxml2/libxslt
  like on CRuby by default. See oracle/truffleruby#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests