sciurius / perl-Text-Layout

Pango style markup formatting for PDF::API2, Markdown, Cairo and more
2 stars 2 forks source link

Unsuccessful install on Windows #2

Closed PhilterPaper closed 5 years ago

PhilterPaper commented 5 years ago

This may not come as a shock, as you know [offline conversations] that I have not been able to install Pango, Cairo, or any other prereq. I saw that you had released Text::Layout on CPAN, so for shats and giggles I thought I'd see what happens when it's installed. I was surprised that it reported a fairly smooth installation, with no missing prereqs:

cpan> i Text::Layout
Database was generated on Fri, 18 Oct 2019 15:55:20 GMT
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/J/JV/JV/CHECKSUMS
Module id = Text::Layout
    CPAN_USERID  JV (Johan Vromans <jv@cpan.org>)
    CPAN_VERSION 0.011
    CPAN_FILE    J/JV/JV/Text-Layout-0.011.tar.gz
    UPLOAD_DATE  2019-09-01
    INST_FILE    (not installed)

cpan> install Text::Layout
Running install for module 'Text::Layout'
Fetching with LWP:
http://cpan.strawberryperl.com/authors/id/J/JV/JV/Text-Layout-0.011.tar.gz
Checksum for C:\STRAWB~1\cpan\sources\authors\id\J\JV\JV\Text-Layout-0.011.tar.gz ok
Scanning cache C:\STRAWB~1\cpan\build for sizes
............................................................................DONE
Configuring J/JV/JV/Text-Layout-0.011.tar.gz with Makefile.PL
Checking if your kit is complete...
Warning: the following files are missing in your kit:
        t/100-pdfapi.t
        t/102-pdfapi.t
Please inform the author.
Generating a gmake-style Makefile
Writing Makefile for Text::Layout
Writing MYMETA.yml and MYMETA.json
  JV/Text-Layout-0.011.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for J/JV/JV/Text-Layout-0.011.tar.gz
cp lib/Text/Layout/FontConfig.pm blib\lib\Text\Layout\FontConfig.pm
cp lib/Text/Layout.pm blib\lib\Text\Layout.pm
cp lib/Text/Layout/Cairo.pm blib\lib\Text\Layout\Cairo.pm
cp lib/Text/Layout/FontDescriptor.pm blib\lib\Text\Layout\FontDescriptor.pm
cp lib/Text/Layout/Markdown.pm blib\lib\Text\Layout\Markdown.pm
cp lib/Text/Layout/PDFAPI2.pm blib\lib\Text\Layout\PDFAPI2.pm
cp lib/Text/Layout/Version.pm blib\lib\Text\Layout\Version.pm
cp lib/Text/Layout/Pango.pm blib\lib\Text\Layout\Pango.pm
  JV/Text-Layout-0.011.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- OK
Running make test for JV/Text-Layout-0.011.tar.gz
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-load.t .. 1/6 # Testing Text::Layout 0.011, Perl 5.026001, C:\Strawberry\perl\bin\perl.exe
t/00-load.t .. ok
All tests successful.
Files=1, Tests=6,  1 wallclock secs ( 0.02 usr +  0.02 sys =  0.03 CPU)
Result: PASS
Lockfile removed.
  JV/Text-Layout-0.011.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe test -- OK
Running make install for JV/Text-Layout-0.011.tar.gz
Installing C:\STRAWB~1\perl\site\lib\Text\Layout.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\Cairo.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\FontConfig.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\FontDescriptor.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\Markdown.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\Pango.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\PDFAPI2.pm
Installing C:\STRAWB~1\perl\site\lib\Text\Layout\Version.pm
Appending installation info to C:\STRAWB~1\perl\lib/perllocal.pod
  JV/Text-Layout-0.011.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe install UNINST=1 -- OK

cpan> i Text::Layout
Module id = Text::Layout
    CPAN_USERID  JV (Johan Vromans <jv@cpan.org>)
    CPAN_VERSION 0.011
    CPAN_FILE    J/JV/JV/Text-Layout-0.011.tar.gz
    UPLOAD_DATE  2019-09-01
    MANPAGE      Text::Layout - Pango style markup formatting This module will cooperate with PDF::API2, PDF::Builder, Cairo, and Pango.
    INST_FILE    C:\Strawberry\perl\site\lib\Text\Layout.pm
    INST_VERSION undef

