Skip to contentSkip to conversation

bitbake.conf: Add sdl-config to HOSTTOOLS if using host SDL

PATCH In review Jonathan Liu 4 participants 13 messages Jun 1, 2017 – Jun 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bitbake.conf: Add sdl-config to HOSTTOOLS if using host SDL

If ASSUME_PROVIDES contains libsdl-native, we need to add sdl-config to HOSTTOOLS to allow access to the host sdl-config.

---
 meta/conf/bitbake.conf | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +3 -0
index 8e4f4bbb56..3ad905c917 100644
@@ -471,6 +471,9 @@ HOSTTOOLS += " \
 # Tools needed to run testimage runtime image testing
 HOSTTOOLS += "ip ping ps scp ssh stty"
 
+# Link to sdl-config if using host SDL
+HOSTTOOLS += "${@bb.utils.contains('ASSUME_PROVIDES', 'libsdl-native', 'sdl-config', '', d)}"
+
 # Link to these if present
 HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc sftp socat sudo"
 
Signature · 1 line
2.12.2
#1 lore raw
Quoted 13 lines · Jonathan Liu

If ASSUME_PROVIDES contains libsdl-native, we need to add sdl-config to HOSTTOOLS to allow access to the host sdl-config.

---
 meta/conf/bitbake.conf | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +0 -0
index 8e4f4bbb56..3ad905c917 100644

meta/conf/bitbake.conf HOSTTOOLS += " \ · line 476

Quoted 6 lines
meta/conf/bitbake.conf +3 -0
@@ -471,6 +471,9 @@ HOSTTOOLS += " \
 # Tools needed to run testimage runtime image testing
 HOSTTOOLS += "ip ping ps scp ssh stty"
 
+# Link to sdl-config if using host SDL
+HOSTTOOLS += "${@bb.utils.contains('ASSUME_PROVIDES', 'libsdl-native', 'sdl-config', '', d)}"
+

Why are you checking ASSUME_PROVIDES? The variable is called ASSUME_PROVIDED.

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

Sorry for the late reply, going through my backlog... I see that this has been merged. Probably needs to be reverted or fixed.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#2 lore raw

Hi Patrick,

Something is really strange. HOSTTOOLS doesn't appear to be working anymore in pyro branch
If I do "bitbake -c devshell qemu-native", I can run the following commands successfully which should have been filtered out by HOSTTOOLS:

$ which sdl-config
/usr/bin/sdl-config
$ which ncdu
/usr/bin/ncdu
$ which whoami
/usr/bin/whoami

For some reason /usr/bin is contained in PATH. Previously it was filtered out.

Regards,
Jonathan

Quoted 41 lines · Patrick Ohly
Quoted 13 lines · Jonathan Liu

If ASSUME_PROVIDES contains libsdl-native, we need to add sdl-config to HOSTTOOLS to allow access to the host sdl-config.

---
 meta/conf/bitbake.conf | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +0 -0
index 8e4f4bbb56..3ad905c917 100644

meta/conf/bitbake.conf HOSTTOOLS += " \ · line 476

Quoted 6 lines
meta/conf/bitbake.conf +3 -0
@@ -471,6 +471,9 @@ HOSTTOOLS += " \
 # Tools needed to run testimage runtime image testing
 HOSTTOOLS += "ip ping ps scp ssh stty"
 
+# Link to sdl-config if using host SDL
+HOSTTOOLS += "${@bb.utils.contains('ASSUME_PROVIDES', 'libsdl-native', 'sdl-config', '', d)}"
+

Why are you checking ASSUME_PROVIDES? The variable is called ASSUME_PROVIDED.

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

Sorry for the late reply, going through my backlog... I see that this has been merged. Probably needs to be reverted or fixed.

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.

#3 lore raw
Quoted 8 lines · Jonathan Liu

Hi Patrick,

Something is really strange. HOSTTOOLS doesn't appear to be working anymore in pyro branch
If I do "bitbake -c devshell qemu-native", I can run the following commands successfully which should have been filtered out by HOSTTOOLS:

Quoted 8 lines
$ which sdl-config
/usr/bin/sdl-config
$ which ncdu
/usr/bin/ncdu
$ which whoami
/usr/bin/whoami

For some reason /usr/bin is contained in PATH. Previously it was filtered out.

I think that's done intentionally for devshell (and only for devshell) because developers expect to have access to all host tools.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#4 lore raw
In reply to Patrick Ohly
Quoted 3 lines · Patrick Ohly

Sorry for the late reply, going through my backlog... I see that this has been merged. Probably needs to be reverted or fixed.

The typo fix is in ross/mut already.

Ross

