asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.15k stars 499 forks source link

Test failure on Fedora 35 development build #1963

Closed snecklifter closed 3 years ago

snecklifter commented 3 years ago

Hello,

I'm trying to build 1.6.0 for F35 and seeing the following error:

Run options: exclude {:network=>true}
..................................................................................F....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Failures:

  1) Asciidoctor::PDF::Converter - Dest should keep anchor with text if text is advanced to next page
     Failure/Error: (expect names).to have_key 'anchor'
       expected `{"__anchor-top"=>#<PDF::Reader::Reference:0x000055f7c5ef55e8 @id=8, @gen=0>}.has_key?("anchor")` to be truthy, got false
     # ./spec/dest_spec.rb:51:in `block (2 levels) in <top (required)>'

Finished in 1 minute 31.55 seconds (files took 0.58091 seconds to load)
983 examples, 1 failure

Failed examples:

rspec ./spec/dest_spec.rb:41 # Asciidoctor::PDF::Converter - Dest should keep anchor with text if text is advanced to next page

Any ideas as to the cause appreciated.

mojavelinux commented 3 years ago

I'm pretty sure this is due to a breaking change that Prawn made in a recent release. I have applied at least one patch for this test case already, but perhaps there is another case I'm not considering.

Please share the version of Ruby and the version of Prawn that Asciidoctor PDF is using when running this test.

snecklifter commented 3 years ago

@mojavelinux thanks:

Ruby: 3.0.2 Prawn: 2.4.0

mojavelinux commented 3 years ago

Aha. Now I see. The patch I made came after the 1.6.0 release. So the combination of Asciidoctor PDF 1.6.0 with Prawn 2.4.0 does not pass the test suite. But if you apply this patch to Asciidoctor PDF, the test will pass: https://github.com/asciidoctor/asciidoctor-pdf/commit/77e46719294323ef50fa802a893d27ee2f3e065d

What I need to do is release 1.6.1. I'll plan to do that sometime in the next few days.

mojavelinux commented 3 years ago

That test is important too, because it's validating that non-visible metadata is preserved during rendering. That's what the Prawn release broke.

snecklifter commented 3 years ago

@mojavelinux thanks, have tested and when that patch is applied I get:

+ rspec -t '~network'
Run options: exclude {:network=>true}
....................................FFF/builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf/ext/prawn.rb:7:in `require_relative': cannot load such file -- /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf/ext/prawn/formatted_text/arranger (LoadError)
    from /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf/ext/prawn.rb:7:in `<top (required)>'
    from /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf/ext.rb:6:in `require_relative'
    from /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf/ext.rb:6:in `<top (required)>'
    from /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf.rb:16:in `require_relative'
    from /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/lib/asciidoctor/pdf.rb:16:in `<top (required)>'
    from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /builddir/build/BUILD/asciidoctor-pdf-1.6.0/usr/share/gems/gems/asciidoctor-pdf-1.6.0/bin/asciidoctor-pdf:5:in `<main>'
snecklifter commented 3 years ago

Am just missing arranger.rb so will wait for 1.6.1 I think.