Note a complaint about a couple t-tests missing (are they supposed to be -pdfapi2?), and that the Installed Version is reported as "undef". I'm guessing that -pdfbuilder.t tests will be needed, too.

Next, I tried running the short sample at the top of the CPAN page (Layout.pm POD, IIRC). I had to add

use strict;
use warnings;
use PDF::Builder;
use Text::Layout;

my ($x, $y);

at the top to get past the compilation errors. Then I had to copy Text/Layout/PDFAPI2.pm to PDFBuilder.pm (and change API2 to Builder within), so that sounds like a missing file. Finally,

C:\Users\Phil\Desktop>pango.pl
Unknown font property: times at C:\Users\Phil\Desktop\pango.pl line 19.
Cannot find font:  normal normal
 at C:\Users\Phil\Desktop\pango.pl line 19.

No idea how to proceed at this point. Unless somehow you managed to package up all the needed prereqs in your Perl code, it's likely that it will fail somewhere down the line when it actually needs to talk to some prereq libraries (maybe that's where it is now). Since apparently, Cairo and other necessary libraries don't do "one-button" installs on Windows Strawberry Perl, I think many users will need some step-by-step instructions on how to get all the prereqs installed (I certainly do!). I'm guessing at this point that Text::Layout doesn't formally prereq anything in the install package (I haven't looked inside the installation package yet).

Thanks much for the new package, and I'm looking forward to getting it working. As I've said before, my principal interest (for PDF::Builder) is eventually to get complex script support working. Easy font selection with HTML-like markup is icing on the cake.

PhilterPaper commented 5 years ago

I think you may have to revise our $VERSION to avoid the "undef" version return with cpan. Wrapping it in double quotes doesn't work, but making it a constant (like $VERSION = "0.011";) does.

sciurius commented 5 years ago

Thanks for the feedback.

Note a complaint about a couple t-tests missing (are they supposed to be *-pdfapi2?),

Fixed. And no, pdfapi is intended to be generic PDF::API2 and PDF::Builder.

I fixed the example code. Thanks for pointing out.

the Installed Version is reported as "undef"

I'll look into this.

Then I had to copy Text/Layout/PDFAPI2.pm to PDFBuilder.pm

This shouldn't have been necessary since the PDFAP2 backend handles PDF::Builder as well. I fixed this.

C:\Users\Phil\Desktop>pango.pl

The name suggests that you may be under the impression that you are using Pango, but remember that you are using PDF::Builder. You used PDF::Builder in the example.

Please note that installing Text::Layout only requires PDF::API2 for testing. All backends are optional and no other packages (Caoiro, Pango, ...) are pulled in.

Cannot find font: normal normal

On Windows it is necessary to register the font families before you can use them. There is no easy way in Windows to query system fonts. See https://metacpan.org/pod/Text::Layout::FontConfig .

Since apparently, Cairo and other necessary libraries don't do "one-button" installs on Windows Strawberry Perl,

Installing Pango, Cairo and dependent libraries in StrawberryPerl on Windows should be painless. See e.g. http://sisyphusion.tk/ppmindex.html .

I hope this helps getting you further and thanks again vor testing.

sciurius commented 5 years ago

For the sake of completeness, I must add that currently only the PDF::API2/Builder and Markdown backends are functional.

PhilterPaper commented 5 years ago

My guess (and only a guess) regarding the 'undef' version is that CPAN is not actually executing the code (which pulls in your VERSION module), but just looking for a match of $VERSION = a string. I went ahead and put our $VERSION = "0.011"; in all .pm files to stop cpan from griping. In PDF::Builder, the release build process updates the $VERSION line in every .pm file. Maybe that will give you an idea... or, could it be causing a problem? (see "version downgrade" warning below)

I called it 'pango.pl' just to keep it from getting tangled up with other stuff on my desktop, as many of my conversations with you have touched on Pango. Soon I will have to take another swipe at getting Cairo etc. to install (you thought that maybe there was some ActiveState junk in there). PDFBuilder.pm has been removed.

