build+ci: support macOS on arm64

Refs: #5135
Change-Id: I86f1955366df12cfb8b3e6f9d5e9f202778cc211
This commit is contained in:
Davide Pesavento committed 2022-08-18 20:50:05 -04:00
1 parent 4791fcb8ba
commit e541d1b250
7 files changed
+51 -41

No files matched your search

+5
View File
@@ -16,6 +16,11 @@ case $(uname) in
# Emulate a subset of os-release(5) # Emulate a subset of os-release(5)
export ID=macos export ID=macos
export VERSION_ID=$(sw_vers -productVersion) export VERSION_ID=$(sw_vers -productVersion)
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -x /usr/local/bin/brew ]]; then
eval "$(/usr/local/bin/brew shellenv)"
fi
;; ;;
esac esac
+2 -2
View File
@@ -54,8 +54,8 @@ from waflib import Utils, Logs, Errors
from waflib.Configure import conf from waflib.Configure import conf
from waflib.TaskGen import feature, after_method from waflib.TaskGen import feature, after_method
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib'] BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/homebrew/lib', '/opt/local/lib', '/sw/lib', '/lib']
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include'] BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/homebrew/include', '/opt/local/include', '/sw/include']
BOOST_VERSION_FILE = 'boost/version.hpp' BOOST_VERSION_FILE = 'boost/version.hpp'
BOOST_VERSION_CODE = ''' BOOST_VERSION_CODE = '''
+3 -2
View File
@@ -33,7 +33,7 @@ def configure(conf):
'The minimum supported clang version is 6.0.') 'The minimum supported clang version is 6.0.')
conf.flags = ClangFlags() conf.flags = ClangFlags()
else: else:
warnmsg = '%s compiler is unsupported' % cxx warnmsg = f'{cxx} compiler is unsupported'
conf.flags = CompilerFlags() conf.flags = CompilerFlags()
if errmsg: if errmsg:
@@ -200,7 +200,8 @@ class ClangFlags(GccBasicFlags):
flags = super(ClangFlags, self).getGeneralFlags(conf) flags = super(ClangFlags, self).getGeneralFlags(conf)
if Utils.unversioned_sys_platform() == 'darwin': if Utils.unversioned_sys_platform() == 'darwin':
# Bug #4296 # Bug #4296
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
flags['CXXFLAGS'] += [['-isystem', f'{brewdir}/include'], # for Homebrew
['-isystem', '/opt/local/include']] # for MacPorts ['-isystem', '/opt/local/include']] # for MacPorts
elif Utils.unversioned_sys_platform() == 'freebsd': elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790 # Bug #4790
+2 -2
View File
@@ -9,10 +9,10 @@ NFD relies on third-party software, licensed under the following licenses:
- The Boost libraries are licensed under the - The Boost libraries are licensed under the
[Boost Software License 1.0](https://www.boost.org/users/license.html) [Boost Software License 1.0](https://www.boost.org/users/license.html)
- CityHash is licensed under a - CityHash is licensed under the
[MIT license](https://github.com/google/cityhash/blob/master/COPYING) [MIT license](https://github.com/google/cityhash/blob/master/COPYING)
- Libpcap is licensed under a - Libpcap is licensed under the
[3-clause BSD license](https://github.com/the-tcpdump-group/libpcap/blob/master/LICENSE) [3-clause BSD license](https://github.com/the-tcpdump-group/libpcap/blob/master/LICENSE)
- The WebSocket++ library is licensed under the terms of the - The WebSocket++ library is licensed under the terms of the
+15 -15
View File
@@ -7,23 +7,23 @@ Supported platforms
NFD is built against a continuous integration system and has been tested on the NFD is built against a continuous integration system and has been tested on the
following platforms: following platforms:
- Ubuntu 18.04 (amd64, armhf, i386) - Ubuntu 18.04
- Ubuntu 20.04 (amd64) - Ubuntu 20.04
- Ubuntu 21.10 (amd64) - Ubuntu 22.04
- CentOS Stream 9 - Debian 11
- macOS 10.15 - CentOS Stream 9
- macOS 11 (Intel only) - macOS 10.15
- macOS 11
- macOS 12
NFD is known to work on the following platforms, although they are not officially NFD is known to work on the following platforms, although they are not officially
supported: supported:
- Alpine >= 3.12 - Alpine >= 3.12
- Debian >= 10 - Fedora >= 29
- Fedora >= 29 - Gentoo Linux
- Gentoo Linux - Raspberry Pi OS (formerly Raspbian) >= 2019-06-20
- Raspberry Pi OS (formerly Raspbian) >= 2019-06-20 - FreeBSD >= 12.0
- FreeBSD >= 12.0
- macOS 10.14
.. _Install NFD on Ubuntu Linux using the NDN PPA repository: .. _Install NFD on Ubuntu Linux using the NDN PPA repository:
@@ -76,7 +76,7 @@ Downloading from git
The first step is to obtain the source code for NFD and its main dependency, the The first step is to obtain the source code for NFD and its main dependency, the
*ndn-cxx* library. If you do not want a development version of NFD, make sure you *ndn-cxx* library. If you do not want a development version of NFD, make sure you
checkout the correct release tag (e.g., ``*-0.7.1``) from both repositories. checkout the correct release tag (e.g., ``*-0.8.0``) from both repositories.
.. code-block:: sh .. code-block:: sh
@@ -100,7 +100,7 @@ and its prerequisites.
On Linux, NFD needs the following dependencies to enable optional features: On Linux, NFD needs the following dependencies to enable optional features:
- On **Ubuntu**: - On **Debian** and **Ubuntu**:
.. code-block:: sh .. code-block:: sh
+10 -14
View File
@@ -1,13 +1,12 @@
Starting NFD on OSX >= 10.8 # Starting NFD on macOS
===========================
OSX provides a standard way to start system daemons, monitor their health, and restart macOS provides a standard way to start system daemons, monitor their health, and restart
when they die. them when they die.
Initial setup ## Initial setup
-------------
Edit `net.named-data.nfd` correcting paths for `nfd` binary, configuration and log files. Edit `net.named-data.nfd.plist` as needed, adjusting the paths for the `nfd` binary,
configuration, and log files.
# Copy launchd.plist for NFD # Copy launchd.plist for NFD
sudo cp net.named-data.nfd.plist /Library/LaunchDaemons/ sudo cp net.named-data.nfd.plist /Library/LaunchDaemons/
@@ -58,8 +57,8 @@ Folder `/usr/local/var/log/ndn` should be created and assigned proper user and g
`HOME` directory for `nfd` should be created and configured with correct library's config file `HOME` directory for `nfd` should be created and configured with correct library's config file
and contain proper NDN security credentials for signing Data packets. This is necessary since and contain proper NDN security credentials for signing Data packets. This is necessary since
default private key storage on OSX (`osx-keychain`) does not support non-interactive access, the default private key storage on macOS (`tpm-osxkeychain`) does not support non-interactive
and file-based private key storage needs to be used: access, and file-based private key storage needs to be used:
# Create HOME and generate self-signed NDN certificate for nfd # Create HOME and generate self-signed NDN certificate for nfd
sudo -s -- ' \ sudo -s -- ' \
@@ -115,13 +114,10 @@ be exported into `localhost_daemons_nfd.ndncert` file:
/usr/local/etc/ndn/certs/localhost_daemons_nfd.ndncert; \ /usr/local/etc/ndn/certs/localhost_daemons_nfd.ndncert; \
' '
## Enable auto-start
Enable auto-start
-----------------
sudo launchctl load -w /Library/LaunchDaemons/net.named-data.nfd.plist sudo launchctl load -w /Library/LaunchDaemons/net.named-data.nfd.plist
Disable auto-start ## Disable auto-start
------------------
sudo launchctl unload -w /Library/LaunchDaemons/net.named-data.nfd.plist sudo launchctl unload -w /Library/LaunchDaemons/net.named-data.nfd.plist
+14 -6
View File
@@ -423,17 +423,25 @@ BOOST_FIXTURE_TEST_CASE(ChangeMcastEndpointV6, UdpFactoryMcastFixture)
parseConfig(CONFIG1, false); parseConfig(CONFIG1, false);
auto udpMcastFaces = this->listUdp6McastFaces(); auto udpMcastFaces = this->listUdp6McastFaces();
BOOST_REQUIRE_EQUAL(udpMcastFaces.size(), netifsV6.size()); BOOST_REQUIRE_EQUAL(udpMcastFaces.size(), netifsV6.size());
auto expectedAddr = boost::asio::ip::address_v6::from_string("ff02::1101"); auto uri = udpMcastFaces.front()->getRemoteUri();
expectedAddr.scope_id(netifsV6.front()->getIndex()); BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
BOOST_CHECK_EQUAL(udpMcastFaces.front()->getRemoteUri(), FaceUri(udp::Endpoint(expectedAddr, 7011))); // check the address ignoring the scope id
auto addr = boost::asio::ip::address_v6::from_string(uri.getHost());
addr.scope_id(0);
BOOST_CHECK_EQUAL(addr, boost::asio::ip::address_v6::from_string("ff02::1101"));
BOOST_CHECK_EQUAL(uri.getPort(), "7011");
parseConfig(CONFIG2, false); parseConfig(CONFIG2, false);
g_io.poll(); g_io.poll();
udpMcastFaces = this->listUdp6McastFaces(); udpMcastFaces = this->listUdp6McastFaces();
BOOST_REQUIRE_EQUAL(udpMcastFaces.size(), netifsV6.size()); BOOST_REQUIRE_EQUAL(udpMcastFaces.size(), netifsV6.size());
expectedAddr = boost::asio::ip::address_v6::from_string("ff02::1102"); uri = udpMcastFaces.front()->getRemoteUri();
expectedAddr.scope_id(netifsV6.front()->getIndex()); BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
BOOST_CHECK_EQUAL(udpMcastFaces.front()->getRemoteUri(), FaceUri(udp::Endpoint(expectedAddr, 7012))); // check the address ignoring the scope id
addr = boost::asio::ip::address_v6::from_string(uri.getHost());
addr.scope_id(0);
BOOST_CHECK_EQUAL(addr, boost::asio::ip::address_v6::from_string("ff02::1102"));
BOOST_CHECK_EQUAL(uri.getPort(), "7012");
} }
BOOST_FIXTURE_TEST_CASE(Whitelist, UdpFactoryMcastFixture) BOOST_FIXTURE_TEST_CASE(Whitelist, UdpFactoryMcastFixture)