Skip to contentSkip to conversation

making qt5 package machine specific

PATCH New Nicolas Dechesne 5 participants 13 messages Nov 21, 2013 – Dec 3, 2013

lore
Share & tools
lore
#0 lore raw

hi,

we are building a product/distro with qt5 with support for various SoC. the way qt5 recipes are designed, it kind of forces the resulting packages to be <machine> specific, not <arch> specific.

first each <machine> has a different provider for GL/GLES and it impacts the RDEPENDS, on top of that we have machine specific patches in Qt5 in each of our BSP layer, whether we like it or not, that's a reality that we cannot have the very same Qt5 config + source code for all platforms.

so we end up with many <qt pkgs>-<arch> which are <machine> specific, not <arch>, and it messes up badly with sstate for example, especially when cleaning up the sstate (e.g. using sstate-cache-management -d).

so i have a couple of questions:

- are we doing something really wrong here? or are we getting issues that
anyone would get when trying to have a OE based product with Qt5 and multiple machines from the same <arch>?

- assuming this is a typical use case... i wish there was an easy
mechanism to 'mark' all Qt5 packages as PACKAGE_ARCH = "${MACHINE_ARCH}", without having to .bbappend every single recipe. It is indeed quite common to have a .bbappend for qtbase, but not for the other packages...

thanks!

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicolas Dechesne schreef op 21-11-13 09:33:

Quoted 15 lines

hi,

we are building a product/distro with qt5 with support for various SoC. the way qt5 recipes are designed, it kind of forces the resulting packages to be <machine> specific, not <arch> specific.

first each <machine> has a different provider for GL/GLES and it impacts the RDEPENDS, on top of that we have machine specific patches in Qt5 in each of our BSP layer, whether we like it or not, that's a reality that we cannot have the very same Qt5 config + source code for all platforms.

so we end up with many <qt pkgs>-<arch> which are <machine> specific, not <arch>, and it messes up badly with sstate for example, especially when cleaning up the sstate (e.g. using sstate-cache-management -d).

Quoted 5 lines

so i have a couple of questions:

- are we doing something really wrong here? or are we getting issues that anyone would get when trying to have a OE based product with Qt5 and multiple machines from the same <arch>?

You are getting issues that anyone with machine specific libs (e.g. GLES, clutter, wayland) gets in a multimachine scenario :(

Quoted 5 lines

- assuming this is a typical use case... i wish there was an easy mechanism to 'mark' all Qt5 packages as PACKAGE_ARCH = "${MACHINE_ARCH}", without having to .bbappend every single recipe. It is indeed quite common to have a .bbappend for qtbase, but not for the other packages...

No idea on that, sorry.

regards,

Koen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org

iD4DBQFSjchFMkyGM64RGpERAkVvAJjvUEaYUnLHT9Y0akrxXC/fmj+NAJ4sFyr9 0JdnxMHb7/3P4JZoIEwmew==
=hr2K
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Nicolas Dechesne
Quoted 17 lines · Nicolas Dechesne

hi,

we are building a product/distro with qt5 with support for various SoC. the way qt5 recipes are designed, it kind of forces the resulting packages to be <machine> specific, not <arch> specific.

first each <machine> has a different provider for GL/GLES and it impacts the RDEPENDS, on top of that we have machine specific patches in Qt5 in each of our BSP layer, whether we like it or not, that's a reality that we cannot have the very same Qt5 config + source code for all platforms.

so we end up with many <qt pkgs>-<arch> which are <machine> specific, not <arch>, and it messes up badly with sstate for example, especially when cleaning up the sstate (e.g. using sstate-cache-management -d).

so i have a couple of questions:

Quoted 8 lines

- are we doing something really wrong here? or are we getting issues that
anyone would get when trying to have a OE based product with Qt5 and multiple machines from the same <arch>?

- assuming this is a typical use case... i wish there was an easy
mechanism to 'mark' all Qt5 packages as PACKAGE_ARCH = "${MACHINE_ARCH}", without having to .bbappend every single recipe. It is indeed quite common to have a .bbappend for qtbase, but not for the other packages...

There are 2 ways and I'm using both in different scenarios (different builds)

1) .inc file with
PACKAGE_ARCH_pn-qtbase = "${MACHINE_ARCH}" PACKAGE_ARCH_pn-qtdeclarative = "${MACHINE_ARCH}"
...
for whole qt* stack (use sstate-diff-machines.sh script to see that you get them all).

2) SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
# Depending on MACHINE_ARCH GL/GLES binaries (or mesa)

SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "\
    qtbase->other-gl-gles-provider \
    qtbase->mesa \

"

2) doesn't solve your MACHINE specific patches of course

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw
Quoted 10 lines · Martin Jansa

There are 2 ways and I'm using both in different scenarios (different builds)

1) .inc file with
PACKAGE_ARCH_pn-qtbase = "${MACHINE_ARCH}" PACKAGE_ARCH_pn-qtdeclarative = "${MACHINE_ARCH}"
...
for whole qt* stack (use sstate-diff-machines.sh script to see that you get them all).

Quoted 9 lines

2) SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
# Depending on MACHINE_ARCH GL/GLES binaries (or mesa)

SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "\
    qtbase->other-gl-gles-provider \
    qtbase->mesa \

"

2) doesn't solve your MACHINE specific patches of course

thanks. how about getting something like this merged? i believe our situation is going to be an issue for others as well, so perhaps it's nice to build the infrastructure to make it simpler for people to use

=========

From c562d011f196b1ee8ceced76833dc80e48dd599f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]>
Date: Thu, 21 Nov 2013 13:48:45 +0000
Subject: [PATCH] qmake5_base.bbclass: allow to set the package arch globally
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Packages built using a (machine) specific qmake, will also be machine specific.
Since it is not feasible to add PACKAGE_ARCH=... to each and every recipe that is built using qmake, we introduce a new variable, QMAKE_PACKAGE_ARCH, that can be set by the machine configuration as needed.

We have to be careful though to only change the architecture of the resulting packages if we're not compiling a 'native' package.

---
 classes/qmake5_base.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)
classes/qmake5_base.bbclass +12 -0
index 2db0fa3..e77dd73 100644
@@ -1,3 +1,15 @@
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch == tarch:
+        True
+    else:
+        tarch = d.getVar("QMAKE_PACKAGE_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
 # This is useful for target recipes to reference native mkspecs
 QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}"
 QMAKE_MKSPEC_PATH_TARGET = "${STAGING_LIBDIR}/${QT_DIR_NAME}"
Signature · 1 line
1.8.2
#4 lore raw
Quoted 19 lines · Nicolas Dechesne
Quoted 17 lines · Martin Jansa

There are 2 ways and I'm using both in different scenarios (different builds)

1) .inc file with
PACKAGE_ARCH_pn-qtbase = "${MACHINE_ARCH}" PACKAGE_ARCH_pn-qtdeclarative = "${MACHINE_ARCH}"
...
for whole qt* stack (use sstate-diff-machines.sh script to see that you get them all).

2) SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
# Depending on MACHINE_ARCH GL/GLES binaries (or mesa)

SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "\
    qtbase->other-gl-gles-provider \
    qtbase->mesa \

"

Quoted 6 lines
Quoted 2 lines

2) doesn't solve your MACHINE specific patches of course

thanks. how about getting something like this merged? i believe our situation is going to be an issue for others as well, so perhaps it's nice to build the infrastructure to make it simpler for people to use

Looks useful, would you mind sending it with send-email so that it correctly shows up in patchwork (now it breaks author and commit message).

I'll let other reviewers some time to comment, but can merge it later.

Quoted 52 lines

=========

From c562d011f196b1ee8ceced76833dc80e48dd599f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]>
Date: Thu, 21 Nov 2013 13:48:45 +0000
Subject: [PATCH] qmake5_base.bbclass: allow to set the package arch globally
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Packages built using a (machine) specific qmake, will also be machine specific.
Since it is not feasible to add PACKAGE_ARCH=... to each and every recipe that is built using qmake, we introduce a new variable, QMAKE_PACKAGE_ARCH, that can be set by the machine configuration as needed.

We have to be careful though to only change the architecture of the resulting packages if we're not compiling a 'native' package.

---
 classes/qmake5_base.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)
classes/qmake5_base.bbclass +12 -0
index 2db0fa3..e77dd73 100644
@@ -1,3 +1,15 @@
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch == tarch:
+        True
+    else:
+        tarch = d.getVar("QMAKE_PACKAGE_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
 # This is useful for target recipes to reference native mkspecs
 QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}"
 QMAKE_MKSPEC_PATH_TARGET = "${STAGING_LIBDIR}/${QT_DIR_NAME}"
Signature · 5 lines
1.8.2
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#5 lore raw
In reply to Nicolas Dechesne
Quoted 43 lines · Nicolas Dechesne
Quoted 10 lines · Martin Jansa

There are 2 ways and I'm using both in different scenarios (different builds)

1) .inc file with
PACKAGE_ARCH_pn-qtbase = "${MACHINE_ARCH}" PACKAGE_ARCH_pn-qtdeclarative = "${MACHINE_ARCH}"
...
for whole qt* stack (use sstate-diff-machines.sh script to see that you get them all).

Quoted 9 lines

2) SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS
# Depending on MACHINE_ARCH GL/GLES binaries (or mesa)

SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "\
    qtbase->other-gl-gles-provider \
    qtbase->mesa \

"

2) doesn't solve your MACHINE specific patches of course

thanks. how about getting something like this merged? i believe our situation is going to be an issue for others as well, so perhaps it's nice to build the infrastructure to make it simpler for people to use

=========

From c562d011f196b1ee8ceced76833dc80e48dd599f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <[email protected]>
Date: Thu, 21 Nov 2013 13:48:45 +0000
Subject: [PATCH] qmake5_base.bbclass: allow to set the package arch globally
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Packages built using a (machine) specific qmake, will also be machine specific.
Since it is not feasible to add PACKAGE_ARCH=... to each and every recipe that is built using qmake, we introduce a new variable, QMAKE_PACKAGE_ARCH, that can be set by the machine configuration as needed.

Quoted 2 lines

We have to be careful though to only change the architecture of the resulting packages if we're not compiling a 'native' package.

Ah one more comment.

qmake5_base.bbclass doesn't look like best place for it.

I guess you have only target qtbase being MACHINE_ARCH, right?

qmake5_base.bbclass can be inherited by many packages which are TUNE_PKGARCH and don't use (depend) on target qtbase at all, so QMAKE_PACKAGE_ARCH would be used in more recipes then where it's really needed.

Cheers,

Quoted 32 lines
---
 classes/qmake5_base.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)
classes/qmake5_base.bbclass +12 -0
index 2db0fa3..e77dd73 100644
@@ -1,3 +1,15 @@
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch == tarch:
+        True
+    else:
+        tarch = d.getVar("QMAKE_PACKAGE_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
 # This is useful for target recipes to reference native mkspecs
 QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}"
 QMAKE_MKSPEC_PATH_TARGET = "${STAGING_LIBDIR}/${QT_DIR_NAME}"
Signature · 5 lines
1.8.2
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#6 lore raw

Hi Martin,

Quoted 5 lines · Martin Jansa

Ah one more comment.

qmake5_base.bbclass doesn't look like best place for it.

I guess you have only target qtbase being MACHINE_ARCH, right?

Everything that was built using the previously configured qtbase, e.g. qtwebkit - see below.

Quoted 4 lines

qmake5_base.bbclass can be inherited by many packages which are TUNE_PKGARCH and don't use (depend) on target qtbase at all, so QMAKE_PACKAGE_ARCH would be used in more recipes then where it's really needed.

I don't know enough about qmake, but my thinking is that qmake will store the (qtbase) configure options somewhere (from the time when you configure qtbase for the target), i.e. qmake during the qtwebkit build has access to the configuration from the time qtbase was configured. Hence the idea is to make all (target) packages that use (inherit) qmake5 to use the same PACKAGE_ARCH override.