You say that at this point it's not invoking Pango, Cairo, etc. during testing, but still it failed:

cpan> upgrade Text::Layout

Package namespace installed latest in CPAN file Text::Layout 0.011 0.012 JV/Text-Layout-0.012.tar.gz Running install for module 'Text::Layout' Fetching with LWP: http://cpan.strawberryperl.com/authors/id/J/JV/JV/Text-Layout-0.012.tar.gz Fetching with LWP: http://cpan.strawberryperl.com/authors/id/J/JV/JV/CHECKSUMS Checksum for C:\strawberry\cpan\sources\authors\id\J\JV\JV\Text-Layout-0.012.tar.gz ok Configuring J/JV/JV/Text-Layout-0.012.tar.gz with Makefile.PL Checking if your kit is complete... Looks good Generating a gmake-style Makefile Writing Makefile for Text::Layout Writing MYMETA.yml and MYMETA.json JV/Text-Layout-0.012.tar.gz C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK Running make for J/JV/JV/Text-Layout-0.012.tar.gz cp lib/Text/Layout/FontConfig.pm blib\lib\Text\Layout\FontConfig.pm cp lib/Text/Layout.pm blib\lib\Text\Layout.pm cp lib/Text/Layout/Pango.pm blib\lib\Text\Layout\Pango.pm cp lib/Text/Layout/PDFAPI2.pm blib\lib\Text\Layout\PDFAPI2.pm cp lib/Text/Layout/Markdown.pm blib\lib\Text\Layout\Markdown.pm cp lib/Text/Layout/Cairo.pm blib\lib\Text\Layout\Cairo.pm cp lib/Text/Layout/Version.pm blib\lib\Text\Layout\Version.pm cp lib/Text/Layout/FontDescriptor.pm blib\lib\Text\Layout\FontDescriptor.pm JV/Text-Layout-0.012.tar.gz C:\STRAWB~1\c\bin\gmake.exe -- OK allow_installing_module_downgrades: JV/Text-Layout-0.012.tar.gz (called for Text::Layout) contains downgrading module(s) (e.g. 'Text\Layout\Cairo.pm' would downgrade installed '0.011' to 'undef'). Do you want to allow installing it? [yes] Running make test for JV/Text-Layout-0.012.tar.gz "C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/.t t/00-load.t ..... 1/6 # Testing Text::Layout 0.012, Perl 5.026001, C:\Strawberry\perl\bin\perl.exe t/00-load.t ..... ok t/100-pdfapi.t .. ok t/102-pdfapi.t .. 1/27 Failed test 'baseline -13.66' at t/102-pdfapi.t line 47.

Failed test 'baseline -13.66' at t/102-pdfapi.t line 49.

Failed test 'pixel_size height' at t/102-pdfapi.t line 54.

Failed test 'pixel_size height' at t/102-pdfapi.t line 57.

Failed test 'size height' at t/102-pdfapi.t line 62.

Failed test 'size height' at t/102-pdfapi.t line 65.

Failed test 'pixel_extents ink height 18' at t/102-pdfapi.t line 78.

Failed test 'pixel_extents layout height 18' at t/102-pdfapi.t line 78.

Failed test 'extents ink height 18' at t/102-pdfapi.t line 91.

Failed test 'extents layout height 18' at t/102-pdfapi.t line 91. Looks like you failed 10 tests of 27. t/102-pdfapi.t .. Dubious, test returned 10 (wstat 2560, 0xa00) Failed 10/27 subtests

Test Summary Report

t/102-pdfapi.t (Wstat: 2560 Tests: 27 Failed: 10) Failed tests: 2-3, 5, 7, 9, 11, 15, 19, 23, 27 Non-zero exit status: 10 Files=3, Tests=42, 2 wallclock secs ( 0.08 usr + 0.02 sys = 0.09 CPU) Result: FAIL Failed 1/3 test programs. 10/42 subtests failed. gmake: *** [Makefile:929: test_dynamic] Error 10 Lockfile removed. JV/Text-Layout-0.012.tar.gz C:\STRAWB~1\c\bin\gmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports JV/Text-Layout-0.012.tar.gz Stopping: 'install' failed for 'Text::Layout'. Failed during this command: JV/Text-Layout-0.012.tar.gz : make_test NO

