bugGNU roff - Bugs: bug #66518, [PATCH] [long-term] [libgroff]...

 
 

bug #66518: [PATCH] [long-term] [libgroff] stop doing what gnulib can do for us

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 03 Dec 2024 06:22:24 AM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Lint Status:  In Progress
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Jump to the original submission

Wed 12 Nov 2025 01:37:03 PM UTC, comment #13: 


commit 81e4c395916a5ac2eaeccc85172412d15b2df524
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Nov 7 11:09:57 2025 -0600

    Retire our putenv(3) replacement.

    ...in favor of gnulib's.  groff's was copied from glibc in 1991 and
    changed very little since.

    * Makefile.am: Drop putenv-referencing annotations.

    * bootstrap.conf (gnulib_modules): Add "putenv".

    * configure.ac: Drop `GROFF_NEED_DECLARATION([putenv])` call.  Drop
      `putenv` from `AC_REPLACE_FUNCS()` call.

    * src/devices/grops/ps.cpp:
    * src/devices/grops/psrm.cpp:
    * src/roff/groff/groff.cpp:
    * src/roff/troff/input.cpp: Drop conditional declaration of `putenv()`
      symbol.

    * src/libs/libgroff/putenv.c: Delete.

    * src/libs/libgroff/libgroff.am (EXTRA_DIST): Drop "putenv.c".

    Continues fixing Savannah #66518.

commit 524f1e4b9397dce40b4659b64c2debe0aaa421b0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Nov 10 08:00:43 2025 -0600

    Retire our fmod(3) replacement.

    ...in favor of gnulib's.  James Clark wrote groff's in 1989; it's
    changed very little since.

    * Makefile.am: Drop fmod-referencing annotations.
    * bootstrap.conf (gnulib_modules): Add "fmod".
    * configure.ac: Drop `fmod` from `AC_REPLACE_FUNCS()` call.
    * src/libs/libgroff/fmod.c: Delete.
    * src/libs/libgroff/libgroff.am (EXTRA_DIST): Drop "fmod.c".
    * src/preproc/pic/pic.ypp: Drop conditional declaration of `fmod()`
      symbol.

    Continues fixing Savannah #66518.


G. Branden Robinson <gbranden>
Group administrator
Thu 07 Aug 2025 04:33:58 PM UTC, comment #12: 

comment #11:

> comment #10:
> > See also bugs #61833, #62619, and #67398.
>
> Making those clickable in savannah: bug #61833, bug #62619, bug #67398.  (The last of those is now closed.)


Bug #62619 looks potentially helpful.

G. Branden Robinson <gbranden>
Group administrator
Thu 07 Aug 2025 04:25:54 PM UTC, comment #11: 

comment #10:

> See also bugs #61833, #62619, and #67398.


Making those clickable in savannah: bug #61833, bug #62619, bug #67398.  (The last of those is now closed.)

Dave <barx>
Group Member
Wed 06 Aug 2025 01:12:06 AM UTC, comment #10: 

  See also bugs #61833, #62619, and #67398.

Bjarni Ingi Gislason <bjarniig>
Mon 04 Aug 2025 05:25:02 PM UTC, comment #9: 

Alex Colomar posted a patch set that is at least adjacent to this ticket's purpose.  The patch doesn't eliminate any libgroff modules, but replaces some calculations with a gnulib function with "stronger type-safety constraints," per Alex.  This change seems to fit within the spirit if not the letter of this ticket, but can become its own ticket if the developers deem it out of jurisdiction here.

Latest version of the patch is at http://lists.gnu. ... -07/msg00012.html and its followups.

