bugGNU roff - Bugs: bug #67169, [man] URLs specified with `UR` and...

 
 

bug #67169: [man] URLs specified with `UR` and no link text "simply dropped" with `-Tpdf` on Ubuntu 24.04

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Thu 29 May 2025 09:08:22 PM UTC
   
 
Category:  Macro package man Severity:  4 - Important
Item Group:  Incorrect behaviour Status:  Duplicate
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 10 Jun 2025 10:46:20 AM UTC, comment #15: 

comment #14:

> Adding -rU0 in the Makefile works on my Ubuntu 24.04 system.


Excellent!  Thanks for the feedback.  That's further evidence this problem is exactly what Colin thought it was, and a case of bug #64572 being roused by site-local configuration.  Resolving ticket accordingly.
 

> I didn't understand the point of the man.local change and didn't try that one; sorry. I don't have groff 1.24 installed, as Ubuntu 24.04 comes with groff 1.23.


No worries.  groff 1.24 isn't released but it will (knock wood) soon see its first release candidate.

What that snippet of *roff logic attempts to do is apply a workaround disabling hyperlinks when generating PDFs, but only if the running version of groff is less than 1.24.  We know that PDF hyperlinks work in (the forthcoming) 1.24 so we wouldn't want a "man.local" file carrying this workaround to defeat the feature in a newer groff installation.  (In Debian-based systems, it's common for contents of "conffiles" in /etc to persist through many package upgrades, to respect site configuration.)
 

> I've pushed the xtrs Makefile change to github, along with a comment that it's a workaround for https://savannah.gnu.org/bugs/?67169 and can be removed if that bug doesn't affect your system.


Looks good to me.

Thanks raising this issue.  Please feel free to report any other groff annoyances to this bug tracker or to the groff at gnu dot org mailing list.

G. Branden Robinson <gbranden>
Group administrator
Mon 09 Jun 2025 02:50:45 AM UTC, comment #14: 

Adding -rU0 in the Makefile works on my Ubuntu 24.04 system.

I didn't understand the point of the man.local change and didn't try that one; sorry. I don't have groff 1.24 installed, as Ubuntu 24.04 comes with groff 1.23.

I've pushed the xtrs Makefile change to github, along with a comment that it's a workaround for https://savannah.gnu.org/bugs/?67169 and can be removed if that bug doesn't affect your system.

Tim Mann <mann>
Sat 07 Jun 2025 04:54:53 PM UTC, comment #13: 

Tim,

As Colin noted, this is fixed in Debian unstable (with an unblock request to get it into the imminent trixie stable release), and should "trickle down to newer Ubuntu releases over time".

In the meantime I have two workarounds to suggest.

Here's one you can use on a case-by-case basis, using xtrs's own "Makefile" as an example.


diff --git a/Makefile b/Makefile
index c176d0e..be381c6 100644
--- a/Makefile
+++ b/Makefile
@@ -124,10 +124,10 @@ ZMACFLAGS = -P
        html2text -nobs -style pretty $< >$@

 %.man.pdf: %.man
-#      groff -man -Tpdf $< > $@
-       groff -man -Tdvi $< > .tmp_$*.dvi
-       dvipdf .tmp_$*.dvi $@
-       rm -f .tmp_$*.dvi
+       groff -rU0 -man -Tpdf $< > $@
+#      groff -man -Tdvi $< > .tmp_$*.dvi
+#      dvipdf .tmp_$*.dvi $@
+#      rm -f .tmp_$*.dvi


And here's one you can put in the "man.local" file on your system.  groff_man(7)'s "Files" section should accurately document where that's installed for your system.  ("/etc/groff", I expect.)


.\" If we're formatting a PDF...
.if '\*[.T]'pdf' \{\
.\" ...and groff 1.24 or later is installed...
.  if (\n[.g] & (\n[.x]=1) & (\n[.y]>23)) \{\
.    nr U 1 \" ...turn on hyperlinks.
.  \}
.\}


Let me know if either of these works.

G. Branden Robinson <gbranden>
Group administrator
Sun 01 Jun 2025 10:05:21 PM UTC, comment #12: 

Thanks for the fast follow-up, Colin!

I'm back home but haven't quite completely reassembled my work desk.

comment #10:

> Actually, it can't just be that patch, because an.tmac in 1.23.0 also has:
>
> .if !r U \
> .  nr U 1
>
> So would I be better off just cherry-picking https://cgit.git.savannah.gnu.org/cgit/groff.git/commit/?id=d9e90209725a716dff23807ffffda403c58020c9 ?  That way things will work regardless of the setting of `U`.


I haven't tested Debian's patch combined with this cherry-pick, but that gun sure creates correct-looking smoke.

