bugGNU roff - Bugs: bug #60035, build failure on macOS

 
 

bug #60035: build failure on macOS

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Wed 10 Feb 2021 07:26:01 PM UTC
   
 
Category:  General Severity:  4 - Important
Item Group:  Build/Installation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Feb 2021 08:18:32 PM UTC, comment #1: 

Fingers crossed.


commit 979f3f4266151c7681a68a40d2c4913842a7271d (HEAD -> master, origin/master, origin/HEAD)
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Feb 11 07:09:21 2021 +1100

    Address build failure on macOS.

    Follow the advice of the gnulib manual ("Changing your source for use
    with gnulib") more scrupulously; include config.h in more files.

    * src/libs/libgroff/assert.cpp [HAVE_CONFIG_H]: #include config.h using
      angle brackets instead of quotation marks.

    * src/libs/libgroff/curtime.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/device.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/errarg.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/error.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/fatal.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/string.cpp [HAVE_CONFIG_H]:
    * src/libs/libgroff/strsave.cpp [HAVE_CONFIG_H]:
    * src/preproc/eqn/other.cpp [HAVE_CONFIG_H]:
    * src/preproc/eqn/text.cpp [HAVE_CONFIG_H]:
    * src/preproc/pic/object.cpp [HAVE_CONFIG_H]: Do it.

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


G. Branden Robinson <gbranden>
Group administrator
Wed 10 Feb 2021 07:26:01 PM UTC, original submission:  

A generalization of bug #59276.

See thread beginning at:

https://lists.gnu.org/archive/html/groff/2021-02/msg00018.html

and especially T. Kurt Bond's analysis at:

https://lists.gnu.org/archive/html/groff/2021-02/msg00043.html

Here's the body of the final message inline so this report has some direct context.


It turns out that Dave Kemper <saint.snit@gmail.com>'s suggestion that it
was related to bug 59276
(http://savannah.gnu.org/bugs/index.php?59276) was correct.

I use Homebrew <https://brew.sh/> on macOS to install Unix packages
(instead of macports).  I recently did a "brew cleanup", which removes
old versions of packages.  This broke the brew installed groff, because it
depended on an older version of ghostscript that had been "cleaned up".  So
I tried "brew install -s groff" where the "-s" tells it to install from
source and it built correctly. I noticed that it was patching several files
in the process. I remembered that I'd tried building groff 1.22.4 from the
release tarball recently and it had *not* built correctly.

So I looked at the patch Homebrew was using (which you can find here
<https://raw.githubusercontent.com/Homebrew/formula-patches/8059b3027a4aa68d8f42e1281cc3a81449ca0010/groff/1.22.4.patch>
online) and found that the *only* thing that it does is add '#include
"config.h"' to the following files:

src/libs/libgroff/assert.cpp
src/libs/libgroff/errarg.cpp
src/libs/libgroff/error.cpp
src/preproc/eqn/eqn.ypp
*src/libs/libgroff/curtime.cpp*
src/libs/libgroff/device.cpp
src/libs/libgroff/fatal.cpp
src/libs/libgroff/string.cpp
src/libs/libgroff/strsave.cpp
src/preproc/eqn/text.cpp
src/preproc/eqn/other.cpp
src/preproc/pic/object.cpp


(Well, in some of those it adds '#ifdef HAVE_CONFIG_H/#endif' lines around
the include of config.h, but in others it doesn't.)

The file src/libs/libgroff/curtime.cpp is where the error shows up in my
build.

So I cloned a fresh copy of the groff git repo, applied the patch, and
didn't apply the hunks for that already had that '#include "config.h"' line
in them (src/libs/libgroff/assert.cpp, src/libs/libgroff/errarg.cpp,
src/libs/libgroff/error.cpp, and src/preproc/eqn/eqn.ypp).  But the
following files did get patched:

src/libs/libgroff/curtime.cpp
src/libs/libgroff/device.cpp
src/libs/libgroff/fatal.cpp
src/libs/libgroff/string.cpp
src/libs/libgroff/strsave.cpp
src/preproc/eqn/text.cpp
src/preproc/eqn/other.cpp
src/preproc/pic/object.cpp


I then ran bootstrap, configure, and make and the build finished without an
error.  Then a make check worked fine.  I did a make install, which I'd
configured to install to a particular directory, added that directory to
the front of PATH and rebuilt one of my documents.  It looked fine.

The link Dave Kemper pointed to -
https://www.gnu.org/software/gnulib/manual/html_node/Source-changes.html -
points out that that any source file that includes a '-I' that refers to
the Gnulib source directory needs to have ‘#include <config.h>’ at the
top.  (I'll note that the patch discussed above consistently uses '#include
"config.h"' instead of "#include <config.h>". )  I looked briefly at the
Makefile to see if I could figure out which files those should be, since
the output of make doesn't actually include the exact command executed, but
I'm not familiar with automake and figuring it out looked difficult for
me.

I briefly looked at how Macports <https://www.macports.org/> does it, and
the patch file
<https://github.com/macports/macports-ports/blob/master/sysutils/groff/files/patch-implicitly-defined.diff>
it uses just adds '#include <config.h>' to lib/math.in.h instead, which
seems like changing the gnulib source instead of changing the groff source
that uses gnulib, which doesn't seem like the right thing to do.

Anyway, I hope this explains the problem and the possible solution
understandably.


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

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-11 gbranden CategoryCore General
    2022-01-11 gbranden CategoryNone Core
    2021-02-10 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code