https://bz.mercurial-scm.org/show_bug.cgi?id=6881

            Bug ID: 6881
           Summary: Illumos: msg_control() not found
           Product: Mercurial
           Version: 6.7.4
          Hardware: All
                OS: Other
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzi...@mercurial-scm.org
          Reporter: w...@gatalith.at
                CC: mercurial-de...@mercurial-scm.org
    Python Version: ---

I maintain the pkgsrc package for mercurial.
jper...@pkgsrc.org recently made some changes to the package to make it compile
on Illumos, triggered by this failing build:
https://us-central.manta.mnx.io/pkgsrc/public/reports/upstream-trunk/20240623.2249/py311-mercurial-6.7.4/build.log

which errors out with:

hgclient.c: In function 'attachio':
hgclient.c:409:20: warning: implicit declaration of function 'CMSG_SPACE'
[-Wimplicit-function-declaration]
  409 |         char fdbuf[CMSG_SPACE(sizeof(fds))];
      |                    ^~~~~~~~~~
hgclient.c:410:13: error: 'struct msghdr' has no member named 'msg_control'
  410 |         msgh.msg_control = fdbuf;
      |             ^
hgclient.c:411:13: error: 'struct msghdr' has no member named 'msg_controllen'
  411 |         msgh.msg_controllen = sizeof(fdbuf);
      |             ^
hgclient.c:412:32: warning: implicit declaration of function 'CMSG_FIRSTHDR'
[-Wimplicit-function-declaration]
  412 |         struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msgh);
      |                                ^~~~~~~~~~~~~
hgclient.c:412:32: warning: initialization of 'struct cmsghdr *' from 'int'
makes pointer from integer without a cast [-Wint-conversion]
hgclient.c:415:26: warning: implicit declaration of function 'CMSG_LEN'
[-Wimplicit-function-declaration]
  415 |         cmsg->cmsg_len = CMSG_LEN(sizeof(fds));
      |                          ^~~~~~~~
hgclient.c:416:16: warning: implicit declaration of function 'CMSG_DATA'
[-Wimplicit-function-declaration]
  416 |         memcpy(CMSG_DATA(cmsg), fds, sizeof(fds));
      |                ^~~~~~~~~
hgclient.c:416:16: warning: passing argument 1 of 'memcpy' makes pointer from
integer without a cast [-Wint-conversion]
  416 |         memcpy(CMSG_DATA(cmsg), fds, sizeof(fds));
      |                ^~~~~~~~~~~~~~~
      |                |
      |                int
In file included from /usr/include/string.h:34,
                 from hgclient.c:19:
/usr/include/iso/string_iso.h:70:21: note: expected 'void * restrict' but
argument is of type 'int'
   70 | extern void *memcpy(void *_RESTRICT_KYWD, const void *_RESTRICT_KYWD,
size_t);
      |                     ^
hgclient.c:417:13: error: 'struct msghdr' has no member named 'msg_controllen'
  417 |         msgh.msg_controllen = cmsg->cmsg_len;
      |             ^

His workaround for this problem was adding "-D_XOPEN_SOURCE=600" to the
CPPFLAGS so that the function is provided in the namespace.

He also made two more changes for which I don't know the detailed rationale:
1. Linking against libsocket
2. adding a define for O_DIRECTORY:

--- contrib/chg/hgclient.c.orig 2024-06-24 09:00:13.361836008 +0000
+++ contrib/chg/hgclient.c
@@ -26,6 +26,10 @@
 #include "procutil.h"
 #include "util.h"

+#ifndef O_DIRECTORY
+#define O_DIRECTORY    O_RDONLY
+#endif
+
 enum {
        CAP_GETENCODING = 0x0001,
        CAP_RUNCOMMAND = 0x0002,

I'm reporting this so these changes can hopefully be merged.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to