Updating Status.  Once you're satisfied with the new Debian groff package, maybe I'll close this as "Invalid" with a "[not our problem]" tag (see bug #64701, bug #63726, bug #62078, et al.).

On the other hand, `U` is documented as a user-configurable register and bad stuff should not happen if it is used (whether a distro or an individual sysadmin sets it in "man.local" doesn't, and shouldn't, matter to us).  A case could be made for this ticket being a duplicate of bug #64572.  Thanks for pointing that one out--I had utterly forgotten it.

G. Branden Robinson <gbranden>
Group administrator
Sun 01 Jun 2025 12:52:30 AM UTC, comment #11: 

Debian tracking bug: https://bugs.debian.org/1107068

Colin Watson <cjwatson>
Group Member
Sun 01 Jun 2025 12:47:58 AM UTC, comment #10: 

Actually, it can't just be that patch, because an.tmac in 1.23.0 also has:

.if !r U \
.  nr U 1

So would I be better off just cherry-picking https://cgit.git.savannah.gnu.org/cgit/groff.git/commit/?id=d9e90209725a716dff23807ffffda403c58020c9 ?  That way things will work regardless of the setting of `U`.

Colin Watson <cjwatson>
Group Member
Sun 01 Jun 2025 12:06:35 AM UTC, comment #9: 

I think the problem here is that https://salsa.debian.org/debian/groff/-/blob/master/debian/patches/man-hyperlinks.patch enables the `U` register, but I hadn't realized that that's broken in 1.23.0 for PDF output (https://savannah.gnu.org/bugs/?64572).

Adding the `-rU0` option is a workaround, although not an ideal one as it means you don't get proper hyperlinks even with a more recent groff.  I'm not sure how much energy I have for jumping through Ubuntu stable release update hoops given that I no longer work for Canonical, but I can at least fix it in Debian and that'll trickle down to newer Ubuntu releases over time.

Colin Watson <cjwatson>
Group Member
Sat 31 May 2025 09:03:58 PM UTC, comment #8: 

I'll attach the output I get on Ubuntu 24.04.  Here's the Ubuntu package version:

$ apt show groff
Package: groff
Version: 1.23.0-3build2
...

Here are the command lines:

groff -man -Tpdf ../xtrs.man > xtrs.man.pdf

groff -man -Tpdf -P-e ../xtrs.man > xtrs.man-P-e.pdf

The files aren't identical, but diffpdf doesn't find any differences in what's rendered. Both I think are missing all the URLs that should appear.

Tim Mann <mann>
Sat 31 May 2025 07:43:12 AM UTC, comment #7: 

Forgot to mention.

The current version of the xtrs man page can be found here.

https://github.com/TimothyPMann/xtrs/blob/master/xtrs.man

G. Branden Robinson <gbranden>
Group administrator
Sat 31 May 2025 07:41:17 AM UTC, comment #6: 

I may need help from Colin Watson or someone else with an Ubuntu 24.04 system.

When running a stock GNU groff 1.23.0 installation, I get the following result.


$ ~/groff-1.23.0/bin/groff -ww -man -Tpdf -a ./xtrs.man | tail
 so that we can incorporate the changes into future releases.
x X ps:exec [/Dest /pdf:bm26 /View [/FitH -554200 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm26 /Title (See also) /Level 2 /OUT pdfmark
See also
 cmddump(1), hex2cmd(1), cassette(1), mkdisk(1)
 There are many other TRS-80 resources available on the Web, including shareware and freeware emulators
 that run under MS-DOS and other operating systems, software for converting TRS-80 physical media to the
 emulator's disk file format, ROM images, and TRS-80 software that has already been converted. For point<hy>
 ers, see <la>http://www.tim-mann.org/trs80.html<ra>.
xtrs 2025-05-25 15


Here I can clearly see the URL that concludes the document text.

(I used the troff / groff `-a` option to render "approximate" output; it's documented in groff(1).)

I also get no warnings despite using `-ww`.

Looping in Colin.

G. Branden Robinson <gbranden>
Group administrator
Fri 30 May 2025 09:23:15 AM UTC, comment #5: 

Hi Tim,

It would help if you could attach the xattrs.man.pdf produced with -Tpdf and also if there is any improvement if you add "-P-e" to the groff command as well. Thank you for your help.

Deri James <deri>
Group Member
Fri 30 May 2025 01:53:13 AM UTC, comment #4: 


comment #2:

> I don't get them in angle brackets either. I will attach more details when time permits. This is on Ubuntu 24.04.  --Tim


Thanks, Tim.  Your comment and mine passed in the ether.  Will await your follow-up.  No rush--I'm on vacation and out of my comfortable working environment for another few days.

G. Branden Robinson <gbranden>
Group administrator
Fri 30 May 2025 01:49:24 AM UTC, comment #3: 


comment #1:

> Pdf support for .UR was added after 1.23.0 (January 2024). Before that I believe URLs were shown within <> which is what I see in the ps,  pdf and dvi versions. With current groff the links are fine and clickable. I can't make make the URLs "simply drop". The dvi derived pdf does not have the overview panel so I'm not sure how it is measured as "much better", perhaps it is the latex font spacing he prefers!
>
> (file #57256)


Thanks, Deri.  That matches my hazy recollection.  I remember from wordsmithing "NEWS" file entries for the forthcoming groff 1.24.0 that PDF hyperlink support in the man and mdoc packages will be new as of when we release it, but I had no recollection of the URLs being mishandled under 1.23.0--merely that they weren't "hyper".

I would think they're not "hyper" using `-Tdvi` either, since no one has added a feature to grodvi(1) in probably about 20 years, so whatever extension to TeX DVI was created to enable hyperlinking, grodvi probably does not yet support it.

Tim, can you clarify what your expectations were, and how "groff -man -Tpdf" failed to meet them?  Attaching a busted PDF produced by the groff in Ubuntu 24.04 is also fine.

G. Branden Robinson <gbranden>
Group administrator
Fri 30 May 2025 01:49:00 AM UTC, comment #2: 

I don't get them in angle brackets either. I will attach more details when time permits. This is on Ubuntu 24.04.  --Tim

Anonymous
Fri 30 May 2025 12:13:52 AM UTC, comment #1: 

Pdf support for .UR was added after 1.23.0 (January 2024). Before that I believe URLs were shown within <> which is what I see in the ps,  pdf and dvi versions. With current groff the links are fine and clickable. I can't make make the URLs "simply drop". The dvi derived pdf does not have the overview panel so I'm not sure how it is measured as "much better", perhaps it is the latex font spacing he prefers!

(file #57256)

Deri James <deri>
Group Member
Thu 29 May 2025 09:08:22 PM UTC, original submission:  

I noticed the following in a Git commit by Tim Mann (xtrs author/developer).


commit 4ed26faa9df22ccc692e8f06ba70769c46901331
Author:     Tim Mann <tim@tim-mann.org>
AuthorDate: Sun May 25 12:07:28 2025 -0700
Commit:     Tim Mann <tim@tim-mann.org>
CommitDate: Sun May 25 12:07:28 2025 -0700

    Update sound documentation

[snip]

    Bonus fix: I noticed that (again, at least on Ubuntu 24.04), "groff
    -man -Tpdf" produces bad output; for example, URLs (.UR macro) are
    simply dropped.  I changed the Makefile to use -Tdvi and dvipdf
    instead, which produces much better output.


Investigate this.  It sounds alarming.  Surely we didn't ship groff 1.23.0 like this.  I'm traveling right now (back in the saddle next week) but I seem to remember we have a unit test for this.

Repo: https://github.com/TimothyPMann/xtrs.git

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:
   

Attached Files
file #57266:  xtrs.man added by mann (66KiB - application/x-troff-man)
file #57264:  xtrs.man.pdf added by mann (111KiB - application/pdf)
file #57265:  xtrs.man-P-e.pdf added by mann (1MiB - application/pdf)
file #57256:  xtrs.pdf added by deri (57KiB - application/pdf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cjwatson (Posted a comment)
  • -email is unavailable- added by mann (Posted a comment)
  • -email is unavailable- added by gbranden (Debian/Ubuntu groff package maintainer)
  • -email is unavailable- added by deri (Updated the item)
  • -email is unavailable- added by gbranden (Submitted the item)
  • -email is unavailable- added by gbranden (original reporter)
  •  

    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 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-06-10 gbranden StatusNeed Info Duplicate
        Open/ClosedOpen Closed
    2025-06-07 gbranden StatusNone Need Info
        Summary[man] URLs specified with `UR` &quot;simply dropped&quot; with `-Tpdf` on Ubuntu 24.04 [man] URLs specified with `UR` and no link text "simply dropped" with `-Tpdf` on Ubuntu 24.04
    2025-06-01 gbranden Assigned toNone gbranden
        StatusNeed Info None
    2025-05-31 mann Attached File- Added xtrs.man, #57266
    2025-05-31 mann Attached File- Added xtrs.man.pdf, #57264
        Attached File- Added xtrs.man-P-e.pdf, #57265
    2025-05-31 gbranden Carbon-Copy- Added -email is unavailable-
    2025-05-30 gbranden StatusNone Need Info
    2025-05-30 deri Attached File- Added xtrs.pdf, #57256
    2025-05-29 gbranden Summary[man] URLs specified with `UR` &quot;simply dropped&quot; on Ubunutu 24.04 [man] URLs specified with `UR` "simply dropped" with `-Tpdf` on Ubuntu 24.04
    2025-05-29 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code