build+ci: support macOS on arm64
Refs: #5135 Change-Id: Ifac57bf18dea805dc9eab06039806858bb3b6f20
This commit is contained in:
1 parent
dc3575fd92
commit
f662500858
11 files changed
+48
-39
No files matched your search
@@ -53,7 +53,7 @@ jobs:
|
||||
os: macos-11
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
NODE_LABELS: OSX
|
||||
NODE_LABELS: macos
|
||||
WAF_JOBS: 3
|
||||
steps:
|
||||
- name: Set up Xcode
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
run: |
|
||||
case ${RUNNER_OS} in
|
||||
Linux) export NODE_LABELS="Linux Ubuntu" ;;
|
||||
macOS) export NODE_LABELS="OSX" ;;
|
||||
macOS) export NODE_LABELS="macos" ;;
|
||||
esac
|
||||
find .jenkins.d/ -type f -name '[1-9]*.sh' -exec chmod -x '{}' +
|
||||
./.jenkins
|
||||
|
||||
@@ -4,6 +4,8 @@ source .jenkins.d/util.sh
|
||||
|
||||
if has Linux $NODE_LABELS; then
|
||||
export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
|
||||
elif [[ -x /opt/homebrew/bin/brew ]]; then
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
fi
|
||||
export CACHE_DIR=${CACHE_DIR:-/tmp}
|
||||
export WAF_JOBS=${WAF_JOBS:-1}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
if has OSX $NODE_LABELS; then
|
||||
if has macos $NODE_LABELS; then
|
||||
FORMULAE=(boost openssl pkg-config)
|
||||
if [[ $JOB_NAME == *"Docs" ]]; then
|
||||
FORMULAE+=(doxygen graphviz)
|
||||
|
||||
@@ -10,6 +10,9 @@ fi
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
COVERAGE="--with-coverage"
|
||||
fi
|
||||
if has macos-12 $NODE_LABELS; then
|
||||
KEYCHAIN="--without-osx-keychain"
|
||||
fi
|
||||
if [[ -n $DISABLE_PCH ]]; then
|
||||
PCH="--without-pch"
|
||||
fi
|
||||
@@ -31,7 +34,7 @@ if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
|
||||
fi
|
||||
|
||||
# Build shared library in debug mode with tests and examples
|
||||
./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $PCH
|
||||
./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $KEYCHAIN $PCH
|
||||
./waf --color=yes build -j$WAF_JOBS
|
||||
|
||||
# (tests will be run against the debug version)
|
||||
|
||||
@@ -4,7 +4,7 @@ set -ex
|
||||
# Prepare environment
|
||||
rm -rf ~/.ndn
|
||||
|
||||
if has OSX $NODE_LABELS; then
|
||||
if has macos-10.15 $NODE_LABELS; then
|
||||
security unlock-keychain -p named-data
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# CONTINUOUS INTEGRATION SCRIPTS
|
||||
# Continuous Integration Scripts
|
||||
|
||||
## Environment Variables Used in Build Scripts
|
||||
## Environment Variables
|
||||
|
||||
- `NODE_LABELS`: space-separated list of platform properties. The included values are used by
|
||||
the build scripts to select the proper behavior for different operating systems and versions.
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
Example values:
|
||||
|
||||
- `[OS_TYPE]`: `Linux`, `OSX`
|
||||
- `[OS_TYPE]`: `Linux`, `macos`
|
||||
- `[DISTRO_TYPE]`: `Ubuntu`, `CentOS`
|
||||
- `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`, `CentOS-8`, `OSX-10.14`, `OSX-10.15`
|
||||
- `[DISTRO_VERSION]`: `ubuntu-20.04`, `ubuntu-22.04`, `centos-9`, `macos-10.15`, `macos-11`
|
||||
|
||||
- `JOB_NAME`: optional variable that defines the type of build job. Depending on the job type,
|
||||
the build scripts can perform different tasks.
|
||||
|
||||
+2
-2
@@ -54,8 +54,8 @@ from waflib import Utils, Logs, Errors
|
||||
from waflib.Configure import conf
|
||||
from waflib.TaskGen import feature, after_method
|
||||
|
||||
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
|
||||
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include']
|
||||
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/homebrew/lib', '/opt/local/lib', '/sw/lib', '/lib']
|
||||
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/homebrew/include', '/opt/local/include', '/sw/include']
|
||||
|
||||
BOOST_VERSION_FILE = 'boost/version.hpp'
|
||||
BOOST_VERSION_CODE = '''
|
||||
|
||||
@@ -33,7 +33,7 @@ def configure(conf):
|
||||
'The minimum supported clang version is 6.0.')
|
||||
conf.flags = ClangFlags()
|
||||
else:
|
||||
warnmsg = '%s compiler is unsupported' % cxx
|
||||
warnmsg = f'{cxx} compiler is unsupported'
|
||||
conf.flags = CompilerFlags()
|
||||
|
||||
if errmsg:
|
||||
@@ -200,7 +200,8 @@ class ClangFlags(GccBasicFlags):
|
||||
flags = super(ClangFlags, self).getGeneralFlags(conf)
|
||||
if Utils.unversioned_sys_platform() == 'darwin':
|
||||
# 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
|
||||
elif Utils.unversioned_sys_platform() == 'freebsd':
|
||||
# Bug #4790
|
||||
|
||||
@@ -19,8 +19,11 @@ import re
|
||||
from waflib import Utils
|
||||
from waflib.Configure import conf
|
||||
|
||||
OPENSSL_DIR_OSX = ['/usr/local', '/opt/local', '/usr/local/opt/openssl']
|
||||
OPENSSL_DIR = ['/usr', '/usr/local', '/opt/local', '/sw']
|
||||
OPENSSL_DIR_MACOS = ['/usr/local',
|
||||
'/opt/homebrew/opt/openssl', # Homebrew on arm64
|
||||
'/usr/local/opt/openssl', # Homebrew on x86_64
|
||||
'/opt/local'] # MacPorts
|
||||
|
||||
def options(opt):
|
||||
opt.add_option('--with-openssl', type='string', default=None, dest='openssl_dir',
|
||||
@@ -43,7 +46,7 @@ def __openssl_find_root_and_version_file(self, root):
|
||||
|
||||
openssl_dirs = OPENSSL_DIR
|
||||
if Utils.unversioned_sys_platform() == 'darwin':
|
||||
openssl_dirs = OPENSSL_DIR_OSX
|
||||
openssl_dirs = OPENSSL_DIR_MACOS
|
||||
|
||||
for dir in openssl_dirs:
|
||||
file = self.__openssl_get_version_file(dir)
|
||||
|
||||
+24
-24
@@ -7,23 +7,23 @@ Supported platforms
|
||||
ndn-cxx is built against a continuous integration system and has been tested on the
|
||||
following platforms:
|
||||
|
||||
- Ubuntu 18.04 (amd64, armhf, i386)
|
||||
- Ubuntu 20.04 (amd64)
|
||||
- Ubuntu 21.10 (amd64)
|
||||
- CentOS Stream 9
|
||||
- macOS 10.15
|
||||
- macOS 11 (Intel only)
|
||||
- Ubuntu 18.04
|
||||
- Ubuntu 20.04
|
||||
- Ubuntu 22.04
|
||||
- Debian 11
|
||||
- CentOS Stream 9
|
||||
- macOS 10.15
|
||||
- macOS 11
|
||||
- macOS 12
|
||||
|
||||
ndn-cxx is known to work on the following platforms, although they are not officially
|
||||
supported:
|
||||
|
||||
- Alpine >= 3.12
|
||||
- Debian >= 10
|
||||
- Fedora >= 29
|
||||
- Gentoo Linux
|
||||
- Raspberry Pi OS (formerly Raspbian) >= 2019-06-20
|
||||
- FreeBSD >= 12.0
|
||||
- macOS 10.14
|
||||
- Alpine >= 3.12
|
||||
- Fedora >= 29
|
||||
- Gentoo Linux
|
||||
- Raspberry Pi OS (formerly Raspbian) >= 2019-06-20
|
||||
- FreeBSD >= 12.0
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
@@ -31,13 +31,13 @@ Prerequisites
|
||||
Required
|
||||
~~~~~~~~
|
||||
|
||||
- GCC >= 7.4 or clang >= 6.0 (if you are on Linux or FreeBSD)
|
||||
- Xcode >= 11.3 or corresponding version of Command Line Tools (if you are on macOS)
|
||||
- Python >= 3.6
|
||||
- pkg-config
|
||||
- Boost >= 1.65.1
|
||||
- OpenSSL >= 1.1.1
|
||||
- SQLite 3.x
|
||||
- GCC >= 7.4 or clang >= 6.0 (if you are on Linux or FreeBSD)
|
||||
- Xcode >= 11.3 or corresponding version of Command Line Tools (if you are on macOS)
|
||||
- Python >= 3.6
|
||||
- pkg-config
|
||||
- Boost >= 1.65.1
|
||||
- OpenSSL >= 1.1.1
|
||||
- SQLite 3.x
|
||||
|
||||
To build ndn-cxx from source, one must first install a C++ compiler and all necessary
|
||||
development tools and libraries:
|
||||
@@ -83,10 +83,10 @@ Optional
|
||||
To build tutorials, man pages, and API documentation the following additional dependencies
|
||||
need to be installed:
|
||||
|
||||
- doxygen
|
||||
- graphviz
|
||||
- sphinx >= 1.3
|
||||
- sphinxcontrib-doxylink
|
||||
- doxygen
|
||||
- graphviz
|
||||
- sphinx >= 1.3
|
||||
- sphinxcontrib-doxylink
|
||||
|
||||
The following lists the steps to install these prerequisites on various common platforms.
|
||||
|
||||
|
||||
Reference in new issue
Block a user