Fail to build s6 on GNU/Hurd

From: Shengjing Zhu <zhsj_at_debian.org>
Date: Sat, 21 Mar 2020 19:32:11 +0800

Hi,

For s6 latest release 2.9.1.0, I fail to build it on GNU/Hurd.

The log is at https://buildd.debian.org/status/fetch.php?pkg=s6&arch=hurd-i386&ver=2.9.1.0-1&stamp=1584722395&raw=0

In file included from /usr/include/i386-gnu/skalibs/bytestr.h:13,
                 from src/supervision/s6-notifyoncheck.c:12:
/usr/include/i386-gnu/bits/errno.h:137:3: error: redeclaration of
enumerator ‘EPROTOTYPE’
  137 | EPROTO = 0x40000074, /* Protocol error */
      | ^~~~~~
In file included from /usr/include/errno.h:28,
                 from /usr/include/i386-gnu/skalibs/ip46.h:8,
                 from src/include/s6/accessrules.h:9,
                 from src/include/s6/s6.h:10,
                 from src/supervision/s6-notifyoncheck.c:20:
/usr/include/i386-gnu/bits/errno.h:76:3: note: previous definition of
‘EPROTOTYPE’ was here
   76 | EPROTOTYPE = 0x40000029, /* Protocol
wrong type for socket */
      | ^~~~~~~~~~

The errno.h on hurd has an enum[1], and skalibs/posixishard.h
redefines EPROTO to EPROTOTYPE.
One possible workaround is to move the header order.

--- s6-2.9.1.0.orig/src/supervision/s6-notifyoncheck.c
+++ s6-2.9.1.0/src/supervision/s6-notifyoncheck.c
_at_@ -9,7 +9,6 @@

 #include <skalibs/types.h>
 #include <skalibs/allreadwrite.h>
-#include <skalibs/bytestr.h>
 #include <skalibs/sgetopt.h>
 #include <skalibs/strerr2.h>
 #include <skalibs/tai.h>
_at_@ -19,6 +18,8 @@

 #include <s6/s6.h>

+#include <skalibs/bytestr.h>
+

But I think there could be a better way to fix this.

[1] https://github.com/bminor/glibc/blob/master/sysdeps/mach/hurd/bits/errno.h#L26

-- 
Shengjing Zhu
Received on Sat Mar 21 2020 - 11:32:11 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC