bugGNU nano - Bugs: bug #61719, 6.0 fails to build on macOS...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #61719: 6.0 fails to build on macOS (Darwin)

Submitted by:  Sam James <thesamesam>
Submitted on:  Thu 23 Dec 2021 07:08:07 AM UTC  
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Open

( Jump to the original submission)

Tue 28 Dec 2021 02:49:06 PM UTC, comment #11: 

Thanks for confirming.  Fixed in git, commit 4a1db96d, by calling autopoint before gnulib-tool.

About the other older m4 files...  I haven't tried to figure out who installs them to m4/, but if gnulib needs them to be more recent, surely gnulib-tool should overwrite them.  If it's not doing that, the existing versions must be okay.

(By the way, the uintmax_t.m4 file is not in my gnulib/m4/ directory, only in m4/.  The ones that are older in m4/ compared to gnulib/m4/ are for me: gettext.m4, iconv.m4, intlmacosx.m4, lcmessage.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4, longlong.m4, nls.m4, po.m4, and progtest.m4.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 28 Dec 2021 03:34:44 AM UTC, comment #10: 

comment #9:

> Thanks for figuring out that the problem is with m4/extern-inline.m4 and for the link to https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html.
>
> As that section of the manual says, the correct order of things is to call autopoint before gnulib-tool and not call it afterward.  So, that is what I propose to do.  Because applying a thousand-line patch (to start using the bootstrap script) just to avoid one small file getting overwritten by a foolish autopoint is madness.  Setting AUTOPOINT=true before calling autoreconf looks ugly.  I've run autoreconf with --verbose to see what it does, and propose to apply the attached patch.  Tested on my two machines, and on a virtual Alpine and three virtual BSD machines, each on a fresh clone of nano.  Please verify that this solves the issue for you too.
>
> (file #52571)


FWIW, I do agree on that, I didn't really like even submitting it, but I wasn't sure how supported it is to do it manually w/ gnulib. Surely not too bad as they tell us how to do it manually :)

Confirmed that works for me! Thanks a lot bens.

I am concerned about a few other macros though, even though they're not yet causing a problem. Missing bugfixes from gnulib is probably asking for trouble. If I check head m4/*.m4, I see a bunch still have ~2013 headers, even though the corresponding macros in gnulib/m4 don't.

Examples for me are:
- m4/intlmacosx.m4
- m4/uintmax_t.m4
- ...

Sam James <thesamesam>
Sun 26 Dec 2021 10:40:39 AM UTC, comment #9: 

Thanks for figuring out that the problem is with m4/extern-inline.m4 and for the link to https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html.

As that section of the manual says, the correct order of things is to call autopoint before gnulib-tool and not call it afterward.  So, that is what I propose to do.  Because applying a thousand-line patch (to start using the bootstrap script) just to avoid one small file getting overwritten by a foolish autopoint is madness.  Setting AUTOPOINT=true before calling autoreconf looks ugly.  I've run autoreconf with --verbose to see what it does, and propose to apply the attached patch.  Tested on my two machines, and on a virtual Alpine and three virtual BSD machines, each on a fresh clone of nano.  Please verify that this solves the issue for you too.

(file #52571)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 24 Dec 2021 03:21:04 AM UTC, comment #8: 

Attached a patch which seems to work for me to convert to gnulib's bootstrap script. I've gone with it because it looks like coreutils, wget, any others I can think of using gnulib use it too, and it seems to adapt/know about gnulib's quirks and be the intended use(?)

Appreciate it might be a workflow change for you though. Not a gnulib expert at all so might be a better solution out there.

Thanks for your help so far.

Sam James <thesamesam>
Fri 24 Dec 2021 01:32:54 AM UTC, comment #7: 

comment #6:

> Okay, cool. I found https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html and given we're not using the gnulib bootstrap script (which is rather long and covers a lot of edge cases), I think we need to be setting AUTOPOINT=true before calling autoreconf.
>
> With this, the m4 file is up-to-date and nano builds fine for me.


This doesn't work perfectly though as we end up with ABOUT-NLS missing by default, I think.

Anyway, the gist to me seems like maybe we should just use bootstrap from gnulib and adapt to that workflow given it seems to do the right thing and it's what is expected(?).

Playing with a conversion but not really an expert on gnulib.

Sam James <thesamesam>
Fri 24 Dec 2021 01:22:40 AM UTC, comment #6: 

Okay, cool. I found https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html and given we're not using the gnulib bootstrap script (which is rather long and covers a lot of edge cases), I think we need to be setting AUTOPOINT=true before calling autoreconf.

With this, the m4 file is up-to-date and nano builds fine for me.

Sam James <thesamesam>
Fri 24 Dec 2021 01:06:02 AM UTC, comment #5: 

comment #4:

> Hmm.  Strange.  Homebrew [1] and Macports [2] do not seem to have problems building nano-6.0.  Could they have extra variables in their build environments to guide things?
>
> [1] https://formulae.brew.sh/formula/nano
> [2] https://github.com/macports/macports-ports/commits/master/editors/nano


Oh interesting. Maybe GCC 11 related?

>
> If you want to try pulling in newer gnulib commits, then cd down into gnulib/, git pull, copy the latest commit hash and paste it into nano's autogen.sh.  Then rerun the script.  (But I don't see any recent changes to timespec.h or localcharset.c, so it's unlikely to solve anything.)


I just realised that the commit/bug report I referenced [0] actually touches m4/extern-inline.m4. For some reason, when I run ./autogen.sh with the updated commit hash, it reverts that macro file to the old version, even when the version inside gnulib/m4/extern-inline.m4 is correct...

It pulls down the right one, copies it in to m4/, then overwrites it again?

```
$ ./autogen.sh
[...]
Creating m4/extern-inline.m4 # <-- this is the good one, ctrl-z'd
Finished.
[...]
Don't forget to
  - add "lib/Makefile" to AC_CONFIG_FILES in ./configure.ac,
  - mention "lib" in SUBDIRS in Makefile.am,
  - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am
    or add an AC_CONFIG_MACRO_DIRS([m4]) invocation in ./configure.ac,
  - mention "gnulib-cache.m4" in EXTRA_DIST in m4/Makefile.am,
  - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
  - invoke gl_INIT in ./configure.ac.
[...]
Copying file m4/extern-inline.m4 <-- bad?
[...]
```
Not sure where autoreconf(?) is getting that second copy from and why it's overwriting it yet.

[0] https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=29d79d473f52b0ec58f50c95ef782c66fc0ead21

Sam James <thesamesam>
Thu 23 Dec 2021 04:07:47 PM UTC, comment #4: 

Hmm.  Strange.  Homebrew [1] and Macports [2] do not seem to have problems building nano-6.0.  Could they have extra variables in their build environments to guide things?

[1] https://formulae.brew.sh/formula/nano
[2] https://github.com/macports/macports-ports/commits/master/editors/nano

If you want to try pulling in newer gnulib commits, then cd down into gnulib/, git pull, copy the latest commit hash and paste it into nano's autogen.sh.  Then rerun the script.  (But I don't see any recent changes to timespec.h or localcharset.c, so it's unlikely to solve anything.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 23 Dec 2021 07:22:36 AM UTC, comment #3: 

Running ./autogen.sh at the latest commit in nano.git (the 6.0 tag actually, but I was hoping for newer gnulib commits to be pulled in) fails too.

Sam James <thesamesam>
Thu 23 Dec 2021 07:15:05 AM UTC, comment #2: 
Sam James <thesamesam>
Thu 23 Dec 2021 07:11:07 AM UTC, comment #1: 

sorry: 6.0, 5.9 fail, and 5.8 works.

Sam James <thesamesam>
Thu 23 Dec 2021 07:08:07 AM UTC, original submission:  

nano 6.0 seems to fail to build for me on macOS (Darwin) on Gentoo Prefix. 5.9 was fine.

Initially reported downstream here: https://bugs.gentoo.org/829847.

Error may be within gnulib but not sure:
```
x86_64-apple-darwin20-gcc -DHAVE_CONFIG_H -I. -I..   -D_DARWIN_C_SOURCE -I/Users/sam/Gentoo/usr/include/ncursesw  -I/Users/sam/Gentoo/usr/include  -march=native -O2 -pipe -Wall -c -o gettime.o gettime.c
x86_64-apple-darwin20-gcc -DHAVE_CONFIG_H -I. -I..   -D_DARWIN_C_SOURCE -I/Users/sam/Gentoo/usr/include/ncursesw  -I/Users/sam/Gentoo/usr/include  -march=native -O2 -pipe -Wall -c -o hard-locale.o hard-locale.c
x86_64-apple-darwin20-gcc -DHAVE_CONFIG_H -I. -I..   -D_DARWIN_C_SOURCE -I/Users/sam/Gentoo/usr/include/ncursesw  -I/Users/sam/Gentoo/usr/include  -march=native -O2 -pipe -Wall -c -o localcharset.o localcharset.c
In file included from gettime.c:22:
timespec.h:52:1: warning: -Wattributes][]]
   52 | _GL_TIMESPEC_INLINE struct timespec
      | ^~~~~~~~~~~~~~~~~~~
timespec.h:52:21: error: expected identifier or ‘(’ before ‘struct’
   52 | _GL_TIMESPEC_INLINE struct timespec
      |                     ^~~~~~
timespec.h:63:1: warning: -Wattributes][]]
   63 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      | ^~~~~~~~~~~~~~~~~~~
timespec.h:63:21: error: expected identifier or ‘(’ before ‘int’
   63 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      |                     ^~~
timespec.h:71:1: warning: -Wattributes][]]
   71 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      | ^~~~~~~~~~~~~~~~~~~
timespec.h:71:21: error: expected identifier or ‘(’ before ‘int’
   71 | _GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
      |                     ^~~
timespec.h:85:1: warning: -Wattributes][]]
   85 | _GL_TIMESPEC_INLINE double
      | ^~~~~~~~~~~~~~~~~~~
timespec.h:85:21: error: expected identifier or ‘(’ before ‘double’
   85 | _GL_TIMESPEC_INLINE double
      |                     ^~~~~~
make[4]: *** [Makefile:2217: gettime.o] Error 1
make[4]: *** Waiting for unfinished jobs....
```

I've attached the full log.

Sam James <thesamesam>

 

Attached Files
file #52563:  0001-build-use-gnulib-s-bootstrap-script-update-gnulib.patch added by thesamesam (45KiB - application/octet-stream - Convert nano to use gnulib's bootstrap script)
file #52557:  build.log added by thesamesam (89KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-28 bens StatusNone => Fixed
    2021-12-26 bens Attached File- => Added 0001-build-prevent-autopoint-from-overwriting-a-newer-M4-.patch, #52571
        Assigned toNone => bens
    2021-12-24 thesamesam Attached File- => Added 0001-build-use-gnulib-s-bootstrap-script-update-gnulib.patch, #52563
    2021-12-23 thesamesam Attached File- => Added build.log, #52557

    Back to the top


    Powered by Savane 3.7