Skip to content

Commit 9ff2a11

Browse files
Bump macOS to version 26 (#373)
- Linked Case: NOJIRAID ### Description Was trying to build sketcher on macos (M4). Hit this error: ``` In file included from /Users/runner/work/sketcher/sketcher/build/external/qt-prefix/src/qt-build/qtbase/include/QtCore/qyieldcpu.h:1: /Users/runner/work/sketcher/sketcher/build/external/qt-prefix/src/qt/qtbase/src/corelib/thread/qyieldcpu.h:35:5: error: implicitly declaring library function '__yield' with type 'void ()' [-Werror,-Wimplicit-function-declaration] 35 | __yield(); // Generic | ^ /Users/runner/work/sketcher/sketcher/build/external/qt-prefix/src/qt/qtbase/src/corelib/thread/qyieldcpu.h:35:5: note: include the header <arm_acle.h> or explicitly provide a declaration for '__yield' 1 error generated. ninja: build stopped: subcommand failed. ``` also reproducible when I bumped to `macos-26` on CI--did this since the XCode version reflects what we use for 26.3. Let me know if you dont want to include the bump to 26 here and just have the patch only. Claude's explanation: ==== Apple clang 21+ has `__has_builtin(__yield)` as `true`, so Qt 6.x's qyieldcpu.h takes its generic `__yield()` branch — but `__yield()` is only declared in <arm_acle.h>, which that header never includes. Qt compiles with -Werror=implicit-function-declaration, so the implicit declaration becomes a hard error. ===== Not sure if this may be addressed/solved with a more recent Qt? ### Testing Done Tests on macos-26 pass.
1 parent f0fd288 commit 9ff2a11

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

.github/workflows/sketcher-builder.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737

3838
build-test:
3939
needs: pre-commit
40+
name: build-test (${{ matrix.build-name }}, ${{ matrix.runner }})
4041
runs-on: ${{ matrix.runner }}
4142
defaults:
4243
run:
@@ -47,6 +48,10 @@ jobs:
4748
include:
4849
- build-name: macos
4950
runner: macos-15
51+
os-label: macos-15
52+
- build-name: macos
53+
runner: macos-26
54+
os-label: macos-26
5055
- build-name: windows
5156
runner: windows-2022
5257
- build-name: ubuntu
@@ -270,7 +275,7 @@ jobs:
270275
if: always() && steps.sketcher-build.outcome == 'success'
271276
uses: actions/upload-artifact@v6
272277
with:
273-
name: sketcher-${{ inputs.ref || github.sha }}-${{ matrix.build-name }}
278+
name: sketcher-${{ inputs.ref || github.sha }}-${{ matrix.os-label || matrix.build-name }}
274279
path: |
275280
build/sketcher_app
276281
!build/sketcher_app/*.manifest

external/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ ExternalProject_Add(
295295
GIT_TAG v${QT_VERSION}
296296
GIT_SUBMODULES ${QT_GIT_SUBMODULES}
297297
GIT_SHALLOW TRUE
298+
PATCH_COMMAND ${CMAKE_COMMAND} -P
299+
${CMAKE_CURRENT_SOURCE_DIR}/qt_yield_acle_patch.cmake
298300
CMAKE_ARGS
299301
${COMMON_EXTERNAL_PROJECT_CMAKE_ARGS}
300302
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/qt-${QT_VERSION}

external/qt_yield_acle_patch.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Inject <arm_acle.h> into qtbase's qyieldcpu.h.
2+
#
3+
# Apple clang >= 21 reports __has_builtin(__yield) == true, but __yield() is
4+
# only declared in <arm_acle.h>. Without that include the generic branch of
5+
# qYieldCpu() implicitly-declares the function and the Qt build fails under
6+
# -Werror=implicit-function-declaration. Run as a PATCH_COMMAND from the Qt
7+
# source root; idempotent so re-running is harmless.
8+
9+
set(_file "qtbase/src/corelib/thread/qyieldcpu.h")
10+
11+
if(NOT EXISTS "${_file}")
12+
message(STATUS "qt_yield_acle_patch: ${_file} not found, skipping")
13+
return()
14+
endif()
15+
16+
file(READ "${_file}" _contents)
17+
18+
if(_contents MATCHES "arm_acle.h")
19+
message(STATUS "qt_yield_acle_patch: already applied")
20+
return()
21+
endif()
22+
23+
string(
24+
REPLACE
25+
"#include <QtCore/qtconfigmacros.h>"
26+
"#include <QtCore/qtconfigmacros.h>\n\n#if defined(__has_include)\n# if defined(__ARM_ACLE) && __has_include(<arm_acle.h>)\n# include <arm_acle.h>\n# endif\n#endif"
27+
_contents
28+
"${_contents}")
29+
30+
file(WRITE "${_file}" "${_contents}")
31+
message(STATUS "qt_yield_acle_patch: applied to ${_file}")

0 commit comments

Comments
 (0)