Use M1 runner to build arm64 macOS builds (#6868)
This commit is contained in:
parent
a6dfff725b
commit
3254686933
57
.github/workflows/osrm-backend.yml
vendored
57
.github/workflows/osrm-backend.yml
vendored
@ -30,7 +30,6 @@ jobs:
|
|||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
ENABLE_APPLE_SILICON: "OFF"
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: pip install "conan<2.0.0"
|
- run: pip install "conan<2.0.0"
|
||||||
@ -335,7 +334,7 @@ jobs:
|
|||||||
build_node_package: true
|
build_node_package: true
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
node: 20
|
node: 20
|
||||||
runs-on: macos-11
|
runs-on: macos-13 # x86_64
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
CCOMPILER: clang
|
CCOMPILER: clang
|
||||||
CXXCOMPILER: clang++
|
CXXCOMPILER: clang++
|
||||||
@ -347,14 +346,13 @@ jobs:
|
|||||||
build_node_package: true
|
build_node_package: true
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
node: 20
|
node: 20
|
||||||
runs-on: macos-11
|
runs-on: macos-14 # arm64
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
CCOMPILER: clang
|
CCOMPILER: clang
|
||||||
CXXCOMPILER: clang++
|
CXXCOMPILER: clang++
|
||||||
CUCUMBER_TIMEOUT: 60000
|
CUCUMBER_TIMEOUT: 60000
|
||||||
ENABLE_ASSERTIONS: ON
|
ENABLE_ASSERTIONS: ON
|
||||||
ENABLE_CONAN: ON
|
ENABLE_CONAN: ON
|
||||||
ENABLE_APPLE_SILICON: ON
|
|
||||||
|
|
||||||
name: ${{ matrix.name}}
|
name: ${{ matrix.name}}
|
||||||
continue-on-error: ${{ matrix.continue-on-error }}
|
continue-on-error: ${{ matrix.continue-on-error }}
|
||||||
@ -374,13 +372,13 @@ jobs:
|
|||||||
ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }}
|
ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }}
|
||||||
ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }}
|
ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }}
|
||||||
NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }}
|
NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }}
|
||||||
ENABLE_APPLE_SILICON: ${{ matrix.ENABLE_APPLE_SILICON }}
|
|
||||||
TARGET_ARCH: ${{ matrix.TARGET_ARCH }}
|
TARGET_ARCH: ${{ matrix.TARGET_ARCH }}
|
||||||
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
|
OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }}
|
||||||
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
|
OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- name: Build machine architecture
|
||||||
|
run: uname -m
|
||||||
- name: Use Node.js
|
- name: Use Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@ -403,9 +401,9 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.conan
|
path: ~/.conan
|
||||||
key: v7-conan-${{ matrix.name }}-${{ github.sha }}
|
key: v9-conan-${{ matrix.name }}-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
v7-conan-${{ matrix.name }}-
|
v9-conan-${{ matrix.name }}-
|
||||||
- name: Enable test cache
|
- name: Enable test cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@ -434,7 +432,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dev dependencies
|
- name: Install dev dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install "conan<2.0.0"
|
python3 -m pip install "conan<2.0.0" || python3 -m pip install "conan<2.0.0" --break-system-packages
|
||||||
|
|
||||||
# workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499
|
# workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499
|
||||||
# and that's why CI cannot find conan executable installed above
|
# and that's why CI cannot find conan executable installed above
|
||||||
@ -497,16 +495,6 @@ jobs:
|
|||||||
echo "Using ${JOBS} jobs"
|
echo "Using ${JOBS} jobs"
|
||||||
pushd ${OSRM_BUILD_DIR}
|
pushd ${OSRM_BUILD_DIR}
|
||||||
|
|
||||||
# handle Apple Silicon cross compilation
|
|
||||||
if [[ "${ENABLE_APPLE_SILICON}" == "ON" ]]; then
|
|
||||||
ARCH=arm64
|
|
||||||
TARGET="${ARCH}-apple-darwin"
|
|
||||||
CFLAGS="$CFLAGS --target=$TARGET"
|
|
||||||
CXXFLAGS="$CXXFLAGS --target=$TARGET"
|
|
||||||
APPLE_SILICON_FLAGS=(-DCMAKE_C_COMPILER_TARGET="$TARGET" -DCMAKE_CXX_COMPILER_TARGET="$TARGET" -DCMAKE_SYSTEM_PROCESSOR="${ARCH}" -DCMAKE_SYSTEM_NAME="Darwin" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS")
|
|
||||||
else
|
|
||||||
APPLE_SILICON_FLAGS=()
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||||
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
|
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
|
||||||
@ -518,12 +506,10 @@ jobs:
|
|||||||
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
-DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \
|
||||||
-DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \
|
-DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \
|
||||||
-DENABLE_CCACHE=ON \
|
-DENABLE_CCACHE=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}
|
||||||
"${APPLE_SILICON_FLAGS[@]}"
|
|
||||||
|
|
||||||
make --jobs=${JOBS}
|
make --jobs=${JOBS}
|
||||||
|
|
||||||
if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" && "${ENABLE_APPLE_SILICON}" != "ON" ]]; then
|
if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then
|
||||||
make tests --jobs=${JOBS}
|
make tests --jobs=${JOBS}
|
||||||
make benchmarks --jobs=${JOBS}
|
make benchmarks --jobs=${JOBS}
|
||||||
ccache -s
|
ccache -s
|
||||||
@ -535,14 +521,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
- name: Build example
|
- name: Build example
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
mkdir example/build && pushd example/build
|
mkdir example/build && pushd example/build
|
||||||
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||||
make --jobs=${JOBS}
|
make --jobs=${JOBS}
|
||||||
popd
|
popd
|
||||||
- name: Run all tests
|
- name: Run all tests
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
make -C test/data benchmark
|
make -C test/data benchmark
|
||||||
|
|
||||||
@ -571,32 +557,32 @@ jobs:
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
- name: Use Node 18
|
- name: Use Node 18
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Run Node package tests on Node 18
|
- name: Run Node package tests on Node 18
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
node --version
|
node --version
|
||||||
npm run nodejs-tests
|
npm run nodejs-tests
|
||||||
- name: Use Node 20
|
- name: Use Node 20
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Run Node package tests on Node 20
|
- name: Run Node package tests on Node 20
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
node --version
|
node --version
|
||||||
npm run nodejs-tests
|
npm run nodejs-tests
|
||||||
- name: Use Node latest
|
- name: Use Node latest
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: latest
|
node-version: latest
|
||||||
- name: Run Node package tests on Node-latest
|
- name: Run Node package tests on Node-latest
|
||||||
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
|
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }}
|
||||||
run: |
|
run: |
|
||||||
node --version
|
node --version
|
||||||
npm run nodejs-tests
|
npm run nodejs-tests
|
||||||
@ -624,15 +610,6 @@ jobs:
|
|||||||
# name: codecov-osrm-backend
|
# name: codecov-osrm-backend
|
||||||
# fail_ci_if_error: true
|
# fail_ci_if_error: true
|
||||||
# verbose: true
|
# verbose: true
|
||||||
- name: Check Apple Silicon binary
|
|
||||||
if: ${{ matrix.ENABLE_APPLE_SILICON == 'ON' }}
|
|
||||||
run: |
|
|
||||||
ARCH=$(file ./lib/binding/node_osrm.node | awk '{printf $NF}')
|
|
||||||
if [[ "$ARCH" != "arm64" ]]; then
|
|
||||||
file ./lib/binding/node_osrm.node
|
|
||||||
>&2 echo "Wrong architecture!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Build Node package
|
- name: Build Node package
|
||||||
if: ${{ matrix.build_node_package }}
|
if: ${{ matrix.build_node_package }}
|
||||||
run: ./scripts/ci/node_package.sh
|
run: ./scripts/ci/node_package.sh
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
- NodeJS:
|
- NodeJS:
|
||||||
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
|
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
|
||||||
- Misc:
|
- Misc:
|
||||||
|
- CHANGED: Update Conan Boost version to 1.85.0. [#6868](https://github.com/Project-OSRM/osrm-backend/pull/6868)
|
||||||
- FIXED: Fix an error in a RouteParameters AnnotationsType operator overload. [#6646](https://github.com/Project-OSRM/osrm-backend/pull/6646)
|
- FIXED: Fix an error in a RouteParameters AnnotationsType operator overload. [#6646](https://github.com/Project-OSRM/osrm-backend/pull/6646)
|
||||||
- ADDED: Add support for "unlimited" to be passed as a value for the default-radius and max-matching-radius flags. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
|
- ADDED: Add support for "unlimited" to be passed as a value for the default-radius and max-matching-radius flags. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
|
||||||
- CHANGED: Allow -1.0 as unlimited for default_radius value. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
|
- CHANGED: Allow -1.0 as unlimited for default_radius value. [#6599](https://github.com/Project-OSRM/osrm-backend/pull/6599)
|
||||||
|
@ -330,7 +330,7 @@ if(ENABLE_CONAN)
|
|||||||
|
|
||||||
conan_check(REQUIRED)
|
conan_check(REQUIRED)
|
||||||
|
|
||||||
set(CONAN_BOOST_VERSION "1.79.0@#96e4902111a2e343a8ba0aa95391bb58")
|
set(CONAN_BOOST_VERSION "1.85.0@#14265ec82b25d91305bbb3b30d3357f8")
|
||||||
set(CONAN_BZIP2_VERSION "1.0.8@#d1b2d5816f25865acf978501dff1f897")
|
set(CONAN_BZIP2_VERSION "1.0.8@#d1b2d5816f25865acf978501dff1f897")
|
||||||
set(CONAN_EXPAT_VERSION "2.2.10@#916908d4a570ad839edd25322c3268cd")
|
set(CONAN_EXPAT_VERSION "2.2.10@#916908d4a570ad839edd25322c3268cd")
|
||||||
set(CONAN_LUA_VERSION "5.4.4@#3ec62efc37cd0a5d80b9e5cb35277360")
|
set(CONAN_LUA_VERSION "5.4.4@#3ec62efc37cd0a5d80b9e5cb35277360")
|
||||||
|
@ -12,11 +12,6 @@ if [[ ${BUILD_TYPE} == "Debug" ]]; then
|
|||||||
NPM_FLAGS='--debug'
|
NPM_FLAGS='--debug'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# append --target_arch in order to handle cross-compilation for Apple Silicon
|
|
||||||
if [[ "$ENABLE_APPLE_SILICON" == "ON" ]]; then
|
|
||||||
NPM_FLAGS="${NPM_FLAGS} --target_arch=arm64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "dumping binary meta..."
|
echo "dumping binary meta..."
|
||||||
./node_modules/.bin/node-pre-gyp reveal $NPM_FLAGS
|
./node_modules/.bin/node-pre-gyp reveal $NPM_FLAGS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user