(In http://lists.gnu. ... -06/msg00074.html Alex posted an overview that was omitted from the later update of the patch.)

Dave <barx>
Group Member
Tue 15 Jul 2025 01:46:18 AM UTC, comment #8: 


commit d178bc7c57a19230276e46a78adecd0275e5d626
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Jul 10 13:44:25 2025 -0500

    Retire our `strerror()` implementation.

    It was specified in ANSI C89, we require ISO C99 anyway, and on top of
    that we use gnulib's "strerror" module to patch any egregious hole of
    that name on any host system.

    * src/libs/libgroff/strerror.c: Delete it.
    * src/libs/libgroff/libgroff.am (EXTRA_DIST): Stop shipping it.

    Continues fixing Savannah #66518.


G. Branden Robinson <gbranden>
Group administrator
Wed 25 Jun 2025 08:22:26 PM UTC, comment #7: 

At 2025-06-24T21:32:18-0400, Dave wrote:

> Follow-up Comment #6, bug #66518 (group groff):
>
> The entirety of the original submission, and the current Summary, make
> it clear this ticket's scope is limited to cleanup of libgroff.  This
> is why I posted Alex Colomar's note about pre-grohtml in #66672, where
> it was formerly in scope, rather than here.


Yes, that's true.  I think that now I want to slice the problem
differently.

G. Branden Robinson <gbranden>
Group administrator
Wed 25 Jun 2025 01:32:10 AM UTC, comment #6: 

The entirety of the original submission, and the current Summary, make it clear this ticket's scope is limited to cleanup of libgroff.  This is why I posted Alex Colomar's note about pre-grohtml in #66672, where it was formerly in scope, rather than here.

Dave <barx>
Group Member
Tue 24 Jun 2025 10:49:06 PM UTC, comment #5: 

The scope of this bug is the adoption of facilities gnulib offers that are not available in standard ISO C99 and ISO C++98.

Quoting the second comment in bug #66672:


At 2025-06-23T15:58:47-0400, Dave wrote:

    > Follow-up Comment #1, bug #66672 (group groff):
    >
    > Alex Colomar noted an item relevant to this ticket:
    > http://lists.gnu.org/r/groff/2024-01/msg00074.html


Indeed.  (pre-)grohtml's `make_string()` itches me every time I see it.

It should be on the hit list for resolving this bug.


G. Branden Robinson <gbranden>
Group administrator
Fri 04 Apr 2025 02:21:39 AM UTC, comment #4: 

Annotating "In Progress" ticket with "[long-term]" to reflect fact that its completion is not planned for the next release.

G. Branden Robinson <gbranden>
Group administrator
Sun 05 Jan 2025 10:23:40 AM UTC, comment #3: 


commit 3b241554d8da5b7a26cf70b4b5df54816a011c47
Author: Collin Funk <collin.funk1@gmail.com>
Date:   Wed Dec 25 02:16:07 2024 +0000

    Use the `strcase` Gnulib module.

    * Makefile.am: Update comment.
    * bootstrap.conf (gnulib_modules): Add strcase.
    * configure.ac: Remove checks for strcasecmp and strncasecmp.
    * src/libs/libgroff/strcasecmp.c: Delete file.
    * src/libs/libgroff/strncasecmp.c: Likewise.
    * src/libs/libgroff/libgroff.am (EXTRA_DIST): Remove deleted files.
    * src/include/lib.h (strcasecmp, strncasecmp): Remove declarations.
    * src/roff/groff/pipeline.c (strcasecmp): Likewise.

    See <https://savannah.gnu.org/bugs/?66518>.


G. Branden Robinson <gbranden>
Group administrator
Thu 02 Jan 2025 11:29:54 AM UTC, comment #2: 

Applying Collin's patch.  Thanks, Collin!

I have nothing else planned for this ticket before the groff 1.24 release.

G. Branden Robinson <gbranden>
Group administrator
Wed 25 Dec 2024 02:16:07 AM UTC, comment #1: 

Hi Branden,

I can try to help with some of this. I've attached a patch to use Gnulib for strcasecmp and strncasecmp.

This patch is simple since the Gnulib module doesn't depend on much. Therefore, we don't need to link programs to anything (other than libgnu.a and libgroff.a).


$ gnulib-tool --extract-recursive-link-directive strcase
$


Others will require system libraries and require <program>_LDADD variables to be updated.

For example:


$ gnulib-tool --extract-recursive-link-directive mkstemp
$(CLOCK_TIME_LIB)
$(GETRANDOM_LIB)


On some systems extra libraries are needed for clock_gettime and getrandom, so all programs using mkstemp will need those added to <program>_LDADD.

The most time-consuming part will be updating those.

Happy to help with the rest if you don't get to it first. :)

(file #56715)

Collin Funk <collinfunk>
Tue 03 Dec 2024 06:22:24 AM UTC, original submission:  

libgroff is partly a utility library and partly a portability library.

The files "src/include/posix.h" and "src/include/nonposix.h" underscore the latter functionality.

gnulib has been in this business about as long, and much more steadily.  We had a getopt_long implementation that was lifted from glibc many years ago and not kept in sync.  (I noticed that it didn't return ':' when an option argument was missing as documented in more recent implementations.)

For groff 1.25, rip out whatever we can.  Some of this stuff is 30-35 years old.

As another idea, it might not kill us to have a libgroff(3) man page that is never shipped, but provided for the convenience of groff developers armed with "man -l".  Or, ya know, "nroff -man", since we're...uh..._groff_ developers.

G. Branden Robinson <gbranden>
Group administrator

 

Attached Files

Attached Files

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by bjarniig (Posted a comment)
  • -email is unavailable- added by barx
  • -email is unavailable- added by barx (Updated the item)
  • -email is unavailable- added by collinfunk (Updated the item)
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    Votes

    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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-08-04 barx Carbon-Copy- Added alx
    2025-08-04 barx Summary[long-term] [libgroff] stop doing what gnulib can do for us [PATCH] [long-term] [libgroff] stop doing what gnulib can do for us
    2025-04-04 gbranden Summary[libgroff] stop doing what gnulib can do for us [long-term] [libgroff] stop doing what gnulib can do for us
    2025-01-05 gbranden Summary[PATCH] [libgroff] stop doing what gnulib can do for us [libgroff] stop doing what gnulib can do for us
    2025-01-02 gbranden StatusPostponed In Progress
    2024-12-27 barx Summary[libgroff] stop doing what gnulib can do for us [PATCH] [libgroff] stop doing what gnulib can do for us
    2024-12-25 collinfunk Attached File- Added 0001-maint-Use-the-strcase-Gnulib-module.patch, #56715

    Back to the top

    Powered by Savane 3.16-598c.
    Corresponding source code