Does it work differently?

Cheers,
Andre'

#7 lore raw
Quoted 17 lines · André Draszik

Hi Martin,

Quoted 5 lines · Martin Jansa

Ah one more comment.

qmake5_base.bbclass doesn't look like best place for it.

I guess you have only target qtbase being MACHINE_ARCH, right?

Everything that was built using the previously configured qtbase, e.g. qtwebkit - see below.

Quoted 4 lines

qmake5_base.bbclass can be inherited by many packages which are TUNE_PKGARCH and don't use (depend) on target qtbase at all, so QMAKE_PACKAGE_ARCH would be used in more recipes then where it's really needed.

Quoted 6 lines

I don't know enough about qmake, but my thinking is that qmake will store the (qtbase) configure options somewhere (from the time when you configure qtbase for the target), i.e. qmake during the qtwebkit build has access to the configuration from the time qtbase was configured. Hence the idea is to make all (target) packages that use (inherit) qmake5 to use the same PACKAGE_ARCH override.

You can have recipes which use only qtbase-native and qmake only as build tool and don't use target qtbase at all.

Such recipes inherit qmake5_base to setup paths etc and shouldn't became MACHINE_ARCH just because target qtbase (which they don't use at all) is.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#8 lore raw

Thanks Martin!

Quoted 5 lines · Martin Jansa

You can have recipes which use only qtbase-native and qmake only as build tool and don't use target qtbase at all.

Such recipes inherit qmake5_base to setup paths etc and shouldn't became MACHINE_ARCH just because target qtbase (which they don't use at all) is.

OK.

Would it be better / ok to move my patch into qt5.inc then?

My only (maybe unjustified) concern with this is: What defines if some source code uses / can see configuration options from qtbase configure time when invoking qmake? Purely that projects own build system? I can't see anything in meta-qt5 that could affect this, unless I'm missing something.

In other words, could a recipe build sources that depend on the Qt configuration, without including qt5.inc?

Cheers,
Andre'

#9 lore raw
Quoted 11 lines · André Draszik

Thanks Martin!

Quoted 5 lines · Martin Jansa

You can have recipes which use only qtbase-native and qmake only as build tool and don't use target qtbase at all.

Such recipes inherit qmake5_base to setup paths etc and shouldn't became MACHINE_ARCH just because target qtbase (which they don't use at all) is.

OK.

Quoted 7 lines

Would it be better / ok to move my patch into qt5.inc then?

My only (maybe unjustified) concern with this is: What defines if some source code uses / can see configuration options from qtbase configure time when invoking qmake? Purely that projects own build system? I can't see anything in meta-qt5 that could affect this, unless I'm missing something.

You can add it to separate .bbclass and inherit it from qt5.inc

Quoted 2 lines

In other words, could a recipe build sources that depend on the Qt configuration, without including qt5.inc?

Yes any recipe which inherits qmake5 and also has qtbase added in DEPENDS should inherit this class if it wants PACKAGE_ARCH to be automatically adjusted.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#10 lore raw

PATCH 1/1 qt5.inc: allow to set the package arch globally

In reply to Martin Jansa

If Qt5 (qtbase) is machine specific, then all packages depending on qtbase will also be machine specific, because the (initial) qtbase configuration becomes part of Qt5/qmake, thus affecting builds of packages built against this specific version of qtbase.

Since it is not feasible to add PACKAGE_ARCH=... to each and every recipe that is built using qmake and depends on Qt5, we introduce a new variable, QT_PACKAGES_ARCH, that can be set by the machine configuration as needed.

We have to be careful though to only change the architecture of the resulting packages if we're not compiling a 'native' package.

---
 recipes-qt/qt5/qt5.inc | 12 ++++++++++++
 1 file changed, 12 insertions(+)
