Bug#1056145: e2fsprogs: FTBFS on hurd-i386

2023-11-19 Thread Theodore Ts'o
tag 1056145 pending
thanks

On Fri, Nov 17, 2023 at 07:09:27PM +0100, Svante Signell wrote:
> Source: e2fsprogs
> Version: 1.47.0-2
> Severity: important
> Tags: patch
> User: debian-h...@lists.debian.org
> Usertags: hurd
> X-Debbugs-CC: debian-h...@lists.debian.org
> 
> I chose to submit this patch to Debian instead of upstream as recommended. The
> upstream reports seemed to be a little dated:
> https://sourceforge.net/projects/e2fsprogs/ However, that page has the latest
> version available for download.

The upstream git repo is at
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git and most
discussions happen on the linux-ext4 kernel mailing list on
vger.kernel.org.  I don't really use sourceforge for much besides
uploading the release tarballs mostly for old time's sake.

But that's fine, becuase in addition to being the Debian maintainer
for e2fsprogs, I'malso the upstream maintainer.  :-)

> Regarding the patch it is a very simple ifdef solution to that specific file. 
> As
> can be found in other parts of the code similar definitions are made. Maybe a
> common header file defining PATH_MAX would be a better solution. (or 
> dynamically
> allocating space for strings as is recommended for GNU/Hurd)

We don't have a common header file which includes limit.h, which is
what brings in PATH_MAX.  And the library interfaces are set up much
like gethostname, where the caller allocates the buffer and passes in
a length.

So we'll just do what we've done in other places, and what most other
programs do that seem to deal with Hurd's lack of PATH_MAX.  Unlike
your patch, though, we'll put the #ifndef PATH_MAX at the beginning of
file, after the header files are included.

- Ted

commit 795dcc264f48098ca5b214bba7d1b94189b2e491
Author: Theodore Ts'o 
Date:   Sun Nov 19 21:06:12 2023 -0500

tune2fs.c: define PATH_MAX if it is not defined by the system headers

This is needed to compile on GNU/Hurd.

Addresses-Debian-Bug: #1056145
Signed-off-by: Theodore Ts'o 

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 458f7cf6a..9ffe0d199 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -51,11 +51,15 @@ extern int optind;
 #include 
 #include 
 #include 
-#include 
+#include /* for PATH_MAX */
 #ifdef HAVE_SYS_IOCTL_H
 #include 
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 #include "ext2fs/ext2_fs.h"
 #include "ext2fs/ext2fs.h"
 #include "ext2fs/kernel-jbd.h"



Bug#1056145: e2fsprogs: FTBFS on hurd-i386

2023-11-17 Thread Svante Signell
Source: e2fsprogs
Version: 1.47.0-2
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd
X-Debbugs-CC: debian-h...@lists.debian.org

Hi,

e2fsprogs FTBFS on hurd-i386 due to usage of PATH_MAX which is not defined on
GNU/Hurd. (Built in the past, last successful build was 1.46.6-1)

A patch enabling a successful build on GNU/Hurd is attached:
misc_tune2fs.c.diff

I chose to submit this patch to Debian instead of upstream as recommended. The
upstream reports seemed to be a little dated:
https://sourceforge.net/projects/e2fsprogs/ However, that page has the latest
version available for download.

Regarding the patch it is a very simple ifdef solution to that specific file. As
can be found in other parts of the code similar definitions are made. Maybe a
common header file defining PATH_MAX would be a better solution. (or dynamically
allocating space for strings as is recommended for GNU/Hurd) 

Thanks!








--- a/misc/tune2fs.c	2023-02-07 04:31:53.0 +0100
+++ b/misc/tune2fs.c	2023-11-17 16:09:42.0 +0100
@@ -3159,6 +3159,9 @@
 int tune2fs_main(int argc, char **argv)
 #endif  /* BUILD_AS_LIB */
 {
+#ifndef MATH_MAX
+#define PATH_MAX 4096
+#endif
 	errcode_t retval;
 	ext2_filsys fs;
 	struct ext2_super_block *sb;