#5 lore raw
In reply to Patrick Ohly
Quoted 3 lines · Patrick Ohly

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

I'm still interested in learning what problem it fixes.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#6 lore raw

Hi Patrick,

The original problem was that bitbake would print out the error:
"libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.", if "libsdl-native" was in ASSUME_PROVIDED even if the host has sdl-config in its PATH.

This occurred really early for a clean build and bitbake would bail out. The sanity check is in meta/classes/sanity.bbclass.

Regards,
Jonathan

Quoted 17 lines · Patrick Ohly
Quoted 3 lines · Patrick Ohly

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

I'm still interested in learning what problem it fixes.

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.

#7 lore raw
Quoted 10 lines · Jonathan Liu

Hi Patrick,

The original problem was that bitbake would print out the error:
"libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.", if "libsdl-native" was in ASSUME_PROVIDED even if the host has sdl-config in its PATH.

This occurred really early for a clean build and bitbake would bail out. The sanity check is in meta/classes/sanity.bbclass.

I've not hit that problem, probably because the sanity check was not run again when I changed ASSUME_PROVIDED. I can reproduce it in a clean build directory without conf/sanity_info.

I think extending HOSTTOOLS merely to satisfy sanity.bbclass is the wrong solution to the problem. It makes sdl-config available to all recipes, which is unnecessary and potentially introduces back host contamination.

It is unnecessary because the qemu recipe has special code that enables the use of the host SDL when told to do so via ASSUME_PROVIDED.

Can you come up with a better solution, probably by patching sanity.bbclass?

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#8 lore raw

Hi Patrick,

Quoted 21 lines · Patrick Ohly
Quoted 10 lines · Jonathan Liu

Hi Patrick,

The original problem was that bitbake would print out the error:
"libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.", if "libsdl-native" was in ASSUME_PROVIDED even if the host has sdl-config in its PATH.

This occurred really early for a clean build and bitbake would bail out. The sanity check is in meta/classes/sanity.bbclass.

I've not hit that problem, probably because the sanity check was not run again when I changed ASSUME_PROVIDED. I can reproduce it in a clean build directory without conf/sanity_info.

I think extending HOSTTOOLS merely to satisfy sanity.bbclass is the wrong solution to the problem. It makes sdl-config available to all recipes, which is unnecessary and potentially introduces back host contamination.

Quoted 5 lines

It is unnecessary because the qemu recipe has special code that enables the use of the host SDL when told to do so via ASSUME_PROVIDED.

Can you come up with a better solution, probably by patching sanity.bbclass?

I can't think of any at this stage. Feel free to post a patch if you come up with something better.

Quoted 11 lines

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.

Regards,
Jonathan

#9 lore raw
Quoted 24 lines · Jonathan Liu

Hi Patrick,

Quoted 21 lines · Patrick Ohly
Quoted 10 lines · Jonathan Liu

Hi Patrick,

The original problem was that bitbake would print out the error:
"libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.", if "libsdl-native" was in ASSUME_PROVIDED even if the host has sdl-config in its PATH.

This occurred really early for a clean build and bitbake would bail out. The sanity check is in meta/classes/sanity.bbclass.

I've not hit that problem, probably because the sanity check was not run again when I changed ASSUME_PROVIDED. I can reproduce it in a clean build directory without conf/sanity_info.

I think extending HOSTTOOLS merely to satisfy sanity.bbclass is the wrong solution to the problem. It makes sdl-config available to all recipes, which is unnecessary and potentially introduces back host contamination.

Quoted 7 lines
Quoted 5 lines

It is unnecessary because the qemu recipe has special code that enables the use of the host SDL when told to do so via ASSUME_PROVIDED.

Can you come up with a better solution, probably by patching sanity.bbclass?

I can't think of any at this stage.

Here's what qemu.inc does:

