-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Qt 5: don't create Designer module when cross-building + v2 linter changes #12477
Qt 5: don't create Designer module when cross-building + v2 linter changes #12477
Conversation
Designer isn't built by Qt in such case
This comment has been minimized.
This comment has been minimized.
I detected other pull requests that are modifying qt/5.x.x recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
d5a1e81
to
9a046d1
Compare
This comment has been minimized.
This comment has been minimized.
@@ -1164,7 +1167,8 @@ def _create_plugin(pluginname, libname, plugintype, requires): | |||
self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only | |||
self.cpp_info.components["qtUiPlugin"].libdirs = [] | |||
_create_module("UiTools", ["UiPlugin", "Gui", "Widgets"]) | |||
_create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) | |||
if not cross_building(self): | |||
_create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) |
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.
/cc @ericLemanissier
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.
@kambala-decapitator are you sure that the triggering factor is the cross compilation ? I looked at the .pro files in https://github.com/qt/qttools/tree/v5.15.5-lts-lgpl/src, but I could not find the link between cross compilation and the Designer module
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.
@ericLemanissier I made native and cross builds. In native all is good, the cross one complains with the error given in PR description.
Just made a clean test by making cross-build of Qt 5.15.5 and then trying to consume it in a test project.
conan install qt/5.15.5@ \
--build=missing \
--profile:build=default \
--profile:host=macos-arm \
-o "qt/*:config=-no-gif -no-ico -no-feature-imageformat_bmp -no-feature-imageformat_jpeg -no-feature-imageformat_ppm -no-feature-imageformat_xbm" \
-o "qt/*:openssl=False" \
-o "qt/*:qttools=True" \
-o "qt/*:with_freetype=False" \
-o "qt/*:with_libjpeg=False" \
-o "qt/*:with_libpng=False"
-o "qt/*:with_md4c=False" \
-o "qt/*:with_mysql=False" \
-o "qt/*:with_odbc=False" \
-o "qt/*:with_openal=False" \
-o "qt/*:with_pq=False"
(this step could've been omitted actually)
Test project:
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
class QtTestConan(ConanFile):
name = "qt-test"
version = "1.0"
settings = "os", "compiler", "build_type", "arch"
exports_sources = "CMakeLists.txt", "src/*"
generators = "CMakeDeps", "CMakeToolchain"
requires = [
"qt/5.15.5",
]
default_options = {
"qt/*:config": "-no-gif -no-ico -no-feature-imageformat_bmp -no-feature-imageformat_jpeg -no-feature-imageformat_ppm -no-feature-imageformat_xbm",
"qt/*:openssl": False,
"qt/*:qttools": True,
"qt/*:with_freetype": False,
"qt/*:with_libjpeg": False,
"qt/*:with_libpng": False,
"qt/*:with_md4c": False,
"qt/*:with_mysql": False,
"qt/*:with_odbc": False,
"qt/*:with_openal": False,
"qt/*:with_pq": False,
}
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
cmake_minimum_required(VERSION 3.15)
project(qt-test CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
add_executable(qt-test src/main.cpp)
target_link_libraries(qt-test PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
#include <QApplication>
#include <QLabel>
int main(int argc, char* argv[]) {
QApplication app{argc, argv};
QLabel l{"hello world"};
l.show();
return app.exec();
}
Terminal commands used:
> mkdir build ; cd build
> conan install .. \
--build=never \
--profile:build=default \
--profile:host=macos-arm
Configuration (profile_host):
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13
os=Macos
os.version=11.0
[options]
[build_requires]
[env]
Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=13
os=Macos
os_build=Macos
[options]
[build_requires]
[env]
conanfile.py (qt-test/1.0): Installing package
Requirements
bzip2/1.0.8 from 'conancenter' - Cache
double-conversion/3.2.0 from 'conancenter' - Cache
opengl/system from 'conancenter' - Cache
pcre2/10.40 from 'conancenter' - Cache
qt/5.15.5 from 'conancenter' - Cache
sqlite3/3.39.2 from 'conancenter' - Cache
zlib/1.2.12 from 'conancenter' - Cache
zstd/1.5.2 from 'conancenter' - Cache
Packages
bzip2/1.0.8:ae23570c81876eb0315a73e777a89b575afbadfc - Cache
double-conversion/3.2.0:72de37736da93c527eaef675f8c4b4d47fc74be3 - Cache
opengl/system:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
pcre2/10.40:53e84465d2ea14a22439afdf0afe768c2aae9efa - Cache
qt/5.15.5:c59148b42e5e6abcc2dfdbbbe533d371da070b20 - Cache
sqlite3/3.39.2:4edde61ab1eef56d31212aca5aded2f217305da8 - Cache
zlib/1.2.12:d6df4e3f595d3dd83b3bd6e54fc150aae4f58e6d - Cache
zstd/1.5.2:01b83ab98222ab7378364e52c9d6ad2ec462e4fc - Cache
Cross-build from 'Macos:x86_64' to 'Macos:armv8'
Installing (downloading, building) binaries...
bzip2/1.0.8: Already installed!
bzip2/1.0.8: Appending PATH environment variable: /Users/kambala/.conan/data/bzip2/1.0.8/_/_/package/ae23570c81876eb0315a73e777a89b575afbadfc/bin
double-conversion/3.2.0: Already installed!
opengl/system: Already installed!
sqlite3/3.39.2: Already installed!
sqlite3/3.39.2: Appending PATH env var with : /Users/kambala/.conan/data/sqlite3/3.39.2/_/_/package/4edde61ab1eef56d31212aca5aded2f217305da8/bin
zlib/1.2.12: Already installed!
zstd/1.5.2: Already installed!
pcre2/10.40: Already installed!
pcre2/10.40: Appending PATH environment variable: /Users/kambala/.conan/data/pcre2/10.40/_/_/package/53e84465d2ea14a22439afdf0afe768c2aae9efa/bin
qt/5.15.5: Already installed!
conanfile.py (qt-test/1.0): Generator 'CMakeDeps' calling 'generate()'
conanfile.py (qt-test/1.0): Generator txt created conanbuildinfo.txt
conanfile.py (qt-test/1.0): Generator 'CMakeToolchain' calling 'generate()'
conanfile.py (qt-test/1.0): Aggregating env generators
conanfile.py (qt-test/1.0): Generated conaninfo.txt
conanfile.py (qt-test/1.0): Generated graphinfo
> conan build ..
Using lockfile: '/Users/kambala/dev/conan/qt-test/build/conan.lock'
Using cached profile from lockfile
conanfile.py (qt-test/1.0): Calling build()
conanfile.py (qt-test/1.0): CMake command: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/kambala/dev/conan/qt-test/build/generators/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/kambala/dev/conan/qt-test/."
-- Using Conan toolchain: /Users/kambala/dev/conan/qt-test/build/generators/conan_toolchain.cmake
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Component target declared 'Qt5::Core'
-- Conan: Component target declared 'Qt5::Gui'
-- Conan: Component target declared 'Qt5::EventDispatcherSupport'
-- Conan: Component target declared 'Qt5::FontDatabaseSupport'
-- Conan: Component target declared 'Qt5::ThemeSupport'
-- Conan: Component target declared 'Qt5::AccessibilitySupport'
-- Conan: Component target declared 'Qt5::ClipboardSupport'
-- Conan: Component target declared 'Qt5::GraphicsSupport'
-- Conan: Component target declared 'qt::QCocoaIntegrationPlugin'
-- Conan: Component target declared 'Qt5::QSQLiteDriverPlugin'
-- Conan: Component target declared 'Qt5::Network'
-- Conan: Component target declared 'Qt5::Sql'
-- Conan: Component target declared 'Qt5::Test'
-- Conan: Component target declared 'Qt5::Widgets'
-- Conan: Component target declared 'Qt5::PrintSupport'
-- Conan: Component target declared 'Qt5::OpenGL'
-- Conan: Component target declared 'Qt5::OpenGLExtensions'
-- Conan: Component target declared 'Qt5::Concurrent'
-- Conan: Component target declared 'Qt5::Xml'
-- Conan: Component target declared 'Qt5::LinguistTools'
-- Conan: Component target declared 'Qt5::UiPlugin'
-- Conan: Component target declared 'Qt5::UiTools'
-- Conan: Component target declared 'Qt5::Designer'
-- Conan: Component target declared 'Qt5::Help'
-- Conan: Component target declared 'Qt5::QCocoaIntegrationPlugin'
-- Conan: Component target declared 'Qt5::QMacStylePlugin'
-- Conan: Target declared 'qt::qt'
CMake Error at build/generators/cmakedeps_macros.cmake:39 (message):
Library 'Qt5Designer' not found in package. If 'Qt5Designer' is a system
library, declare it with 'cpp_info.system_libs' property
Call Stack (most recent call first):
build/generators/Qt5-Target-release.cmake:34 (conan_package_library_targets)
build/generators/Qt5Targets.cmake:26 (include)
build/generators/Qt5Config.cmake:10 (include)
CMakeLists.txt:12 (find_package)
-- Configuring incomplete, errors occurred!
See also "/Users/kambala/dev/conan/qt-test/build/Release/CMakeFiles/CMakeOutput.log".
See also "/Users/kambala/dev/conan/qt-test/build/Release/CMakeFiles/CMakeError.log".
ERROR: conanfile.py (qt-test/1.0): Error in build() method, line 35
cmake.configure()
ConanException: Error 1 while executing cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/Users/kambala/dev/conan/qt-test/build/generators/conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/Users/kambala/dev/conan/qt-test/."
As you can see, the error is exactly the same. If I apply my change, the error is gone.
just in case also tested shared Qt build, but the result is exactly the same.
Qt install log: qt-st.txt
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.
ok, the fix is good. It is actually this line which disable qtdesigner lib build when cross compiling see also https://www.enricozini.org/blog/2020/qt5/cross-building-qt5-designer-component/
@kambala-decapitator you are now a registered contributor. Please just close the PR, wait 10 seconds, and re-open it, in order to trigger the CI |
@ericLemanissier is there any way to see what failed during the build? I get 403. |
I don't have more information than you on this :/ You could try to close/reopen once again |
This comment has been minimized.
This comment has been minimized.
We have had an error this weekend that affected all the CI. Now it is working again. |
9a046d1
to
e579c5f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: ericLemanissier <ericLemanissier@users.noreply.github.com>
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.
Thank you !
All green in build 9 (
|
Hooks produced the following warnings for commit 33a3577qt/5.15.3
qt/5.15.2
qt/5.15.4
qt/5.15.5
|
…ng + v2 linter changes * don't create Designer module when cross-building Designer isn't built by Qt in such case * fix v2 linter issues * tools.remove_files_by_mask was recursive by default, but rm is not Co-authored-by: ericLemanissier <ericLemanissier@users.noreply.github.com> Co-authored-by: ericLemanissier <ericLemanissier@users.noreply.github.com>
Designer isn't built by Qt in such case, but Conan creates a module for it and then cmake configuration fails with:
Specify library name and version: Qt/5.15.5
Also performed v2 migration.
I have cross-built shared version of Qt 5.15.5 for ARM Mac (armv8) successfully, used the following options:
(also disabled some image formats, but that doesn't matter). The following build binaries were produced:
As you can see, Designer is not among them.
Then, when configuring CMake project, the error given above is thrown.
Qt5-release-armv8-data.cmake
has lineand
Qt5-Target-release.cmake
has the following block:My change prevents this.