bugGNU roff - Bugs: bug #62640, groff command insists on a device...

 
 

bug #62640: groff command insists on a device postprocessor even if -Z or -X

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Thu 16 Jun 2022 12:39:41 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Jun 2022 06:28:09 PM UTC, comment #5: 


commit 3bcdc926c84abdf735b24569f86975fd97e6529a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Jun 18 19:31:50 2022 -0500

    [groff]: Fix Savannah #62640.

    * src/roff/groff/groff.cpp: Add new Boolean global, `need_postdriver`,
      and initialize it true.

      (main): Make `need_postdriver` false if the `-X` or `-Z` options are
      given.  Test it later.  This prevents groff from exiting with a fatal
      error if an output driver is not available, but also not required.
      Also reorder null pointer equality comparison to avoid inadvertent
      lvalue assignment.

    Fixes <https://savannah.gnu.org/bugs/?62640>.

    Also update editor aid comments; drop old style Emacs file-local
    variable setting.


G. Branden Robinson <gbranden>
Group administrator
Fri 17 Jun 2022 04:26:58 AM UTC, comment #4: 


comment #3:

> It's too hot to think properly, sorry. I thought the problem was no DESC file for device cat (the quickness of the eye deceives the brain), and when I tried your test (without a directory font/devcat) I got "cannot load 'DESC' description file for device 'cat'" which was the basis of my comment.
>
> Now I have read your error properly, and realised you had added a font/devcat with a DESC file, I fully agree that lack of a postpro entry in the DESC should not fatal groff if the postprocessor is not going to be run. Sorry for the noise.


No worries!  This ticket was the easy part.  The trick now is getting gxditview to render something useful...

G. Branden Robinson <gbranden>
Group administrator
Thu 16 Jun 2022 05:15:46 PM UTC, comment #3: 

It's too hot to think properly, sorry. I thought the problem was no DESC file for device cat (the quickness of the eye deceives the brain), and when I tried your test (without a directory font/devcat) I got "cannot load 'DESC' description file for device 'cat'" which was the basis of my comment.

Now I have read your error properly, and realised you had added a font/devcat with a DESC file, I fully agree that lack of a postpro entry in the DESC should not fatal groff if the postprocessor is not going to be run. Sorry for the noise.

Deri James <deri>
Group Member
Thu 16 Jun 2022 03:39:06 PM UTC, comment #2: 


comment #1:

> A valid postprocessor is required to provide the appropriate values from the DESC file.


Right.  I'm not saying the DESC file isn't needed, I'm saying the postprocessor itself, the output driver, isn't.

IF you use groff -Z or groff -X.

> Without these values the resulting -Z output would be meaningless.


Worse than that, as I understand it would impossible to construct in the first place.

> The particular postprocessor for which the output is intended, is specified in the first line of the -Z output, so the output device can complain if it is fed intermediate output intended for another device.


Yes, it can complain, but it might choose not to, as, for instance, gxditview(1) accepts "grout" (groff device-independent output) for the "ps" device along with the X* devices.

> So it should be fatal since it is definitely a mistake not to specify a valid device.


I disagree.  What I'm trying to do here is lay some foundation for generating C/A/T output with groff and view it with something else--like gxditview(1).

After patching groff(1), I can do the following.


$ cp -a ~/src/unix/v8/usr/src/cmd/troff/devcat ./font/
$ printf 'Hello, world!\n' | ./build/test-groff -Z -Tcat
troff: /home/branden/src/GIT/groff/build/../font/devcat/R: error: font description 'spacewidth' directive missing
troff: /home/branden/src/GIT/groff/build/../font/devcat/I: error: font description 'spacewidth' directive missing
troff: /home/branden/src/GIT/groff/build/../font/devcat/B: error: font description 'spacewidth' directive missing
troff: /home/branden/src/GIT/groff/build/../font/devcat/S: error: font description 'spacewidth' directive missing
x T cat
x res 432 1 3
x init
p1
x font 1 R
f1
s10
V72
H432
md
DFd
cH48e30l17l17o33,w40w43o33r23l17d33!h20
n72 0
x trailer
V4752
x stop


G. Branden Robinson <gbranden>
Group administrator
Thu 16 Jun 2022 01:58:46 PM UTC, comment #1: 

A valid postprocessor is required to provide the appropriate values from the DESC file. Without these values the resulting -Z output would be meaningless. The particular postprocessor for which the output is intended, is specified in the first line of the -Z output, so the output device can complain if it is fed intermediate output intended for another device. So it should be fatal since it is definitely a mistake not to specify a valid device.

Deri James <deri>
Group Member
Thu 16 Jun 2022 12:39:41 PM UTC, original submission:  

Affects groff 1.22.4.


$ groff -F ./font -Tcat -Z
groff: fatal error: no 'postpro' command in DESC file for device 'cat'


If the device's defined postprocessor isn't going to be run due to the -X or -Z flags, then this doesn't need to be an error at all, let alone a fatal one.

G. Branden Robinson <gbranden>
Group administrator

 

(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 deri (Posted a comment)
  • -email is unavailable- added by gbranden (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-21 gbranden Open/ClosedOpen Closed
    2022-06-21 gbranden StatusIn Progress Fixed
        Planned ReleaseNone 1.23.0
    2022-06-16 gbranden Summarygroff command insists on a device postprocessor even if -Z groff command insists on a device postprocessor even if -Z or -X

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code