Socket name length limitations and MacPorts buildbot

Ralph Seichter abbot at monksofcool.net
Tue Jun 11 11:10:40 UTC 2019


Working on the Notmuch port, I fixed a problem of the upstream configure
script calling mktemp with insufficient (for older OS X versions)
parameters [1]. Once that hurdle was passed, the builds ran into a
limitation for socket file name length. I opened another PR [2] in which
Chris Jones suggested I ask for help here.

A full socket file name (path + filename + NUL string terminator) may
only be 104 bytes long, as defined in <sys/un.h>.

  struct sockaddr_un {
    unsigned char   sun_len;        /* sockaddr len including null */
    sa_family_t     sun_family;     /* [XSI] AF_UNIX */
    char            sun_path[104];  /* [XSI] path name (gag) */
  };

Alas, buildbot uses working directories which can crack that limit:

  /opt/local/var/macports/build/_Users_vsts_agent_2.152.1_work_1_s_mail_notmuch/notmuch/work/notmuch-0.29

103 bytes, not counting the trailing NUL, so there is no way to create
any socket file within the build's working directory. I tried using /tmp
as a base at first, but it looks like Apple's method of using a symlink
pointing to whatever long-named directory can exceed the sun_path size
limit as well.

Has anybody else experienced this using MacPorts' buildbot, and if so,
do you have any idea how to resolve this problem?

Thanks for your input.

-Ralph

[1] https://github.com/macports/macports-ports/pull/4573
[2] https://github.com/macports/macports-ports/pull/4576#issuecomment-500635778


More information about the macports-dev mailing list