bugGNU a2ps - Bugs: bug #63919, a2ps-4.15: three test failures

 
 

bug #63919: a2ps-4.15: three test failures

Submitter:  Thomas Klausner <tk>
Submitted:  Mon 13 Mar 2023 10:34:52 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 13 Apr 2023 02:20:16 PM UTC, comment #33: 

Closing, 4.15.4 released.

Reuben Thomas <rrt>
Group administrator
Thu 13 Apr 2023 02:04:43 PM UTC, comment #32: 

Thanks, I've added a *~ pattern to the top level .gitignore.

The bootstrap.new thing I've noticed before, but not sure as to why it happens. If you can reproduce it, let me know! If I check out the repo fresh and bootstrap it, I don't get bootstrap.new generated.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 09:31:04 PM UTC, comment #31: 

To avoid opening a separate ticket:

git is unclean after a build.
Please ignore all ~ files, I get a lot of these in po/*~ when building.
Also, I end up with a bootstrap.new file too. Not sure if that should be ignored or deleted by some step along the way.

Thanks.

Thomas Klausner <tk>
Wed 12 Apr 2023 09:29:18 PM UTC, comment #30: 

I think that was it! All the tests pass now with git HEAD of a2ps and libpaper 1.1.29 in my environment.

Thanks a lot!

Thomas Klausner <tk>
Wed 12 Apr 2023 09:00:47 PM UTC, comment #29: 

There should be a prolog-4.ps in the chk dir, I guess it isn't created when the test for prolog-1.ps fails, though.

I have now pushed more lenient test checks that should cope with the various failures we've seen.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 08:49:59 PM UTC, comment #28: 

Sorry for that. I was a bit confused because there is no prolog-4.ps in the chk dir.

# diff ps-{ref,chk}/prolog-1.ps
11c11
< %%DocumentMedia: A4 595 842 0 () ()
---

> %%DocumentMedia: a4 595 842 0 () ()

# diff ps-{ref,chk}/prolog-4.ps
diff: ps-chk/prolog-4.ps: No such file or directory

Thomas Klausner <tk>
Wed 12 Apr 2023 08:37:17 PM UTC, comment #27: 

Wait wait, you didn't diff corresponding output and input files! Sorry, maybe I way unclear.

You need to diff ps-{ref,chk}/prolog-1.ps and also diff ps-{ref,chk}/prolog-4.ps.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 08:36:02 PM UTC, comment #26: 

Thanks very much. So, libpaper is now being called correctly. I will think about what the least annoying workaround is; I think a more lenient test comparison is probably best, rather than having a2ps meddle with the paper names, though in principle capitalizing them should work.

The prolog diff shows that a2ps is getting slightly different input and calculating different values for its output. I shall need to investigate further.

The output for the printers.tst failure is almost correct; I think the problem is that for some reason it's not got the path to the program. In mine, it says "./src/a2ps" in the output; in yours, just "a2ps". Another case where I need to relax the comparison.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 08:23:17 PM UTC, comment #25: 

Good guess on the first one:

11c11
< %%DocumentMedia: A4 595 842 0 () ()
---

> %%DocumentMedia: a4 595 842 0 () ()



The prolog diff is bigger:

diff ps-ref/prolog-4.ps ps-chk/prolog-1.ps 
9c9
< %%Pages: 2
---

> %%Pages: 7

11c11
< %%DocumentMedia: A4 595 842 0 () ()
---

> %%DocumentMedia: a4 595 842 0 () ()

700,703c700,703
< /th 15.000000 def
< /fnfs 11 def
< /bfs 5.477068 def
< /cw 3.286241 def
---

> /th 20.000000 def
> /fnfs 15 def
> /bfs 11.199836 def
> /cw 6.719901 def

726c726
<    359.843364 th add
---

>    747.029046 th add

728,729c728,729
< /pmw urx llx sub pw 2 mul sub 1 div def
< /pmh ury lly sub ph 2 mul sub 24 sub 1 div def
---

> /pmw 0 def
> /pmh 0 def

733,735d732
<   dup pmw add pw add
<   0
<   dup pmw add pw add
738,739d734
<   pmh ph add 1 mul ph add
<   dup
741d735
<   dup

For printers.tst I get (in test-suite.log):

FAIL: printers.tst
==================

a2ps: no command for the `Default Printer' (-d)
FAIL printers.tst (exit status: 1)


Thomas Klausner <tk>
Wed 12 Apr 2023 08:19:09 PM UTC, comment #24: 

I guess this is progress!

Please can you see what the test failures are? It looks like it's the same as before, but it would be good to know. It could be as simple as the case of "A4" being "a4" with old libpaper.

You're looking for the diff of tests/ps-{ref,chk}/encoding.ps for the first test, and similarly for prolog-[14].ps for the last test.

Not sure what could be going wrong with the middle test; perhaps you could edit printers.tst so the key line is just:

echo | $CHK -d 2>&1

and see what it outputs?

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 08:08:10 PM UTC, comment #23: 

Thank you, all build problems now fixed!

I could finally run the tests, but still see three test failures (with libpaper 1.1.29):

FAIL: encoding.tst
==================

.../a2ps/tests/ps-ref/encoding.ps .../a2ps/tests/ps-chk/encoding.ps differ: char 243, line 11
FAIL encoding.tst (exit status: 1)

FAIL: printers.tst
==================

FAIL printers.tst (exit status: 1)

FAIL: prolog-2.tst
==================

FAIL prolog-2.tst (exit status: 1)


Thomas Klausner <tk>
Wed 12 Apr 2023 07:04:38 PM UTC, comment #22: 

I believe I have now fixed the build problem, by moving the codet that processes --help and --version before configuration loading.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 06:35:46 PM UTC, comment #21: 

Oh dear, I have introduced this bug recently when simplifying the code for `--help`, and I didn't notice because I have a2ps installed at the same prefix as I configured it for.

Indeed, it should not need a configuration file to start, although what's actually stopping it is the lack of level1.ppd, which is bug #64034. Looks like I need to tackle that, or revert the short path for `--help`. I'll take a look.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 06:04:15 PM UTC, comment #20: 

I think you fixed the yacc problem, thanks!

I added a newer texinfo to my path. Now it fails with:

Updating man page a2ps.1
/usr/pkg/bin/perl /usr/pkg/bin/help2man --include=./common.x --include=./a2ps.x ../src/a2ps > a2ps.1
help2man: can't get `--help' info from ../src/a2ps
Try `--no-discard-stderr' if option outputs to stderr


Because:

./src/a2ps --help
a2ps: cannot open file `/usr/local/etc/a2ps.cfg': No such file or directory
a2ps: cannot find file `level1.ppd': No such file or directory

I see a file level1.ppd in ppd/level1.ppd, but not in .

I don't think that a2ps should really require a config file for starting.

Thomas Klausner <tk>
Wed 12 Apr 2023 05:14:51 PM UTC, comment #19: 

I think I've found and fixed the problem with the Yacc-generated sources dependencies too. Thanks for your patience with all of these nits!

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 04:54:53 PM UTC, comment #18: 

I can reproduce the build dep problem with serial build, thanks. I'll update my automake bug report. Probably I am doing something wrong, but I can't see what!

As far as I can tell, you need a newer texinfo: I get no error from makeinfo 6.8. I'll add a check in bootstrap.conf; I'm not sure what version to guess, but I'll try 6.0 as that is already from 2015.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 04:18:20 PM UTC, comment #17: 

Yes, better. The GPERF problem/empty confg.c file is fixed.

Now fails with:
a2ps.texi:5737: `lp2' has no Up field (perhaps incorrect sectioning?).

Perhaps by texinfo (4.8) is too old, or there is really a syntax error?

I could reproduce the 'make' problem with the generated header files by cleaning the git checkout:

git clean -dfX

This also deletes the files that are in the .gitignore lists like parsessh.c and parseppd.c and makes the error pop up again for me.

Thomas Klausner <tk>
Wed 12 Apr 2023 04:03:56 PM UTC, comment #16: 

It seems that I misunderstood Bruno Haible's advice about how to detect GPERF; I have pushed a fix.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 03:48:10 PM UTC, comment #15: 

I think the gperf rule is broken. I've installed gperf but get an empty file confg.c:

grep GPERF *             
Makefile:GPERFFLAGS = -t -D -L ANSI-C
Makefile:       $(GPERF) $(GPERFFLAGS) $< >$@
Makefile.am:GPERFFLAGS = -t -D -L ANSI-C
Makefile.am:    $(GPERF) $(GPERFFLAGS) $< >$@
Makefile.in:GPERFFLAGS = -t -D -L ANSI-C
Makefile.in:    $(GPERF) $(GPERFFLAGS) $< >$@

I don't see GPERF being defined!

Thomas Klausner <tk>
Wed 12 Apr 2023 03:42:41 PM UTC, comment #14: 

Whatever the timestamps are, that shouldn't be a problem, though as you say, it might be triggering a bug.

confg.gperf is compiled to get confg.c. Maybe you don't have gperf installed? I see that in fact there's no check for this, which is an error on my part! It is not required to build from source, but I should check it at bootstrap time.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 03:35:58 PM UTC, comment #13: 

Perhaps there's a problem with timestamps when doing a new git checkout?

Thomas Klausner <tk>
Wed 12 Apr 2023 03:34:41 PM UTC, comment #12: 

I looked for one symbol:

grep -ri delegation_hook .
./liba2ps/confg.gperf:config_hook delegation_hook = NULL;
./liba2ps/confg.gperf:    if (delegation_hook)
./liba2ps/confg.gperf:      (*delegation_hook) (fname, firstline, argv[1]);
./liba2ps/confg.h:extern config_hook delegation_hook;
./src/main.c:  delegation_hook = add_delegation;

Should the confg.gperf file be converted to something else?

Thomas Klausner <tk>
Wed 12 Apr 2023 03:33:13 PM UTC, comment #11: 

I wasn't doing a parallel build.

I'll make clean and try again.

Thomas Klausner <tk>
Wed 12 Apr 2023 03:14:20 PM UTC, comment #10: 

As far as I can see, the first two problems are bugs in automake: in each case, the missing source file is listed in BUILT_SOURCES, so it should be built before any other target when "make all" is run. If I run with MAKEFLAGS=-j4, then I can reproduce the problem; otherwise, I can't. I'll report this upstream. For now, a workaround is to avoid parallel make.

The last problem I'm not sure about. The missing symbols are (or should be!) in liba2ps, which is listed on the link line.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 02:26:37 PM UTC, comment #9: 

Ok, so this is my first time trying a2ps from git. I found 'bootstrap' and the ran configure and GNU make.
It failed with

gmake[2]: * No rule to make target 'parseppd.h', needed by 'all'.  Stop.

but

cd liba2ps
make parseppd.c

fixed that. Then

gmake[2]: * No rule to make target 'parsessh.h', needed by 'all'.  Stop.

but

cd src
make parsessh.c

Fixed that. These look like missing dependencies to me.

Finally:

/bin/sh ../libtool  --tag=CC   --mode=link gcc   -I/usr/pkg/include  -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -o a2ps main.o read.o sshread.o ssheet.o select.o generate.o delegate.o buffer.o versions.o ffaces.o ../liba2ps/liba2ps.la ../liba2ps/libnowarnings.a libparse.a /usr/pkg/lib/libintl.so -Wl,-rpath -Wl,/usr/pkg/lib ../lib/libgnu.la -lm -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lgc -lpthread -lrt -lpaper  -lpaper
libtool: link: gcc -I/usr/pkg/include -Wl,-R/usr/pkg/lib -o a2ps main.o read.o sshread.o ssheet.o select.o generate.o delegate.o buffer.o versions.o ffaces.o /usr/pkg/lib/libintl.so -Wl,-rpath -Wl,/usr/pkg/lib -Wl,-R/usr/pkg/lib  -L/usr/pkg/lib ../liba2ps/.libs/liba2ps.a ../liba2ps/libnowarnings.a libparse.a ../lib/.libs/libgnu.a /usr/pkg/lib/libintl.so -lm /usr/pkg/lib/libgc.so -lpthread -lrt /usr/pkg/lib/libpaper.so -Wl,-rpath -Wl,/usr/pkg/lib -Wl,-rpath -Wl,/usr/pkg/lib
ld: main.o: in function `main':
main.c:(.text+0x171d): undefined reference to `delegation_hook'
ld: main.c:(.text+0x175d): undefined reference to `a2_read_sys_config'
ld: main.c:(.text+0x179a): undefined reference to `a2_read_config'
ld: main.c:(.text+0x17b3): undefined reference to `a2_read_config'

and I don't know the solution to that one yet.

That's with libpaper 1.1.29 installed in case it matters.

Thomas Klausner <tk>
Wed 12 Apr 2023 02:06:38 PM UTC, comment #8: 

If you can test current git master HEAD of a2ps, that would be great. Otherwise, I will release a new version with the fix and hope for the best.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 12:58:29 PM UTC, comment #7: 

Libpaper 2 is mostly backwards-compatible with libpaper 1 (but not quite, hence the major version bump).

I have a fix for a2ps that will be compatible with both libpaper 1 & 2.

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 11:53:32 AM UTC, comment #6: 

Yes, 1.1.29.

Is 2.x backwards-compatible with 1.x?

Thomas Klausner <tk>
Wed 12 Apr 2023 11:52:18 AM UTC, comment #5: 

This sounds like bug #64034. Are you using libpaper 1.x?

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 11:44:35 AM UTC, comment #4: 

Thanks for the pointer. In my setting its using libpaper1. paperconf reports 'a4' as well.

Thomas Klausner <tk>
Wed 12 Apr 2023 11:34:43 AM UTC, comment #3: 

As documented under `--medium`, a2ps uses the default as configured with libpaper. Assuming modern libpaper (2.x), the user's default is displayed by the command `paper`. With libpaper 1.x, `paperconf` should display the configured paper size. The configuration mechanism is documented in paper(1) (for libpaper 2.x) and paperconf(1) (for libpaper 1.x).

(I'm not sure what psutils.cfg is. I can't find such a file in the a2ps sources, and I know it's not part of PSUtils, as I'm the maintainer of that package too!)

Reuben Thomas <rrt>
Group administrator
Wed 12 Apr 2023 11:26:32 AM UTC, comment #2: 

Hm, not sure. psutils.cfg has:

PAPERSIZE=a4

I have nothing related set in the environment.
Where is a2ps looking for the PAPERSIZE?

Thomas Klausner <tk>
Wed 12 Apr 2023 11:22:35 AM UTC, comment #1: 

From the error message in the first failing test, I guess that this is because you have a default paper size that is not A4, and the tests do not set a specific paper size.

Please can you confirm whether this is the case?

Reuben Thomas <rrt>
Group administrator
Mon 13 Mar 2023 10:34:52 AM UTC, original submission:  

Updating a2ps to 4.15 in pkgsrc, I see three test failures (on NetBSD 10.99.2/amd64 in case it matters):

FAIL: encoding.tst
==================

/scratch/print/a2ps/work/a2ps-4.15/tests/ps-ref/encoding.ps /scratch/print/a2ps/work/a2ps-4.15/tests/ps-chk/encoding.ps differ: char 243, line 11
FAIL encoding.tst (exit status: 1)

FAIL: printers.tst
==================

FAIL printers.tst (exit status: 1)

FAIL: prolog-2.tst
==================

FAIL prolog-2.tst (exit status: 1)

Thomas Klausner <tk>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rrt (Posted a comment)
  • -email is unavailable- added by tk (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-13 rrt StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code