Discussion:
[PATCH] autogen: fix definition of MAXPATHLEN
(too old to reply)
Pino Toscano
2013-10-13 17:34:08 UTC
Permalink
Hi,

attached there is a patch for autogen to fix the definition of
MAXPATHLEN when not defined already (either not directly or because
PATH_MAX is not defined either).

This caused a build failure in sharutils (which embeds the libopts part
of autogen) on GNU/Hurd (which provides no PATH_MAX nor MAXPATHLEN) [1].
This happens because in autogen's autoopts.h there is:
# if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
which triggers a preprocessor parsing error when MAXPATHLEN is defined
as (size_t)4096.

[1] https://buildd.debian.org/status/fetch.php?pkg=sharutils&arch=hurd-i386&ver=1%3A4.13.5-1&stamp=1381663210

Thanks,
--
Pino Toscano
Bruce Korb
2013-10-14 17:22:36 UTC
Permalink
Post by Pino Toscano
Hi,
attached there is a patch for autogen to fix the definition of
MAXPATHLEN when not defined already (either not directly or because
PATH_MAX is not defined either).
This caused a build failure in sharutils (which embeds the libopts part
of autogen) on GNU/Hurd (which provides no PATH_MAX nor MAXPATHLEN) [1].
# if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
which triggers a preprocessor parsing error when MAXPATHLEN is defined
as (size_t)4096.
I think the correct fix would be to ensure that "size_t" is defined.

"size_t" is defined by <sys/types.h>, <unistd.h> and/or <stdio.h>, depending
on platform, and all are included before any attempt is made to hack around
MAXPATHLEN. So what's going on on Hurd? Is there a bug that "config.h"
is not included first?
Pino Toscano
2013-10-14 18:03:58 UTC
Permalink
Post by Bruce Korb
Post by Pino Toscano
Hi,
attached there is a patch for autogen to fix the definition of
MAXPATHLEN when not defined already (either not directly or because
PATH_MAX is not defined either).
This caused a build failure in sharutils (which embeds the libopts
part of autogen) on GNU/Hurd (which provides no PATH_MAX nor
MAXPATHLEN) [1]. This happens because in autogen's autoopts.h there
# if defined(PATH_MAX) && (PATH_MAX > MAXPATHLEN)
which triggers a preprocessor parsing error when MAXPATHLEN is
defined as (size_t)4096.
I think the correct fix would be to ensure that "size_t" is defined.
You are misunderstanding the issue, which boild down to a bad way to
define things used in preprocessor conditionals.

Let's pick a simplied version of how the above #if becomes:
#if 10 > ((int)5)
No matter whether size_t is known or not by the preprocessor (and not
even by the actual compiler), the cast in preprocessor condition is a
syntax error, hence the issue.

This happens because, since MAXPATHLEN (and PATH_MAX) is not defined in
Hurd's sys/param.h, in compat/compat.h the following line is used:
# define MAXPATHLEN ((size_t)4096)
and thus a cast appears in the #if mentioned above (in autoopts.h).
--
Pino Toscano
Bruce Korb
2013-10-14 19:02:23 UTC
Permalink
Post by Pino Toscano
No matter whether size_t is known or not by the preprocessor (and not
even by the actual compiler), the cast in preprocessor condition is a
syntax error, hence the issue.
Oops. You are correct.
http://autogen.sourceforge.net/data/autogen-5.18.2pre11.tar.xz

will be available within 30 minutes.
Bruce Korb
2013-10-14 19:27:04 UTC
Permalink
And now, in the same place, is a pre-release of sharutils:

http://autogen.sourceforge.net/data/sharutils-4.13.6pre4.tar.xz
Post by Bruce Korb
Oops. You are correct.
http://autogen.sourceforge.net/data/autogen-5.18.2pre11.tar.xz
will be available within 30 minutes.
Santiago Vila
2013-10-14 22:22:27 UTC
Permalink
Post by Bruce Korb
http://autogen.sourceforge.net/data/sharutils-4.13.6pre4.tar.xz
I confirm that this now builds ok on the Hurd. Thanks a lot.

Now there is a little problem with one of the tests, but this is not a
Hurd problem anymore:

FAIL: shar-1

test-suite.log has what it seems to be a diff between the expected
result and the real result, in diff -u notation:

--- shar-1-14129.sample 2013-10-15 00:14:14.032076423 +0200
+++ shar-1-14129.outf 2013-10-15 00:14:14.036076346 +0200
@@ -115,7 +115,7 @@
${echo} "x - SKIPPING shar-1.in (file already exists)"

else
-${echo} "x - extracting shar-1.in (text)"
+${echo} "x - extracting shar-1.in (texto)"
sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 shar-1.in
M5&AI<R!I<R!A('1E<W0*1G)O;2!T:&ES(&QI;F4L(&5N8V]D:6YG(&ES(&9O


Seems like a missing LC_ALL=C somewhere.
Bruce Korb
2013-10-14 23:08:49 UTC
Permalink
Post by Santiago Vila
--- shar-1-14129.sample 2013-10-15 00:14:14.032076423 +0200
+++ shar-1-14129.outf 2013-10-15 00:14:14.036076346 +0200
@@ -115,7 +115,7 @@
${echo} "x - SKIPPING shar-1.in (file already exists)"
else
-${echo} "x - extracting shar-1.in (text)"
+${echo} "x - extracting shar-1.in (texto)"
sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 shar-1.in
M5&AI<R!I<R!A('1E<W0*1G)O;2!T:&ES(&QI;F4L(&5N8V]D:6YG(&ES(&9O
Seems like a missing LC_ALL=C somewhere.
creo que si. I'll look for it. Thanks.
Bruce Korb
2013-10-15 18:52:57 UTC
Permalink
Post by Santiago Vila
Post by Bruce Korb
http://autogen.sourceforge.net/data/sharutils-4.13.6pre4.tar.xz
I confirm that this now builds ok on the Hurd. Thanks a lot.
Now there is a little problem with one of the tests, but this is not a
LC_ALL=C problem (and some typos) are now fixed with "pre5"
the this-time-for-sure pre-release. ;)

http://autogen.sourceforge.net/data/sharutils-4.13.6pre5.tar.xz

Loading...