From a6ab29fa2d237634bf0ad999d10d074c0bf3bcc4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Jul 2026 06:02:56 +0000 Subject: [PATCH 1/2] Split public header packaging between framework and file set CMake 4.2 rejects a `HEADERS` file set on a `FRAMEWORK` target, which broke every macOS job that builds the weak-node-api framework: CMake Error in CMakeLists.txt: The file set "HEADERS", of type "HEADERS", is incompatible with the "FRAMEWORK" target "weak-node-api". The workaround pinned CMake to 4.1.2 on five macOS jobs (#374, #375, #377, and the pre-existing test-macos pin). This fixes the root cause instead. On Apple, the public headers are shipped via the framework's PUBLIC_HEADER property; other platforms use a HEADERS file set for install packaging. The build-interface include directories that the file set previously supplied to in-tree consumers (e.g. the C++ tests) are now provided explicitly via target_include_directories, so both branches build unchanged. With the root cause fixed, revert the macOS CMake version pin from all five jobs. CMAKE_VERSION is retained since it still selects the Android SDK cmake package for test-android. Closes #376 Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Aq4PqMYq8cQTP9Lf43JiwH --- .github/workflows/check.yml | 26 --------------------- packages/weak-node-api/CMakeLists.txt | 33 +++++++++++++++++++-------- 2 files changed, 24 insertions(+), 35 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2c85f58f..19371e28 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -92,12 +92,6 @@ jobs: with: packages: tools platform-tools ndk;${{ env.NDK_VERSION }} - run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim - # macOS runners ship a newer CMake than the project supports; pin it to match the version used elsewhere in CI - - name: Install compatible CMake version - if: runner.os == 'macOS' - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ env.CMAKE_VERSION }} - run: npm ci - run: npm run bootstrap - run: npm test @@ -125,12 +119,6 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2 with: key: ${{ github.job }}-${{ runner.os }} - # macOS runners ship a newer CMake than the project supports; pin it to match the version used elsewhere in CI - - name: Install compatible CMake version - if: runner.os == 'macOS' - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ env.CMAKE_VERSION }} - run: npm ci - run: npm run build - name: Prepare weak-node-api @@ -168,11 +156,6 @@ jobs: with: packages: tools platform-tools ndk;${{ env.NDK_VERSION }} - run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim - # macOS runners ship a newer CMake than the project supports; pin it to match the version used elsewhere in CI - - name: Install compatible CMake version - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ env.CMAKE_VERSION }} - run: npm ci - run: npm run bootstrap env: @@ -209,10 +192,6 @@ jobs: with: java-version: "17" distribution: "temurin" - - name: Install compatible CMake version - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ env.CMAKE_VERSION }} - run: rustup target add x86_64-apple-darwin - run: npm ci - run: npm run bootstrap @@ -345,11 +324,6 @@ jobs: distribution: "temurin" - run: rustup target add x86_64-apple-darwin x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim - run: rustup toolchain install nightly --component rust-src - # macOS runners ship a newer CMake than the project supports; pin it to match the version used elsewhere in CI - - name: Install compatible CMake version - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ env.CMAKE_VERSION }} - run: npm ci - run: npm run build - name: Build weak-node-api for all Apple architectures diff --git a/packages/weak-node-api/CMakeLists.txt b/packages/weak-node-api/CMakeLists.txt index 90525434..29080360 100644 --- a/packages/weak-node-api/CMakeLists.txt +++ b/packages/weak-node-api/CMakeLists.txt @@ -10,24 +10,32 @@ add_library(${PROJECT_NAME} SHARED) set(INCLUDE_DIR "include") set(GENERATED_SOURCE_DIR "generated") +set(PUBLIC_HEADER_FILES + ${GENERATED_SOURCE_DIR}/weak_node_api.hpp + ${GENERATED_SOURCE_DIR}/NodeApiHost.hpp + ${INCLUDE_DIR}/js_native_api_types.h + ${INCLUDE_DIR}/js_native_api.h + ${INCLUDE_DIR}/node_api_types.h + ${INCLUDE_DIR}/node_api.h +) + target_sources(${PROJECT_NAME} PUBLIC ${GENERATED_SOURCE_DIR}/weak_node_api.cpp - PUBLIC FILE_SET HEADERS - BASE_DIRS ${GENERATED_SOURCE_DIR} ${INCLUDE_DIR} FILES - ${GENERATED_SOURCE_DIR}/weak_node_api.hpp - ${GENERATED_SOURCE_DIR}/NodeApiHost.hpp - ${INCLUDE_DIR}/js_native_api_types.h - ${INCLUDE_DIR}/js_native_api.h - ${INCLUDE_DIR}/node_api_types.h - ${INCLUDE_DIR}/node_api.h ) -get_target_property(PUBLIC_HEADER_FILES ${PROJECT_NAME} HEADER_SET) +# Expose the public headers to consumers within the build tree (e.g. the tests) +# regardless of how they are packaged below. +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ +) # Stripping the prefix from the library name # to make sure the name of the XCFramework will match the name of the library if(APPLE) + # Frameworks ship their public headers via the PUBLIC_HEADER property. set_target_properties(${PROJECT_NAME} PROPERTIES FRAMEWORK TRUE MACOSX_FRAMEWORK_IDENTIFIER com.callstack.${PROJECT_NAME} @@ -37,6 +45,13 @@ if(APPLE) XCODE_ATTRIBUTE_SKIP_INSTALL NO PUBLIC_HEADER "${PUBLIC_HEADER_FILES}" ) +else() + # Elsewhere, ship the public headers via a HEADERS file set for install packaging. + target_sources(${PROJECT_NAME} + PUBLIC FILE_SET HEADERS + BASE_DIRS ${GENERATED_SOURCE_DIR} ${INCLUDE_DIR} FILES + ${PUBLIC_HEADER_FILES} + ) endif() # C++20 is needed to use designated initializers From 6c66d77190961da61550e26be19dbe06f27989df Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Jul 2026 11:02:16 +0000 Subject: [PATCH 2/2] ci: trigger CI with Apple/macOS/Ferric/weak-node-api labels Empty commit to re-run the label-gated macOS jobs now that the labels are applied, so the reverted CMake pin is validated on the runner's default CMake. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Aq4PqMYq8cQTP9Lf43JiwH