<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi Tom and Maria,<div><br></div><div>I’ve managed to put together a macOS runner. It is functioning, although the script is a bit messy.</div><div><a href="https://github.com/myzhang1029/bird/blob/master/.github/workflows/ci.yml">https://github.com/myzhang1029/bird/blob/master/.github/workflows/ci.yml</a></div><div><br></div><div>About testing on a Darwin kernel, I am not sure if that would be enough, because making bird compile on a Mac is also related to how Apple chooses to name constants like TCPOPT_SIGNATURE in the vendored header files.</div><div><br></div><div>Kind regards,</div><div>
<meta charset="UTF-8"><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>Maiyun Zhang <font size="1">(he/him)</font></div></div></div>
</div>
<div><br><blockquote type="cite"><div>Le 13 mars 2024 à 06:27, Tom Herbers <bird@tomherbers.de> a écrit :</div><br class="Apple-interchange-newline"><div><div>Hi,<br><br>GitHub offers free macOS Runners via GitHub Actions for all public<br>repositories [1].<br><br>That would be a legal of testing on macOS.<br><br>Now, of course, someone would have to put together a suitable workflow.<br><br><br>Kind regards,<br>Tom<br><br><br>[1]<br>https://docs.github.com/de/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories<br><br>Am Mittwoch, dem 13.03.2024 um 11:11 +0100 schrieb Maria Matejka via<br>Bird-users:<br><blockquote type="cite"> <br>Hello Zhang,<br> <br>thank you for your contribution. This looks includable, however I'd<br>like to ask you about maintainability of this patch. It may quite<br>quickly rot away. Is there an easy (and legal) way to have automatic<br>macOS build and basic run testing, without a need to maintain a<br>physical Mac?<br> <br> <br>Thanks,<br> Maria<br> <br> <br>On 2024-03-13 03:02, Zhang Maiyun via Bird-users wrote:<br> <br> <br><blockquote type="cite"> <br>Dear all,<br><br>This patch makes bird build and run on macOS with `sysconfig=bsd`.<br>It is mainly modifying preprocessor directives.<br><br>I have tested it on macOS 14.3.1 and it is able to establish BGP<br>sessions<br>and at least exchange IPv4 routes.<br><br>Kind regards,<br>Maiyun Zhang<br><br>Signed-off-by: Zhang Maiyun <me@maiyun.me><br>---<br> sysdep/bsd/krt-sock.c | 6 ++++++<br> sysdep/bsd/sysio.h    | 6 +++++-<br> sysdep/unix/io.c      | 3 +++<br> sysdep/unix/random.c  | 2 +-<br> 4 files changed, 15 insertions(+), 2 deletions(-)<br><br>diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c<br>index d13e20a3..afb66cb3 100644<br>--- a/sysdep/bsd/krt-sock.c<br>+++ b/sysdep/bsd/krt-sock.c<br>@@ -635,6 +635,7 @@ krt_read_route(struct ks_msg *msg, struct<br>krt_proto *p, int scan)<br>     krt_got_route_async(p, e, new, src);<br> }<br> <br>+#ifndef __APPLE__<br> static void<br> krt_read_ifannounce(struct ks_msg *msg)<br> {<br>@@ -661,6 +662,7 @@ krt_read_ifannounce(struct ks_msg *msg)<br> <br>   DBG("KRT: IFANNOUNCE what: %d index %d name %s\n", ifam-<br><blockquote type="cite">ifan_what, ifam->ifan_index, ifam->ifan_name);<br></blockquote> }<br>+#endif<br> <br> static void<br> krt_read_ifinfo(struct ks_msg *msg, int scan)<br>@@ -725,7 +727,9 @@ krt_read_ifinfo(struct ks_msg *msg, int scan)<br> <br>   if (fl & IFF_UP)<br>     f.flags |= IF_ADMIN_UP;<br>+#ifndef __APPLE__<br>   if (ifm->ifm_data.ifi_link_state != LINK_STATE_DOWN)<br>+#endif<br>     f.flags |= IF_LINK_UP;          /* up or unknown */<br>   if (fl & IFF_LOOPBACK)            /* Loopback */<br>     f.flags |= IF_MULTIACCESS | IF_LOOPBACK | IF_IGNORE;<br>@@ -873,9 +877,11 @@ krt_read_msg(struct proto *p, struct ks_msg<br>*msg, int scan)<br>     case RTM_CHANGE:<br>       krt_read_route(msg, (struct krt_proto *)p, scan);<br>       break;<br>+#ifndef __APPLE__<br>     case RTM_IFANNOUNCE:<br>       krt_read_ifannounce(msg);<br>       break;<br>+#endif<br>     case RTM_IFINFO:<br>       krt_read_ifinfo(msg, scan);<br>       break;<br>diff --git a/sysdep/bsd/sysio.h b/sysdep/bsd/sysio.h<br>index b6b42b1e..85081c07 100644<br>--- a/sysdep/bsd/sysio.h<br>+++ b/sysdep/bsd/sysio.h<br>@@ -32,7 +32,7 @@<br> #endif<br> <br> <br>-#ifdef __NetBSD__<br>+#if defined(__NetBSD__) || defined(__APPLE__)<br> <br> #ifndef IP_RECVTTL<br> #define IP_RECVTTL 23<br>@@ -49,6 +49,10 @@<br> #define TCP_MD5SIG<span class="Apple-tab-span" style="white-space:pre">      </span>TCP_SIGNATURE_ENABLE<br> #endif<br> <br>+#ifdef __APPLE__<br>+#define TCP_MD5SIG<span class="Apple-tab-span" style="white-space:pre">  </span>TCPOPT_SIGNATURE<br>+#endif<br>+<br> <br> #undef  SA_LEN<br> #define SA_LEN(x) (x).sa.sa_len<br>diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c<br>index 9b499020..81e09888 100644<br>--- a/sysdep/unix/io.c<br>+++ b/sysdep/unix/io.c<br>@@ -12,6 +12,9 @@<br> #ifndef _GNU_SOURCE<br> #define _GNU_SOURCE<br> #endif<br>+#ifdef __APPLE__<br>+#define __APPLE_USE_RFC_3542<br>+#endif<br> <br> #include <stdio.h><br> #include <stdlib.h><br>diff --git a/sysdep/unix/random.c b/sysdep/unix/random.c<br>index 4e64e56b..7d68c482 100644<br>--- a/sysdep/unix/random.c<br>+++ b/sysdep/unix/random.c<br>@@ -16,7 +16,7 @@<br> #include "sysdep/config.h"<br> #include "nest/bird.h"<br> <br>-#ifdef HAVE_GETRANDOM<br>+#if defined(HAVE_GETRANDOM) || (defined(__APPLE__) &&<br>defined(HAVE_GETENTROPY))<br> #include <sys/random.h><br> #endif<br> <br> <br></blockquote> <br></blockquote><br><br></div></div></blockquote></div><br></body></html>