From 0496e1e889ce153c75bf9cbc6695bb0f0ecda984 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Mon, 10 Apr 2023 02:31:13 +0800 Subject: [PATCH] build(ci): ensure correct headers are used on macOS Currently, the release build picks up headers in `/Library/Frameworks/Mono.framework/Headers`. You can verify this by downloading the latest nightly build and checking the output of `nvim --version`. These headers are likely to be from a different version of `libintl` than the one we link to. Let's avoid usage of them by setting `CMAKE_FIND_FRAMEWORK` to `NEVER`. --- .github/scripts/build_universal_macos.sh | 12 ++++++++++-- .github/workflows/test.yml | 2 ++ cmake.deps/CMakeLists.txt | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/scripts/build_universal_macos.sh b/.github/scripts/build_universal_macos.sh index 742a3078d6..d07c395cd6 100755 --- a/.github/scripts/build_universal_macos.sh +++ b/.github/scripts/build_universal_macos.sh @@ -2,9 +2,17 @@ MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)" export MACOSX_DEPLOYMENT_TARGET -cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 +cmake -S cmake.deps -B .deps -G Ninja \ + -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \ + -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ + -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \ + -D CMAKE_FIND_FRAMEWORK=NEVER cmake --build .deps -cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 +cmake -B build -G Ninja \ + -D CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \ + -D CMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ + -D CMAKE_OSX_ARCHITECTURES=arm64\;x86_64 \ + -D CMAKE_FIND_FRAMEWORK=NEVER cmake --build build # Make sure we build everything for M1 as well for macho in build/bin/* build/lib/nvim/parser/*.so; do diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3909699b69..b80432ee0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,6 +134,8 @@ jobs: flags: -D UNSIGNED_CHAR=ON - cc: clang runner: macos-12 + flags: -D CMAKE_FIND_FRAMEWORK=NEVER + deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER # functionaltest-lua is our dumping ground for non-mainline configurations. # 1. Check that the tests pass with PUC Lua instead of LuaJIT. diff --git a/cmake.deps/CMakeLists.txt b/cmake.deps/CMakeLists.txt index 4ff52f021f..25b449ffcd 100644 --- a/cmake.deps/CMakeLists.txt +++ b/cmake.deps/CMakeLists.txt @@ -17,7 +17,8 @@ set(DEPS_CMAKE_ARGS -D CMAKE_C_STANDARD=99 -D CMAKE_GENERATOR=${CMAKE_GENERATOR} -D CMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} - -D CMAKE_POSITION_INDEPENDENT_CODE=ON) + -D CMAKE_POSITION_INDEPENDENT_CODE=ON + -D CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK}) set(DEPS_CMAKE_CACHE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES})