masneyb / gftp

gFTP is a free multithreaded file transfer client for *NIX based machines. 56 language translations available.
http://www.gftp.org
MIT License
118 stars 21 forks source link

gftp: FTBFS on hurd-i386: fatal error: stropts.h: No such file or directory #110

Closed hahawang-github closed 3 years ago

hahawang-github commented 3 years ago

I decide to fix a broken package found at the recommended page(https://people.debian.org/~sthibault/out_of_date.txt)named gftp.

After I download the package source and try to build without any modifications under the debian hurd running in qemu (debian-hurd-20210219.img), I got the following error.


pty.c:64:10: fatal error: stropts.h: No such file or directory
   64 | #include <stropts.h>
      |          ^~~~~~~~~~~
compilation terminated.

So that I decide to check the source code and find the following line:


#if !(defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) 
|| defined(__linux__))
#include <stropts.h>
#endif

Obviously, the GNU Hurd also haven't the stropt.h, so It is better to add a check of GNU-hurd at this line. By following the document available at https://sourceforge.net/p/predef/wiki/OperatingSystems/, I decide to add a check for GNU Hurd at this line.

Although this bug has already been submitted to the debian, debian-hurd and bug-hurd, kind people over there suggest me directly push the patch to the upstream.

A pull request is avaiable.

The debian bug tracking page, that already contains a submitted patch and other people's reviews.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988280

wdlkmpx commented 3 years ago

Ok, merged thanks.

So stropts.h is not supported by Linux, FreeBSD, NetBSD, Hurd, macOS...

https://stackoverflow.com/questions/61029226/how-do-i-install-libraries-for-stropts-h

stropts.h is part of the Posix STREAMS extension, which Linux never supported. (Since 2008, it has also been marked as obsolescent by Posix, so it may be removed in some future standard revision.)

That line is worth deleting.

hahawang-github commented 3 years ago

Thank you.

wdlkmpx commented 3 years ago

I read the Debian bug report, so #ifdef __sun should be used. But here's the thing, the relegated unix systems usually create a layer or something to run stuff that is linux-specific.

So that line will be removed. Glib2 is a layer above the libc and some kernel functionality, so some low level things can be replaced with glib2 stuff as far as I know.

So another cleanup should happen. But it's sad that a certain organization is relentlessly trying to destroy the desktop experience in UNIX systems. And it's getting more and more absurd.