recipes-qt/qt5/qt5.inc +12 -0
index 7669efc..8d8438f 100644
@@ -20,6 +20,18 @@ OE_QMAKE_PATH_SETTINGS = "${OE_QMAKE_PATH_QT_SETTINGS}"
 OE_QMAKE_PATH_EXAMPLES = "${OE_QMAKE_PATH_QT_EXAMPLES}"
 OE_QMAKE_PATH_TESTS = "${OE_QMAKE_PATH_QT_TESTS}"
 
+# If Qt5 (qtbase) is machine specific, then everything will be,
+# because the (initial) qtbase configuration becomes part of Qt5/qmake
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch != tarch:
+        tarch = d.getVar("QT_PACKAGES_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
 PACKAGES =. "${PN}-qmlplugins-dbg ${PN}-tools-dbg ${PN}-plugins-dbg ${PN}-qmlplugins ${PN}-tools ${PN}-plugins ${PN}-mkspecs ${PN}-examples-dev ${PN}-examples-staticdev ${PN}-examples-dbg ${PN}-examples "
 
 # extra -dbg packages
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH 1/1 qt5.inc: allow to set the package arch globally

From: André Draszik <[email protected]>

If Qt5 (qtbase) is machine specific, then all packages depending on qtbase will also be machine specific, because the (initial) qtbase configuration becomes part of Qt5/qmake, thus affecting builds of packages built against this specific version of qtbase.

Since it is not feasible to add PACKAGE_ARCH=... to each and every recipe that is built using qmake and depends on Qt5, we introduce a new variable, QT_PACKAGES_ARCH, that can be set by the machine configuration as needed.

We have to be careful though to only change the architecture of the resulting packages if we're not compiling a 'native' package.

---
 recipes-qt/qt5/qt5.inc | 12 ++++++++++++
 1 file changed, 12 insertions(+)
recipes-qt/qt5/qt5.inc +12 -0
index 7669efc..8d8438f 100644
@@ -20,6 +20,18 @@ OE_QMAKE_PATH_SETTINGS = "${OE_QMAKE_PATH_QT_SETTINGS}"
 OE_QMAKE_PATH_EXAMPLES = "${OE_QMAKE_PATH_QT_EXAMPLES}"
 OE_QMAKE_PATH_TESTS = "${OE_QMAKE_PATH_QT_TESTS}"
 
+# If Qt5 (qtbase) is machine specific, then everything will be,
+# because the (initial) qtbase configuration becomes part of Qt5/qmake
+python __anonymous() {
+    barch = d.getVar("BUILD_ARCH", True) or ''
+    tarch = d.getVar("TARGET_ARCH", True) or ''
+    # do not do anything if we are building a native package
+    if barch != tarch:
+        tarch = d.getVar("QT_PACKAGES_ARCH", True) or ''
+        if tarch:
+            d.setVar("PACKAGE_ARCH", tarch)
+}
+
 PACKAGES =. "${PN}-qmlplugins-dbg ${PN}-tools-dbg ${PN}-plugins-dbg ${PN}-qmlplugins ${PN}-tools ${PN}-plugins ${PN}-mkspecs ${PN}-examples-dev ${PN}-examples-staticdev ${PN}-examples-dbg ${PN}-examples "
 
 # extra -dbg packages
Signature · 1 line
1.8.1.2
#12 lore raw
In reply to Nicolas Dechesne
Quoted 10 lines · Nicolas Dechesne

so i have a couple of questions:

- are we doing something really wrong here? or are we getting issues that
anyone would get when trying to have a OE based product with Qt5 and multiple machines from the same <arch>?

- assuming this is a typical use case... i wish there was an easy
mechanism to 'mark' all Qt5 packages as PACKAGE_ARCH = "${MACHINE_ARCH}", without having to .bbappend every single recipe. It is indeed quite common to have a .bbappend for qtbase, but not for the other packages...

We have a similar case in meta-fsl where we have several packages which are machine specific and SoC specific. We solved this using a class that 'changes' the package-arch using the depends.

http://git.yoctoproject.org/cgit/cgit.cgi/meta-fsl-arm/tree/classes/fsl-dynamic-packagearch.bbclass

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750