pacakge/qt5/qt5base: fix build with ccache
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Building with ccache failed with:
Running configuration tests...
Failed to process makespec for platform 'devices/linux-buildroot-g++'
Project ERROR: Compiler <path_to_output_dir>/host/usr/bin/ccache <path_to_output_dir>/host/usr/bin/<cross_compile>-g++ not found. Check the value of CROSS_COMPILE -device-option Could not read qmake configuration file <path_to_output_dir>/build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf.
Error processing project file: /dev/null
This was caused by Buildroot setting this in qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf:
QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++But qt5base-5.5.0/mkspecs/features/device_config.prf expects QMAKE_CXX to be a valid (absolute or QMAKE_PATH_ENV-relative) path to an existing file, which is not possible if using ccache as above.
Add a patch removing these tests since the toolchain is already tested by Buildroot, which allows to keep using ccache.
--- .../qt5/qt5base/0009-fix-build-with-ccache.patch | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 package/qt5/qt5base/0009-fix-build-with-ccache.patch
package/qt5/qt5base/0009-fix-build-with-ccache.patch new file +60 -0
@@ -0,0 +1,60 @@ +Fix build with ccache + +Building with Buildroot and ccache failed with: + + Running configuration tests... + Failed to process makespec for platform 'devices/linux-buildroot-g++' + Project ERROR: Compiler <path_to_output_dir>/host/usr/bin/ccache <path_to_output_dir>/host/usr/bin/<cross_compile>-g++ not found. Check the value of CROSS_COMPILE -device-option + Could not read qmake configuration file <path_to_output_dir>/build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf. + Error processing project file: /dev/null + +This was caused by Buildroot setting this in +qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf: + + QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++ + +But qt5base-5.5.0/mkspecs/features/device_config.prf expects QMAKE_CXX +to be a valid (absolute or QMAKE_PATH_ENV-relative) path to an existing +file, which is not possible if using ccache as above. + +Remove these tests since the toolchain is already tested by Buildroot, +which allows to keep using ccache. + +Signed-off-by: Beno?t Th?baudeau <[email protected]> +--- + mkspecs/features/device_config.prf | 23 ----------------------- + 1 file changed, 23 deletions(-) + +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf +index cd3a0cf..ef16540 100644 +--- a/mkspecs/features/device_config.prf ++++ b/mkspecs/features/device_config.prf +@@ -14,28 +14,5 @@ host_build { + + # Provide a function to be used by mkspecs + defineTest(deviceSanityCheckCompiler) { +- equals(QMAKE_HOST.os, Windows): \ +- sfx = .exe +- else: \ +- sfx = +- +- # Check if the binary exists with an absolute path. Do this check +- # before the CROSS_COMPILE empty check below to allow the mkspec +- # to derive the compiler path from other device options. +- exists($$QMAKE_CXX$$sfx):return() +- +- # Check for possible reasons of failure +- # check if CROSS_COMPILE device-option is set +- isEmpty(CROSS_COMPILE):error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>") +- +- # Check if QMAKE_CXX points to an executable. +- ensurePathEnv() +- for (dir, QMAKE_PATH_ENV) { +- exists($$dir/$${QMAKE_CXX}$$sfx): \ +- return() +- } +- +- # QMAKE_CXX does not point to a compiler. +- error("Compiler $$QMAKE_CXX not found. Check the value of CROSS_COMPILE -device-option") + } +
Signature · 1 line
2.1.4
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Beno?t,
Quoted 13 lines · Beno?t Th?baudeau
Building with ccache failed with:
Running configuration tests...
Failed to process makespec for platform 'devices/linux-buildroot-g++'
Project ERROR: Compiler <path_to_output_dir>/host/usr/bin/ccache <path_to_output_dir>/host/usr/bin/<cross_compile>-g++ not found. Check the value ofCROSS_COMPILE-device-option Could not read qmake configuration file <path_to_output_dir>/build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf.
Error processing project file:/dev/nullThis was caused by Buildroot setting this in
qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf:QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++
Quoted 8 lines
But qt5base-5.5.0/mkspecs/features/device_config.prf expects
QMAKE_CXXto be a valid (absolute or QMAKE_PATH_ENV-relative) path to an existing file, which is not possible if using ccache as above.Add a patch removing these tests since the toolchain is already tested by Buildroot, which allows to keep using ccache.
Signed-off-by Beno?t Th?baudeau <[email protected]>
Thanks for the patch. I see the problem, but as usual, having a solution that can be submitted upstream is better. See my suggestion below.
Quoted 56 lines
--- .../qt5/qt5base/0009-fix-build-with-ccache.patch | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 package/qt5/qt5base/0009-fix-build-with-ccache.patchpackage/qt5/qt5base/0009-fix-build-with-ccache.patch new file +45
-0@@ -0,0 +1,60 @@ +Fix build with ccache + +Building with Buildroot and ccache failed with: + + Running configuration tests... + Failed to process makespec for platform 'devices/linux-buildroot-g++' + Project ERROR: Compiler <path_to_output_dir>/host/usr/bin/ccache <path_to_output_dir>/host/usr/bin/<cross_compile>-g++ not found. Check the value of CROSS_COMPILE -device-option + Could not read qmake configuration file <path_to_output_dir>/build/qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf. + Error processing project file: /dev/null + +This was caused by Buildroot setting this in +qt5base-5.5.0/mkspecs/devices/linux-buildroot-g++/qmake.conf: + + QMAKE_CXX = $${BR_CCACHE} $${CROSS_COMPILE}g++ + +But qt5base-5.5.0/mkspecs/features/device_config.prf expects QMAKE_CXX +to be a valid (absolute or QMAKE_PATH_ENV-relative) path to an existing +file, which is not possible if using ccache as above. + +Remove these tests since the toolchain is already tested by Buildroot, +which allows to keep using ccache. + +Signed-off-by: Beno?t Th?baudeau <[email protected]> +--- + mkspecs/features/device_config.prf | 23 ----------------------- + 1 file changed, 23 deletions(-) + +diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf +index cd3a0cf..ef16540 100644 +--- a/mkspecs/features/device_config.prf ++++ b/mkspecs/features/device_config.prf +@@ -14,28 +14,5 @@ host_build { + + # Provide a function to be used by mkspecs + defineTest(deviceSanityCheckCompiler) { +- equals(QMAKE_HOST.os, Windows): \ +- sfx = .exe +- else: \ +- sfx = +- +- # Check if the binary exists with an absolute path. Do this check +- # before the CROSS_COMPILE empty check below to allow the mkspec +- # to derive the compiler path from other device options. +- exists($$QMAKE_CXX$$sfx):return() +-
package/qt5/qt5base/0009-fix-build-with-ccache.patch line 55
Quoted 10 lines
package/qt5/qt5base/0009-fix-build-with-ccache.patch new file +10
-0+- # Check for possible reasons of failure +- # check if CROSS_COMPILE device-option is set +- isEmpty(CROSS_COMPILE):error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>") +- +- # Check if QMAKE_CXX points to an executable. +- ensurePathEnv() +- for (dir, QMAKE_PATH_ENV) { +- exists($$dir/$${QMAKE_CXX}$$sfx): \ +- return() +- }
Instead of removing this entire piece of code, can you try to replace just this last part by something like:
system($${QMAKE_CXX}$$sfx --version): return()Instead of trying to look for a file, it will actually try to run the compiler.
Also, can you report the bug and submit the patch upstream to Qt? See
https://bugreports.qt.io/secure/Dashboard.jspa.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Hi Thomas,
Quoted 11 lines · Thomas Petazzoni
Quoted 6 lines · Beno?t Th?baudeau
+- # Check if QMAKE_CXX points to an executable. +- ensurePathEnv() +- for (dir, QMAKE_PATH_ENV) { +- exists($$dir/$${QMAKE_CXX}$$sfx): \ +- return() +- }Instead of removing this entire piece of code, can you try to replace just this last part by something like:
Quoted 7 lines
system($${QMAKE_CXX}$$sfx --version): return()Instead of trying to look for a file, it will actually try to run the compiler.
Also, can you report the bug and submit the patch upstream to Qt? See
https://bugreports.qt.io/secure/Dashboard.jspa.
I have opened a bug report upstream as you suggested:
https://bugreports.qt.io/browse/QTBUG-47951
As explained in this report, I think that your suggestion would work for Buildroot (not yet tested), but not for upstream Qt.
My point with this patch was that upstream could consider this Buildroot use case as illegal because the definition of QMAKE_CXX
(http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxx) only mentions a filename and a path as possibilities. In that case, the bug is in Buildroot, and since this sanity check of the compiler is not needed for Buildroot, we can just remove this test. If we don't want a local patch for this, maybe we could use a wrapper above ccache, or put ccache into QMAKE_CXX and the compiler into QMAKE_CXXFLAGS (not tested, and a bit ugly).
Wait and see what upstream says.
Best regards,
Beno?t
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Hi Thomas,
Quoted 37 lines · Beno?t Th?baudeau
Quoted 11 lines · Thomas Petazzoni
Quoted 6 lines · Beno?t Th?baudeau
+- # Check if QMAKE_CXX points to an executable. +- ensurePathEnv() +- for (dir, QMAKE_PATH_ENV) { +- exists($$dir/$${QMAKE_CXX}$$sfx): \ +- return() +- }Instead of removing this entire piece of code, can you try to replace just this last part by something like:
Quoted 7 lines
system($${QMAKE_CXX}$$sfx --version): return()Instead of trying to look for a file, it will actually try to run the compiler.
Also, can you report the bug and submit the patch upstream to Qt? See
https://bugreports.qt.io/secure/Dashboard.jspa.I have opened a bug report upstream as you suggested:
https://bugreports.qt.io/browse/QTBUG-47951As explained in this report, I think that your suggestion would work for Buildroot (not yet tested), but not for upstream Qt.
My point with this patch was that upstream could consider this Buildroot use case as illegal because the definition of
QMAKE_CXX
(http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxx) only mentions a filename and a path as possibilities. In that case, the bug is in Buildroot, and since this sanity check of the compiler is not needed for Buildroot, we can just remove this test. If we don't want a local patch for this, maybe we could use a wrapper above ccache, or put ccache intoQMAKE_CXXand the compiler intoQMAKE_CXXFLAGS(not tested, and a bit ugly).
Quoted 1 line
Wait and see what upstream says.
Upstream recommends this approach:
http://lists.qt-project.org/pipermail/qt-creator/2014-January/003148.html
What do you think?
Best regards,
Beno?t
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Hello,
Quoted 13 lines · Beno?t Th?baudeau
Quoted 13 lines
As explained in this report, I think that your suggestion would work for Buildroot (not yet tested), but not for upstream Qt.
My point with this patch was that upstream could consider this Buildroot use case as illegal because the definition of
QMAKE_CXX
(http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxx) only mentions a filename and a path as possibilities. In that case, the bug is in Buildroot, and since this sanity check of the compiler is not needed for Buildroot, we can just remove this test. If we don't want a local patch for this, maybe we could use a wrapper above ccache, or put ccache intoQMAKE_CXXand the compiler intoQMAKE_CXXFLAGS(not tested, and a bit ugly).
Quoted 6 lines
Quoted 1 line
Wait and see what upstream says.
Upstream recommends this approach:
http://lists.qt-project.org/pipermail/qt-creator/2014-January/003148.htmlWhat do you think?
Well, we already have a wrapper for the compiler in the case of the external toolchain. And we will probably also extend the wrapper in the future to the internal toolchain case, in order to support per-package staging directory. In this case, we could take advantage of this wrapper to include the ccache functionality, and avoid having CC and CXX values that have two words.
I really would like to have the wrapper suggested in this e-mail calling our wrapper, then calling the real compiler.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Hi,
Quoted 29 lines · Thomas Petazzoni
Quoted 13 lines · Beno?t Th?baudeau
Quoted 13 lines
As explained in this report, I think that your suggestion would work for Buildroot (not yet tested), but not for upstream Qt.
My point with this patch was that upstream could consider this Buildroot use case as illegal because the definition of
QMAKE_CXX
(http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxx) only mentions a filename and a path as possibilities. In that case, the bug is in Buildroot, and since this sanity check of the compiler is not needed for Buildroot, we can just remove this test. If we don't want a local patch for this, maybe we could use a wrapper above ccache, or put ccache intoQMAKE_CXXand the compiler intoQMAKE_CXXFLAGS(not tested, and a bit ugly).Quoted 6 lines
Quoted 1 line
Wait and see what upstream says.
Upstream recommends this approach:
http://lists.qt-project.org/pipermail/qt-creator/2014-January/003148.htmlWhat do you think?
Well, we already have a wrapper for the compiler in the case of the external toolchain. And we will probably also extend the wrapper in the future to the internal toolchain case, in order to support per-package staging directory. In this case, we could take advantage of this wrapper to include the ccache functionality, and avoid having CC and CXX values that have two words.
Quoted 2 lines
I really would like to have the wrapper suggested in this e-mail calling our wrapper, then calling the real compiler.
OK, but in the meantime, until we have a wrapper for the internal toolchain too, what do you want to do to fix the current build failure?
- Forbid the use of ccache with Qt 5?
- Use the current patch?
- Use the wrapper from the URL above? In that case, where would you put it in Buildroot (qt5base, new package, toolchain, support)?
Best regards,
Beno?t
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Beno?t,
Quoted 6 lines · Beno?t Th?baudeau
OK, but in the meantime, until we have a wrapper for the internal toolchain too, what do you want to do to fix the current build failure?
- Forbid the use of ccache with Qt 5?
- Use the current patch?
- Use the wrapper from the URL above? In that case, where would you put it in Buildroot (qt5base, new package, toolchain, support)?
For 2015.08, your patch is certainly the simplest solution.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Hi Thomas,
Quoted 10 lines · Thomas Petazzoni
Quoted 6 lines · Beno?t Th?baudeau
OK, but in the meantime, until we have a wrapper for the internal toolchain too, what do you want to do to fix the current build failure?
- Forbid the use of ccache with Qt 5?
- Use the current patch?
- Use the wrapper from the URL above? In that case, where would you put it in Buildroot (qt5base, new package, toolchain, support)?For 2015.08, your patch is certainly the simplest solution.
I've just posted a v2:
http://patchwork.ozlabs.org/patch/511841/
I will submit it upstream. According to the last comment in the upstream bug report, this patch could possibly be accepted upstream.
Best regards,
Beno?t
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
In reply to Benoît ThébaudeauHi all,
Quoted 3 lines · Beno?t Th?baudeau
OK, but in the meantime, until we have a wrapper for the internal toolchain too, what do you want to do to fix the current build failure?
- Forbid the use of ccache with Qt 5?
I would not recommend that. Qt5base is *huge* and recompiling it over and over again (as I do when I am developing with/against buildroot) is just too time consuming.
Quoted 1 line
- Use the current patch?
You can also look at one of my previous patches (see list archive). I simply don't have the time to respond to all correction requests unfortunately.
Regards,
Jaap Crezee
PATCH 1/1 pacakge/qt5/qt5base: fix build with ccache
Dear Jaap Crezee,
Quoted 7 lines · Jaap Crezee
Quoted 3 lines · Beno?t Th?baudeau
OK, but in the meantime, until we have a wrapper for the internal toolchain too, what do you want to do to fix the current build failure?
- Forbid the use of ccache with Qt 5?I would not recommend that. Qt5base is *huge* and recompiling it over and over again (as I do when I am developing with/against buildroot) is just too time consuming.
Agreed.
Quoted 4 lines
Quoted 1 line
- Use the current patch?
You can also look at one of my previous patches (see list archive). I simply don't have the time to respond to all correction requests unfortunately.
I have added your suggestion here:
https://bugreports.qt.io/browse/QTBUG-47951?focusedCommentId=291119&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-291119
Best regards,
Beno?t