-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qt5: fix build with apple-clang 15 + add package_type + bump deps + use version range for zlib #20093
qt5: fix build with apple-clang 15 + add package_type + bump deps + use version range for zlib #20093
Changes from 8 commits
42130b2
86c4c8e
f9c91fa
36bfb78
69ec16b
37e602f
25756b3
27b45dc
9938beb
0ca5889
4576ae5
9d78ba6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,29 +55,39 @@ | |
- "https://ftp.fau.de/qtproject/archive/qt/5.15/5.15.7/single/qt-everywhere-opensource-src-5.15.7.tar.xz" | ||
sha256: "8a71986676a3f37a198a9113acedbfd5bc5606a459b6b85816d951458adbe9a0" | ||
patches: | ||
"5.15.10": | ||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/aa2a39dea5.diff" | ||
Check warning on line 60 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtwebengine" | ||
"patch_file": "patches/c72097e.diff" | ||
Check warning on line 62 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qttools" | ||
"patch_file": "patches/fix-macdeployqt.diff" | ||
Check warning on line 64 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtwebengine/src/3rdparty/chromium/v8" | ||
"patch_file": "patches/chromium-v8-missing-constexpr.patch" | ||
Check warning on line 66 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtwebengine/src/3rdparty" | ||
"patch_file": "patches/chromium-skia-missing-iterator-include.patch" | ||
Check warning on line 68 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtwebengine/src/3rdparty/chromium/third_party/skia" | ||
"patch_file": "patches/skia-cd397f3.diff" | ||
Check warning on line 70 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtwebengine/src/3rdparty" | ||
"patch_file": "patches/0001-Find-fontconfig-using-pkg-config.patch" | ||
Check warning on line 72 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/337f28c9ab-5.15.8.patch" | ||
Check warning on line 74 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/android-backtrace.diff" | ||
Check warning on line 76 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/android-openssl.diff" | ||
Check warning on line 78 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml schema warning
|
||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/android-new-ndk.diff" | ||
- patch_file: "patches/fix-qmake-default-libdirs-apple-clang-15.patch" | ||
base_path: "qt5/qtbase" | ||
Check notice on line 82 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
patch_description: "Fix qmake build with apple-clang>=15" | ||
patch_type: "portability" | ||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" | ||
- patch_file: "patches/fix-macos-cpp-lib-memory-resource.patch" | ||
base_path: "qt5/qtbase" | ||
Check notice on line 87 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" | ||
patch_type: "portability" | ||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" | ||
"5.15.9": | ||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/aa2a39dea5.diff" | ||
|
@@ -101,6 +111,16 @@ | |
"patch_file": "patches/android-openssl.diff" | ||
- "base_path": "qt5/qtbase" | ||
"patch_file": "patches/android-new-ndk.diff" | ||
- patch_file: "patches/fix-qmake-default-libdirs-apple-clang-15.patch" | ||
base_path: "qt5/qtbase" | ||
patch_description: "Fix build with apple-clang 15" | ||
Check notice on line 116 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
patch_type: "portability" | ||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" | ||
- patch_file: "patches/fix-macos-cpp-lib-memory-resource.patch" | ||
base_path: "qt5/qtbase" | ||
patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" | ||
Check notice on line 121 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
patch_type: "portability" | ||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" | ||
"5.15.8": | ||
- patch_file: "patches/aa2a39dea5.diff" | ||
base_path: "qt5/qtbase" | ||
|
@@ -124,6 +144,16 @@ | |
base_path: "qt5/qtbase" | ||
- patch_file: "patches/android-new-ndk.diff" | ||
base_path: "qt5/qtbase" | ||
- patch_file: "patches/fix-qmake-default-libdirs-apple-clang-15.patch" | ||
base_path: "qt5/qtbase" | ||
patch_description: "Fix build with apple-clang 15" | ||
patch_type: "portability" | ||
Check notice on line 150 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" | ||
- patch_file: "patches/fix-macos-cpp-lib-memory-resource.patch" | ||
base_path: "qt5/qtbase" | ||
patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" | ||
patch_type: "portability" | ||
Check notice on line 155 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" | ||
"5.15.7": | ||
- patch_file: "patches/337f28c9ab.patch" | ||
base_path: "qt5/qtbase" | ||
|
@@ -155,3 +185,13 @@ | |
base_path: "qt5/qtbase" | ||
- patch_file: "patches/android-new-ndk.diff" | ||
base_path: "qt5/qtbase" | ||
- patch_file: "patches/fix-qmake-default-libdirs-apple-clang-15.patch" | ||
base_path: "qt5/qtbase" | ||
patch_description: "Fix build with apple-clang 15" | ||
patch_type: "portability" | ||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/503916" | ||
Check notice on line 192 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
||
- patch_file: "patches/fix-macos-cpp-lib-memory-resource.patch" | ||
base_path: "qt5/qtbase" | ||
patch_description: "Fix usage of memory_resource with apple-clang>=15 and deployment target of macOS < 14" | ||
patch_type: "portability" | ||
patch_source: "https://codereview.qt-project.org/c/qt/qtbase/+/482392" | ||
Check notice on line 197 in recipes/qt/5.x.x/conandata.yml GitHub Actions / Lint changed files (YAML files)conandata.yml v2 migration suggestion
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- a/src/corelib/global/qcompilerdetection.h | ||
+++ b/src/corelib/global/qcompilerdetection.h | ||
@@ -1050,16 +1050,22 @@ | ||
# endif // !_HAS_CONSTEXPR | ||
# endif // !__GLIBCXX__ && !_LIBCPP_VERSION | ||
# endif // Q_OS_QNX | ||
-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ | ||
- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) | ||
+# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) | ||
+# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) | ||
// Apple has not updated libstdc++ since 2007, which means it does not have | ||
// <initializer_list> or std::move. Let's disable these features | ||
-# undef Q_COMPILER_INITIALIZER_LISTS | ||
-# undef Q_COMPILER_RVALUE_REFS | ||
-# undef Q_COMPILER_REF_QUALIFIERS | ||
+# undef Q_COMPILER_INITIALIZER_LISTS | ||
+# undef Q_COMPILER_RVALUE_REFS | ||
+# undef Q_COMPILER_REF_QUALIFIERS | ||
// Also disable <atomic>, since it's clearly not there | ||
-# undef Q_COMPILER_ATOMICS | ||
-# endif | ||
+# undef Q_COMPILER_ATOMICS | ||
+# endif | ||
+# if defined(__cpp_lib_memory_resource) \ | ||
+ && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \ | ||
+ || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000)) | ||
+# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17 | ||
+# endif | ||
+# endif // (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) | ||
# if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 | ||
// ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode | ||
// (probably because libc++'s <atomic> on OS X failed to compile), but they're missing some | ||
--- a/src/corelib/tools/qduplicatetracker_p.h | ||
+++ b/src/corelib/tools/qduplicatetracker_p.h | ||
@@ -52,7 +52,7 @@ | ||
|
||
#include <qglobal.h> | ||
|
||
-#if QT_HAS_INCLUDE(<memory_resource>) && __cplusplus > 201402L | ||
+#if defined(__cpp_lib_memory_resource) && __cplusplus > 201402L | ||
# include <unordered_set> | ||
# include <memory_resource> | ||
#else |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- a/mkspecs/features/toolchain.prf | ||
+++ b/mkspecs/features/toolchain.prf | ||
@@ -288,9 +288,12 @@ isEmpty($${target_prefix}.INCDIRS) { | ||
} | ||
} | ||
} | ||
- isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \ | ||
+ isEmpty(QMAKE_DEFAULT_INCDIRS): \ | ||
!integrity: \ | ||
- error("failed to parse default search paths from compiler output") | ||
+ error("failed to parse default include paths from compiler output") | ||
+ isEmpty(QMAKE_DEFAULT_LIBDIRS): \ | ||
+ !integrity:!darwin: \ | ||
+ error("failed to parse default library paths from compiler output") | ||
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS) | ||
} else: ghs { | ||
cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp | ||
@@ -412,7 +415,7 @@ isEmpty($${target_prefix}.INCDIRS) { | ||
QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP) | ||
} | ||
|
||
- unix:if(!cross_compile|host_build) { | ||
+ unix:!darwin:if(!cross_compile|host_build) { | ||
isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include | ||
isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did the inspiration for this come from? Any extra insight would be appreciated :) but looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have this error locally without this workaround: #20093 (comment). Injection of VirtualRunEnv in build scope doesn't work on macOS due to SIP (at some point SIP resets DYLD_LIBRARY_PATH, I don't kno exactly when it happens during build, but it's a fact). Previous
BASH_ENV
workaround doesn't work either depending on terminal (zsh doesn't care for example). So if correct zlib version (matching the one installed by conan) is not installed on system, it fails.The only workaround I've found is to add path to shared libs in LC_RPATH of runtimes built during qt build, SIP can't do anything against that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's the same hack than the one in AutotoolsToolchain: https://github.com/conan-io/conan/blob/5f0dc4da2202069d20a59ccbbc17b179aaffed33/conan/tools/gnu/autotoolsdeps.py#L58-L60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might this cause rsulting binaries inside the package to have an absolute rpath to folders only present in the build machine? @SpaceIm