On Tue, Nov 12, 2024 at 04:27:21PM +0200, Eli Zaretskii wrote:
> > From: Gavin Smith <[email protected]>
> > Date: Sun, 10 Nov 2024 19:21:57 +0000
> > Cc: [email protected]
> > 
> > A pretest distribution for the next Texinfo release (7.2) has been
> > uploaded to
> > 
> > https://alpha.gnu.org/gnu/texinfo/texinfo-7.1.91.tar.xz
> 
> I tried to build this with mingw.org's MinGW, and encountered quite a
> few problems:

Thanks for the reports and your continued testing and support.

As you might not be surprised to hear, many of these error messages come
from code from outside of the Texinfo project: from gnulib, from Perl,
or autoconf/automake, so are somewhat awkward to track down and fix.  I'll
try to work through the issues as best as I can as and when I have time.


> 1. Warning during compilation of TestXS by configure script:
> 
>      libtool: compile:  d:/usr/bin/gcc.exe -DHAVE_CONFIG_H -I. -I. 
> -DDATADIR=\"d:/usr/share\" -DSYSCONFDIR=\"d:/usr/etc\" -DVERSION=\"7.1.91\" 
> -DXS_VERSION=\"7.1.91\" -ID:/usr/Perl/lib/CORE -Id:/usr/include -s -O2 
> -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT 
> -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields 
> -s -O2 -MT TestXS_la-TestXS.lo -MD -MP -MF .deps/TestXS_la-TestXS.Tpo -c 
> TestXS.c  -DDLL_EXPORT -DPIC -o .libs/TestXS_la-TestXS.o
>      In file included from D:/usr/Perl/lib/CORE/win32thread.h:4,
>                     from D:/usr/Perl/lib/CORE/perl.h:2690,
>                     from TestXS.xs:5:
>      D:/usr/Perl/lib/CORE/win32.h:273:1: warning: useless type name in empty 
> declaration
> 
>        273 | typedef long  uid_t;
>          | ^~~~~~~
>      D:/usr/Perl/lib/CORE/win32.h:274:1: warning: useless type name in empty 
> declaration
> 
>        274 | typedef long  gid_t;
>          | ^~~~~~~
> 
>    This is because tp/Texinfo/XS/config.h does:
> 
>      #define uid_t int
>      #define gid_t int

I had trouble finding where these strings came from. I
eventually found in the data files for autoconf (2.72, 2023), in
/usr/local/share/autoconf/types.m4:

AC_DEFUN([AC_TYPE_UID_T],
[AC_CHECK_TYPE([uid_t], [],
  [AC_DEFINE([uid_t], [int],
    [Define as 'int' if <sys/types.h> doesn't define.])])
AC_CHECK_TYPE([gid_t], [],
  [AC_DEFINE([gid_t], [int],
    [Define as 'int' if <sys/types.h> doesn't define.])])])

Maybe there has been some change from autoconf 2.71 to 2.72, or maybe
this macro is being called when it wasn't before due to some gnulib module
or other.

AC_TYPE_UID_T is only referenced in tp/Texinfo/XS/gnulib/signal_h.m4.  The
XS modules don't do anything with signals, but this file was brought in
as a dependency of another module:

commit 1ffb9d2712c4d296efac158de24603f50638941a
Author: Patrice Dumas <[email protected]>
Date:   2024-09-30 23:21:04 +0200

    Add gnulib copy-file module
    
    * tp/Texinfo/XS:
    Run "gnulib-tool --add-import copy-file"

Importing this module brought in many files.

As usual, the first solution to investigate regarding problems involving
gnulib modules is to remove the gnulib module.  I am never happy to see
new gnulib modules being imported, as I have often said before (many
reasons: bloat, complexity, interactions with Perl headers, configure
times).

The "copy-file" module is not documented in the Gnulib manual, so I looked
at its module file in Gnulib:

  Description:
  Copying of files.

This was not helpful.

I looked at the source code in gnulib/lib/copy-file.c and it defines
several functions for copying files, including copy_file_to which is
used in tp/Texinfo/XS/convert/convert_html.c.

It is a little hard to follow the git commit history around this point
(in gitk) because of numerous commits with dates different to their
commit dates, but looking at commits and ChangeLog entries after that
module was brought in, it is not obvious that the module is used elsewhere.

Surely there is an easier way of copying a file than bringing in a bunch
of gnulib code?

Running "gnulib-tool --remove-import copy-file" under tp/Texinfo/XS
results in 159 files being deleted (which would be great), but then
I'm unable to build the program (error below), so this may not be the
correct way of removing a gnulib module.

configure.ac:182: error: required file 'build-aux/config.rpath' not found

I tried running "gnulib-tool --add-import" but this did not put
config.rpath back.  Running "./autogen.sh" at top level did not
work either.  I do not remember removing a gnulib module being
this difficult.

Out of exasperation I restored build-aux/config.rpath with "git checkout",
but this led to other compilation errors (probably because "gnulib-tool
--remove-import copy-file" deleted too much).  So at present it seems
I am unable to perform the simple task of removing a gnulib module.

In tp/Texinfo/XS/gnulib/lib/Makefile.am, I found that in fact every gnulib
module had been removed *except* copy-file:

diff --git a/tp/Texinfo/XS/gnulib/lib/Makefile.am 
b/tp/Texinfo/XS/gnulib/lib/Makefile.am
index 5952d1bfb6..e8c4c2b025 100644
--- a/tp/Texinfo/XS/gnulib/lib/Makefile.am
+++ b/tp/Texinfo/XS/gnulib/lib/Makefile.am
@@ -34,42 +34,7 @@
 #  --libtool \
 #  --macro-prefix=gl \
 #  --po-domain=texinfo_tp \
-#  copy-file \
-#  euidaccess \
-#  getline \
-#  iconv \
-#  libunistring \
-#  locale \
-#  obstack \
-#  setenv \
-#  strchrnul \
-#  strndup \
-#  uchar \
-#  unicase/u8-tolower \
-#  unicase/u8-toupper \
-#  unictype/category-L \
-#  unictype/category-M \
-#  unictype/category-Mn \
-#  unictype/category-Nd \
-#  unictype/category-test \
-#  unictype/ctype-upper \
-#  unictype/property-alphabetic \
-#  unictype/property-join-control \
-#  unictype/property-test \
-#  uninorm/nfc \
-#  uninorm/nfkd \
-#  uninorm/u8-normalize \
-#  unistr/u32-next \
-#  unistr/u8-mbsnlen \
-#  unistr/u8-mbtouc \
-#  unistr/u8-next \
-#  unistr/u8-strlen \
-#  unistr/u8-strmbtouc \
-#  unistr/u8-uctomb \
-#  uniwidth/u8-strwidth \
-#  uniwidth/u8-width \
-#  unsetenv \
-#  vasprintf
+#  copy-file
 
 AUTOMAKE_OPTIONS = 1.14 gnits subdir-objects

I expect it is a bug in gnulib-tool (which is now written in Python, not
shell).  I'll report this to the gnulib developers and see what they
come back with.

> 
>    and D:/usr/Perl/lib/CORE/win32.h does:
> 
>      #ifdef __MINGW32__               /* Minimal Gnu-Win32 */
> 
>      typedef long             uid_t;
>      typedef long             gid_t;
> 
>    So basically what tp/Texinfo/XS/config.h does is unnecessary and
>    triggers a useless warning.
> 
>    As an attempt to fix: replace #define with typedef's, in
>    XS/config.h, exactly as Perl does:
> 
>      typedef long uid_t;
>      typedef long gid_t;
>    

Reply via email to