-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: split depends Qt into native and target builds #22142
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
Conversation
Concept ACK. The same idea (a separated making of tools) is used for other dependencies. Need more investigation to find out if this approach is compatible with adding additional Qt modules. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
I think the reason of the failure on Centos 8 is wrong architecture the |
I'm able to
with the following patch: --- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -111,10 +111,6 @@ $(package)_config_opts += -no-feature-vulkan
$(package)_config_opts += -no-feature-wizard
$(package)_config_opts += -no-feature-xml
-$(package)_config_opts += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
-$(package)_config_opts += "QMAKE_CXXFLAGS = '$($(package)_cflags) $($(package)_cppflags)'"
-$(package)_config_opts += "QMAKE_LFLAGS = '$($(package)_ldflags)'"
-
$(package)_config_opts_darwin = -no-feature-corewlan
$(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION)
@@ -217,6 +213,9 @@ define $(package)_preprocess_cmds
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
+ echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
+ echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
+ echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \
sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf && \
sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf |
The branch with applied fixup is here. |
The --- a/depends/packages/native_qtbase.mk
+++ b/depends/packages/native_qtbase.mk
@@ -162,9 +162,7 @@ define $(package)_config_cmds
qtbase/bin/qmake -o qtbase/src/tools/qfloat16-tables/Makefile qtbase/src/tools/qfloat16-tables/qfloat16-tables.pro && \
qtbase/bin/qmake -o qtbase/src/tools/qvkgen/Makefile qtbase/src/tools/qvkgen/qvkgen.pro && \
qtbase/bin/qmake -o qtbase/qmake/Makefile qtbase/qmake/qmake-aux.pro && \
- qtbase/bin/qmake -o qttools/src/linguist/lrelease/Makefile qttools/src/linguist/lrelease/lrelease.pro && \
- qtbase/bin/qmake -o qttools/src/linguist/lupdate/Makefile qttools/src/linguist/lupdate/lupdate.pro && \
- qtbase/bin/qmake -o qttools/src/linguist/lconvert/Makefile qttools/src/linguist/lconvert/lconvert.pro
+ qtbase/bin/qmake -o qttools/src/linguist/Makefile qttools/src/linguist/linguist.pro
endef
define $(package)_build_cmds
@@ -174,9 +172,7 @@ define $(package)_build_cmds
$(MAKE) -C qtbase/src/tools/qvkgen && \
$(MAKE) -C qtbase/src/tools/rcc && \
$(MAKE) -C qtbase/src/tools/uic && \
- $(MAKE) -C qttools/src/linguist/lrelease && \
- $(MAKE) -C qttools/src/linguist/lupdate && \
- $(MAKE) -C qttools/src/linguist/lconvert
+ $(MAKE) -C qttools/src/linguist
endef
define $(package)_stage_cmds |
Thanks, I've addressed both of these points. Also addressed the comments you left inline and rebased for #22174. I think we can merge #22186 before this. I'm not really happy with how qt patches end up duplicated, but we should be able to fix that. |
It is true that avoiding intrusive fixes to the build system--i.e., patching Qt code base--makes it more maintainable and more comprehensible. That is why Concept ACKed this PR. But considering different approaches, I still prefer the #20641. It is better than this one for the following reasons:
|
Is this approach actually incompatible with doing that? |
If new modules depends on core and tools are built in the |
Closing this in favour of #20641 for now. |
This splits our Qt build in depends into two parts. The first builds
qmake
, qt tools (uic
,moc
,rcc
etc) as well as translation tools (lconvert
,lupdate
etc). The second builds the libs we want forbitcoin-qt
.Splitting the build in this way has a few advantages. For example, we can enable the xml module while building the tools, and ideally fix issues like #14648 or #18536 without needing changes like #21589 or #21420, or having to build it alongside our libs.
This has been tested a little bit. GUIX builds are working for macOS and Windows.
Some testing still needs to be done in regards to passing compiler flags, DEBUG=1 builds etc. No doubt some improvements can still be made to what is currently here.
Fixes #18536.