do_configure_prepend_class-native() {
# Append build host pkg-config paths for native target since the host may provide sdl BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
fi

insanity.bbclass could use the host pkg-config to ensure that sdl.pc is installed.

Quoted 1 line

Feel free to post a patch if you come up with something better.

Sorry, I don't have time for that. I've filed
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11725 so that we don't forget about it.

Signature · 6 lines
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
#10 lore raw
In reply to Patrick Ohly
Quoted 26 lines · Patrick Ohly
Quoted 20 lines · Jonathan Liu

If ASSUME_PROVIDES contains libsdl-native, we need to add sdl- config
to HOSTTOOLS to allow access to the host sdl-config.

---
 meta/conf/bitbake.conf | 3 +++

 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +0 -0
index 8e4f4bbb56..3ad905c917 100644
@@ -471,6 +471,9 @@ HOSTTOOLS += " \
  # Tools needed to run testimage runtime image testing

 HOSTTOOLS += "ip ping ps scp ssh stty"

meta/conf/bitbake.conf +2 -0
+# Link to sdl-config if using host SDL
+HOSTTOOLS += "${@bb.utils.contains('ASSUME_PROVIDES', 'libsdl-
Quoted 2 lines

native', 'sdl-config', '', d)}"
+

Why are you checking ASSUME_PROVIDES? The variable is called ASSUME_PROVIDED.

Quoted 6 lines

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

Sorry for the late reply, going through my backlog... I see that this has been merged. Probably needs to be reverted or fixed.

I've reverted this since I can't see how it can actually work or help anything, unless someone has set "ASSUME_PROVIDES" to test this (which is a variable that doesn't exist or is used anywhere).

Cheers,

Richard

#11 lore raw

Hi Richard,

Quoted 34 lines · Richard Purdie
Quoted 26 lines · Patrick Ohly
Quoted 20 lines · Jonathan Liu

If ASSUME_PROVIDES contains libsdl-native, we need to add sdl- config
to HOSTTOOLS to allow access to the host sdl-config.

---
 meta/conf/bitbake.conf | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +2 -0
index 8e4f4bbb56..3ad905c917 100644
@@ -471,6 +471,9 @@ HOSTTOOLS += " \
 # Tools needed to run testimage runtime image testing
 HOSTTOOLS += "ip ping ps scp ssh stty"
 
+# Link to sdl-config if using host SDL
+HOSTTOOLS += "${@bb.utils.contains('ASSUME_PROVIDES', 'libsdl-
Quoted 2 lines

native', 'sdl-config', '', d)}"
+

Why are you checking ASSUME_PROVIDES? The variable is called ASSUME_PROVIDED.

Quoted 6 lines

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

Sorry for the late reply, going through my backlog... I see that this has been merged. Probably needs to be reverted or fixed.

Quoted 7 lines

I've reverted this since I can't see how it can actually work or help anything, unless someone has set "ASSUME_PROVIDES" to test this (which is a variable that doesn't exist or is used anywhere).

Cheers,

Richard

It is a typo. The fix is in ross/mut -
http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=ross/mut&id=7605eb1e507d4ebc0c5b8d98a358be7c55e4ddd2.

Regards,
Jonathan

#12 lore raw

Hi Richard,

Quoted 42 lines · Jonathan Liu

Hi Richard,

Quoted 38 lines · Richard Purdie
Quoted 26 lines · Patrick Ohly
Quoted 20 lines · Jonathan Liu

If ASSUME_PROVIDES contains libsdl-native, we need to add sdl- config
to HOSTTOOLS to allow access to the host sdl-config.

---
 meta/conf/bitbake.conf | 3 +++
 1 file changed, 3 insertions(+)
meta/conf/bitbake.conf +2 -0
index 8e4f4bbb56..3ad905c917 100644
@@ -471,6 +471,9 @@ HOSTTOOLS += " \
 # Tools needed to run testimage runtime image testing
 HOSTTOOLS += "ip ping ps scp ssh stty"
 
+# Link to sdl-config if using host SDL
+HOSTTOOLS += "${@bb.utils.contains('ASSUME_PROVIDES', 'libsdl-
Quoted 2 lines

native', 'sdl-config', '', d)}"
+

Why are you checking ASSUME_PROVIDES? The variable is called ASSUME_PROVIDED.

Quoted 6 lines

Even if you had checked the right variable, is that really necessary? I'm building qemu with ASSUME_PROVIDED += "libsdl-native" just fine on Debian Jessie, without sdl-config in HOSTTOOLS.

Sorry for the late reply, going through my backlog... I see that this has been merged. Probably needs to be reverted or fixed.

I've reverted this since I can't see how it can actually work or help anything, unless someone has set "ASSUME_PROVIDES" to test this (which is a variable that doesn't exist or is used anywhere).

Quoted 6 lines
Quoted 3 lines

Cheers,

Richard

It is a typo. The fix is in ross/mut -
http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=ross/mut&id=7605eb1e507d4ebc0c5b8d98a358be7c55e4ddd2.

Also it was indeed tested after the fix but the sanity check was cached in build/conf/sanity_info and I didn't think to clear it. So the sanity check wasn't re-run after I deleted bitbake.lock, buildhistory, cache, sstate-cache, tmp and rebuilt.

Why is state data written into a "conf" folder anyway? Shouldn't this go into another folder like "cache"? Users don't generally think to wipe files in conf folder when they want to do a clean rebuild.

Regards,
Jonathan