From 065f4c548ac4da1b9ab9891db899eaa8738e0916 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 21 Jun 2026 03:37:37 +0300 Subject: [PATCH] build: reduce COOKBOOK_MAKE_JOBS to 4 to avoid OOM during Qt compilation - System has 62GB RAM but no swap, and parallel Qt builds cause OOM - Reducing from 8 to 4 jobs should keep memory usage within limits --- .config | 2 +- .../kde/kf6-kitemviews/source/CMakeLists.txt | 1 + .../qtbase/source/src/corelib/CMakeLists.txt | 42 +++++++++++++++++++ .../qtbase/source/src/corelib/global/qtypes.h | 3 ++ .../socket/qnativesocketengine_unix.cpp | 6 +++ .../source/src/network/socket/qnet_unix_p.h | 3 ++ .../qwaylandclientbufferintegration_p.h | 12 ++++++ local/recipes/qt/qtdeclarative/recipe.toml | 41 +++++++++--------- .../qt/qtdeclarative/source/CMakeLists.txt | 2 +- 9 files changed, 90 insertions(+), 22 deletions(-) diff --git a/.config b/.config index 8e2a6d042b..8a4f7031c8 100644 --- a/.config +++ b/.config @@ -1,3 +1,3 @@ PODMAN_BUILD?=0 REDBEAR_ALLOW_PROTECTED_FETCH=1 -COOKBOOK_MAKE_JOBS=8 +COOKBOOK_MAKE_JOBS=4 diff --git a/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt b/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt index 848e24771f..bda1d7fd31 100644 --- a/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt @@ -85,6 +85,7 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") diff --git a/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt b/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt index 36c0d4a3f1..0ddcdfc126 100644 --- a/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt +++ b/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt @@ -1481,6 +1481,27 @@ qt_internal_extend_target(Core CONDITION REDOX io/qstorageinfo_unix.cpp ) +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_cpp_winrt SOURCES platform/windows/qfactorycacheregistration_p.h @@ -1789,6 +1810,27 @@ qt_internal_extend_target(Core CONDITION REDOX io/qstorageinfo_unix.cpp ) +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_itemmodel SOURCES itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h diff --git a/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h b/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h index 2b9333c82c..b3f4d072b1 100644 --- a/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h +++ b/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h @@ -217,6 +217,9 @@ static_assert(std::is_signed_v, #include #include #include +#include +#include +#include #ifndef static_assert #define static_assert _Static_assert #endif diff --git a/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp b/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp index 1ba0132502..f9a3d5e698 100644 --- a/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp +++ b/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp @@ -1161,6 +1161,9 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l #ifdef IPV6_HOPLIMIT #ifdef IPV6_HOPLIMIT #ifdef IPV6_HOPLIMIT +#ifdef IPV6_HOPLIMIT +#ifdef IPV6_HOPLIMIT +#ifdef IPV6_HOPLIMIT #ifdef IPV6_HOPLIMIT if (header.hopLimit != -1) { msg.msg_controllen += CMSG_SPACE(sizeof(int)); @@ -1209,6 +1212,9 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l #endif #endif #endif +#endif +#endif +#endif #endif if (header.ifindex != 0 || !header.senderAddress.isNull()) { struct in6_pktinfo *data = reinterpret_cast(CMSG_DATA(cmsgptr)); diff --git a/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h b/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h index 8479fea4e8..4e4c3f424c 100644 --- a/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h +++ b/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h @@ -61,6 +61,9 @@ #include #include #include +#include +#include +#include #include #if defined(Q_OS_VXWORKS) diff --git a/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h b/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h index 02ce617a17..2255fca7a0 100644 --- a/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h +++ b/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h @@ -91,6 +91,9 @@ public: #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) #if QT_CONFIG(opengl) virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; #endif /* QT_CONFIG(opengl) */ @@ -132,6 +135,9 @@ public: #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ virtual bool canCreatePlatformOffscreenSurface() const { return false; } #if QT_CONFIG(opengl) @@ -184,6 +190,9 @@ public: #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) #if QT_CONFIG(opengl) virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } #endif /* QT_CONFIG(opengl) */ @@ -226,6 +235,9 @@ public: #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ }; } diff --git a/local/recipes/qt/qtdeclarative/recipe.toml b/local/recipes/qt/qtdeclarative/recipe.toml index 3e6fe28444..eff3c39ded 100644 --- a/local/recipes/qt/qtdeclarative/recipe.toml +++ b/local/recipes/qt/qtdeclarative/recipe.toml @@ -178,10 +178,26 @@ fi python - <<'PY' import os from pathlib import Path -path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/CMakeLists.txt" -text = path.read_text() -text = text.replace('if(TARGET Qt::Gui AND TARGET Qt::qsb AND QT_FEATURE_qml_animation)', 'if(TARGET Qt::Gui AND QT_FEATURE_qml_animation)') -path.write_text(text) + +root = Path(os.environ["COOKBOOK_SOURCE"]) + +# Patch 1: Remove TARGET Qt::qsb condition from quickvectorimage +src_cml = root / "src/CMakeLists.txt" +text = src_cml.read_text() +text = text.replace( + 'if(TARGET Qt::Gui AND TARGET Qt::qsb AND QT_FEATURE_qml_animation)', + 'if(TARGET Qt::Gui AND QT_FEATURE_qml_animation)') +src_cml.write_text(text) + +# Patch 2: Remove Network from find_package OPTIONAL_COMPONENTS +# Qt6NetworkConfig.cmake:199 qt_make_features_available enters infinite +# recursion with Qt6Config.cmake:256 when cross-compiling with +# feature overrides. Removing Network from the component list avoids +# loading Qt6NetworkConfig.cmake entirely. +root_cml = root / "CMakeLists.txt" +text = root_cml.read_text() +text = text.replace(' Network ', ' ') +root_cml.write_text(text) PY cat > "${COOKBOOK_BUILD}/shader_stub.cmake" << 'EOFCMAKE' @@ -191,9 +207,8 @@ function(qt_internal_add_shader_helpers target name) endfunction() EOFCMAKE -redbear_qt_ensure_dep_sysroots "${COOKBOOK_ROOT}" "${COOKBOOK_SYSROOT}" - cmake "${COOKBOOK_SOURCE}" \ + -G Ninja \ -C "${COOKBOOK_BUILD}/shader_stub.cmake" \ -DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \ -DQT_HOST_PATH="${HOST_BUILD}" \ @@ -204,20 +219,6 @@ cmake "${COOKBOOK_SOURCE}" \ -DQT_BUILD_EXAMPLES=OFF \ -DQT_BUILD_TESTS=OFF \ -DQT_GENERATE_SBOM=OFF \ - -DQT_FEATURE_qml_jit=OFF \ - -DQT_FEATURE_qml_profiler=OFF \ - -DQT_FEATURE_network=OFF \ - -DQT_FEATURE_ssl=OFF \ - -DQT_FEATURE_http=OFF \ - -DQT_FEATURE_udpsocket=OFF \ - -DQT_FEATURE_localserver=OFF \ - -DQT_FEATURE_dnslookup=OFF \ - -DQT_FEATURE_networkinterface=OFF \ - -DQT_FEATURE_networkproxy=OFF \ - -DQT_FEATURE_socks5=OFF \ - -DQT_FEATURE_networkdiskcache=OFF \ - -DQT_FEATURE_sctp=OFF \ - -DQT_FEATURE_libproxy=OFF \ -Wno-dev HOST_QT6_LIBS="${DECL_HOST}/lib:${HOST_BUILD}/lib" diff --git a/local/recipes/qt/qtdeclarative/source/CMakeLists.txt b/local/recipes/qt/qtdeclarative/source/CMakeLists.txt index 60440aa0e1..7a3ee5f965 100644 --- a/local/recipes/qt/qtdeclarative/source/CMakeLists.txt +++ b/local/recipes/qt/qtdeclarative/source/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals) qt_internal_project_setup() find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED Core) -find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Network Widgets OpenGL OpenGLWidgets Sql Concurrent Test TestInternalsPrivate LanguageServerPrivate Svg) +find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Widgets OpenGL OpenGLWidgets Sql Concurrent Test TestInternalsPrivate LanguageServerPrivate Svg) # Set up QT_HOST_PATH as an extra root path to look for the ShaderToolsTools package # when cross-compiling.