cpan> i Text::Layout Module id = Text::Layout CPAN_USERID JV (Johan Vromans jv@cpan.org) CPAN_VERSION 0.012 CPAN_FILE J/JV/JV/Text-Layout-0.012.tar.gz UPLOAD_DATE 2019-10-21 MANPAGE Text::Layout - Pango style markup formatting This module will cooperate with PDF::API2, PDF::Builder, Cairo, and Pango. INST_FILE C:\Strawberry\perl\site\lib\Text\Layout.pm INST_VERSION 0.011

(I had to remove hash marks on many lines b/c Markdown thinks they're level 1 headings! Also a tilde [strikethrough] had to be removed)

Once I get a clean install of Text::Layout, I'll try the font register changes, as well as saving the new PDF. Don't hesitate to ask me to run a test install image or try out certain changes to the install.

sciurius commented 5 years ago

On Mon, 21 Oct 2019 16:44:57 +0000 (UTC), Phil Perry notifications@github.com wrote:

I went ahead and put our $VERSION = "0.011"; in all .pm files to stop cpan from griping.

My feeling is that this is the reason why you get update failures:

C:\STRAWB~1\c\bin\gmake.exe -- OK allow_installing_module_downgrades: JV/Text-Layout-0.012.tar.gz (called for Text::Layout) contains downgrading module(s) (e.g. 'Text\Layout\Cairo.pm' would downgrade installed '0.011' to 'undef').

Module Text::Layout::Cairo did and does not have a version, but you inserted 0.011 in the previous install, hence the message.

t/102-pdfapi.t .. 1/27 Failed test 'baseline -13.66' at t/102-pdfapi.t line 47.

Yes, there were some last-minute errors in test 102. The attached replacement should fix this. Sorry for that.

(I had to remove hash marks on many lines b/c Markdown thinks they're level 1 headings! Also a tilde [strikethrough] had to be removed)

How do you mean?

Regards, Johan

PhilterPaper commented 5 years ago

OK, I reverted the $VERSION changes, and no longer get the complaint about downgrading (but the reported installed version is back to 'undef', when it should be '0.012'). Did you change any of the .pm files? They don't seem to have changed, including VERSION.

Yes, there were some last-minute errors in test 102. The attached replacement should fix this. Sorry for that.

Did you forget to attach a new 102-pdfapi.t to this ticket? I'm still getting 10/27 failures. Was 0.012 only the adding of the two missing t-test files? I suppose my .pm files wouldn't be updated if the tests failed.

(I had to remove hash marks on many lines b/c Markdown thinks they're level 1 headings! Also a tilde [strikethrough] had to be removed)

How do you mean?

When copy-pasting from the DOS command window into the ticket, lines starting with # appear to be treated as Markdown level 1 headings, so I had to strip them out. Just a cosmetic thing, in case you were confused by the way it looked compared to normal cpan runs. One line with a ~ in it was treated as start of strike-through, but I don't know why the other one didn't trigger it (unbalanced?).

sciurius commented 5 years ago

I did add the file to the mail message, but apparently the mail to github gateways strips it. 102-pdfapi.t.txt

PhilterPaper commented 5 years ago

Today's v0.013 release appears to install cleanly (passes all tests, and i Text::Layout recognizes it's 0.013 rather than 'undef'). I'll try to do some testing tonight and see how far it gets without Cairo, etc., installed.

sciurius commented 5 years ago

Good! Keep me posted.

PhilterPaper commented 5 years ago

OK, the sample "quick brown fox" line with markup appears to work correctly (quick and brown are italic, quick is red, brown is half size, whole thing is centered ($x = 0). So this is not using any of Pango or Cairo? Just your pure Perl? Nice!

BTW, I see a CHORDPRO env reference in PDFAPI2.pm -- it probably doesn't affect anything, except if you want to debug it might be confusing.

I'll close this for now, and reopen it if further installation issues arise (unless you prefer a new ticket).

PhilterPaper commented 5 years ago

(moved to ticket #3)