Skip to contentSkip to conversation

bitbake: remove /usr from pseudo ignore paths

PATCH In review Anton Kachalov 3 participants 9 messages Jan 7, 2021 – Jan 15, 2021 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw

PATCH 1/1 bitbake: remove /usr from pseudo ignore paths

In reply to a message not in the archive

Allow the Yocto's building tree to be placed under /usr.

Relevant issue: https://github.com/openbmc/openbmc/issues/3724

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +0 -1
index a04005b0f5..77c8148aa1 100644
@@ -685,7 +685,7 @@ SRC_URI = ""
 PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
 PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
 PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
-PSEUDO_IGNORE_PATHS =

"/usr/,/etc/,/lib,/dev/,${T},${WORKDIR}/recipe-sysroot,${SSTATE_DIR},${STAMPS_DIR},${WORKDIR}/pkgdata-sysroot,${TMPDIR}/sstate-control,${DEPLOY_DIR},${WORKDIR}/deploy-,${TMPDIR}/buildstats,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/sstate-build-image_complete,${TMPDIR}/sysroots-components,${BUILDHISTORY_DIR},${TMPDIR}/pkgdata,${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR}" +PSEUDO_IGNORE_PATHS = "/etc/,/lib,/dev/,${T},${WORKDIR}/recipe-sysroot,${SSTATE_DIR},${STAMPS_DIR},${WORKDIR}/pkgdata-sysroot,${TMPDIR}/sstate-control,${DEPLOY_DIR},${WORKDIR}/deploy-,${TMPDIR}/buildstats,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/sstate-build-image_complete,${TMPDIR}/sysroots-components,${BUILDHISTORY_DIR},${TMPDIR}/pkgdata,${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR}"

export PSEUDO_DISABLED = "1"
#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"

Signature · 1 line
2.29.2.729.g45daf8777d-goog
#3 lore raw
Quoted 8 lines · Anton Kachalov via lists.openembedded.org

Allow the Yocto's building tree to be placed under /usr.

Relevant issue: https://github.com/openbmc/openbmc/issues/3724

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

 1 file changed, 1 insertion(+), 1 deletion(-)

Do you really need to build under /usr? We probably should make this more of a hard error if someone attempts it. I commented on the issue, could you just remove this from PSEUDO_IGNORE_PATHS locally if you really have to use /usr?

Cheers,

Richard

#4 lore raw

Hello, Richard.

Yes, for various reasons we can not move out from /usr/local. Before the change it works smoothly and we didn't notice about any kind of performance issues.
May be we can explicitly add various standard subdirs under /usr excluding /usr/local?

Quoted 21 lines · On Thu, Jan 7, 2021, 23:16 Richard Purdie <…
Quoted 8 lines · Anton Kachalov via lists.openembedded.org

Allow the Yocto's building tree to be placed under /usr.

Relevant issue: https://github.com/openbmc/openbmc/issues/3724

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Do you really need to build under /usr? We probably should make this more of a hard error if someone attempts it. I commented on the issue, could you just remove this from PSEUDO_IGNORE_PATHS locally if you really have to use /usr?

Cheers,

Richard

#5 lore raw
Quoted 6 lines · Anton Kachalov

Hello, Richard.
Yes, for various reasons we can not move out from /usr/local. Before the change it works smoothly and we didn't notice about any kind of performance issues.
May be we can explicitly add various standard subdirs under /usr excluding /usr/local?

Can you add local config like:

PSEUDO_IGONRE_PATHS_remove = "/usr/,"

which should allow things to work for you?

Cheers,

Richard

#6 lore raw
Quoted 9 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Richard Purdie
Sent: den 8 januari 2021 09:27
To: Anton Kachalov <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [poky][PATCH] bitbake: remove /usr from pseudo ignore paths

Quoted 3 lines
Quoted 2 lines · Anton Kachalov

Hello, Richard.
Yes, for various reasons we can not move out from /usr/local.

Using a build directory anywhere under /usr sounds like a very unusual setup and I do not think it is a situation that warrants special treatment in the common configuration. Workarounds are better done in the local environment.

Quoted 4 lines
Quoted 4 lines

Before the change it works smoothly and we didn't notice about any kind of performance issues.
May be we can explicitly add various standard subdirs under /usr excluding /usr/local?

I believe it would be hard to maintain a suitable list of subdirectories of /usr (including /usr/local) that pseudo should ignore. However, do we actually know if pseudo is normally accessing paths under /usr, or was it just added as a "pseudo should never care about anything here so we may as well add it"?

Quoted 5 lines

Can you add local config like:

PSEUDO_IGONRE_PATHS_remove = "/usr/,"

which should allow things to work for you?

Correct me if I am wrong, but AFAIK you cannot use the _remove operator to remove a part of a string. It only works on space separated words. You will have to redefine the entire PSEUDO_IGONRE_PATHS to remove any parts of it.

This is a drawback of using a list in a bitbake variable that is separated using something other than spaces. I guess commas were chosen as separator for this variable since spaces are more common (if still rare) in paths than commas, but it causes problems like this.

Quoted 4 lines

Cheers,

Richard

//Peter

#7 lore raw

Hello,

nope, setting the entire PSEUDO_IGNORE_PATHS without "/usr" doesn't work. The do_install task fails with error code 134 without any log file. Neither temp/run.do_install file exists. The pseudo.log doesn't have any errors.

Quoted 53 lines · Peter Kjellerstedt
Quoted 9 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Richard Purdie
Sent: den 8 januari 2021 09:27
To: Anton Kachalov <[email protected]>
Cc: [email protected]
Subject: Re: [OE-core] [poky][PATCH] bitbake: remove /usr from pseudo ignore paths

Quoted 3 lines
Quoted 2 lines · Anton Kachalov

Hello, Richard.
Yes, for various reasons we can not move out from /usr/local.

Using a build directory anywhere under /usr sounds like a very unusual setup and I do not think it is a situation that warrants special treatment in the common configuration. Workarounds are better done in the local environment.

Quoted 4 lines
Quoted 4 lines

Before the change it works smoothly and we didn't notice about any kind of performance issues.
May be we can explicitly add various standard subdirs under /usr excluding /usr/local?

I believe it would be hard to maintain a suitable list of subdirectories of /usr (including /usr/local) that pseudo should ignore. However, do we actually know if pseudo is normally accessing paths under /usr, or was it just added as a "pseudo should never care about anything here so we may as well add it"?

Quoted 5 lines

Can you add local config like:

PSEUDO_IGONRE_PATHS_remove = "/usr/,"

which should allow things to work for you?

Correct me if I am wrong, but AFAIK you cannot use the _remove operator to remove a part of a string. It only works on space separated words. You will have to redefine the entire PSEUDO_IGONRE_PATHS to remove any parts of it.

This is a drawback of using a list in a bitbake variable that is separated using something other than spaces. I guess commas were chosen as separator for this variable since spaces are more common (if still rare) in paths than commas, but it causes problems like this.

Quoted 4 lines

Cheers,

Richard

//Peter

#8 lore raw
Quoted 4 lines · Anton Kachalov

nope, setting the entire PSEUDO_IGNORE_PATHS without "/usr" doesn't work. The do_install task fails with error code 134 without any log file. Neither temp/run.do_install file exists. The pseudo.log doesn't have any errors.

Right, Peter is correct and _remove is space delimited, the variable is comma delimited. Sorry, I'm getting confused.

There is the rather uglier:

PSEUDO_IGNORE_PATHS := "${@d.getVar('PSEUDO_IGNORE_PATHS').replace('/usr/,','')}"

which should work (I did test this time!).

Cheers,

Richard

#9 lore raw
Quoted 6 lines · Richard Purdie
Quoted 4 lines · Anton Kachalov

nope, setting the entire PSEUDO_IGNORE_PATHS without "/usr" doesn't work. The do_install task fails with error code 134 without any log file. Neither temp/run.do_install file exists. The pseudo.log doesn't have any errors.

Quoted 8 lines

Right, Peter is correct and _remove is space delimited, the variable is comma delimited. Sorry, I'm getting confused.

There is the rather uglier:

PSEUDO_IGNORE_PATHS := "${@d.getVar('PSEUDO_IGNORE_PATHS').replace('/usr/,','')}"

which should work (I did test this time!).

Thinking more, this is safer:

PSEUDO_IGNORE_PATHS := "${@d.getVar('PSEUDO_IGNORE_PATHS', False).replace('/usr/,','')}"

I did test it parses and gave the right value with bitbake -e however I not expanding it will be much safer as I suspect the first version won't work in recipe context at build time.

Cheers,

Richard

#10 lore raw

Perhaps, I'm doing something wrong, but setting this variable in build/conf/local.conf makes packages fail to build (do_install): only those which fail with pseudo before (linux-libc-headers and base-files).

Quoted 31 lines · Richard Purdie
Quoted 6 lines · Richard Purdie
Quoted 4 lines · Anton Kachalov

nope, setting the entire PSEUDO_IGNORE_PATHS without "/usr" doesn't work. The do_install task fails with error code 134 without any log file. Neither temp/run.do_install file exists. The pseudo.log doesn't have any errors.

Quoted 6 lines

Right, Peter is correct and _remove is space delimited, the variable is comma delimited. Sorry, I'm getting confused.

There is the rather uglier:

PSEUDO_IGNORE_PATHS :=

"${@d.getVar('PSEUDO_IGNORE_PATHS').replace('/usr/,','')}"

Quoted 2 lines

which should work (I did test this time!).

Thinking more, this is safer:

PSEUDO_IGNORE_PATHS := "${@d.getVar('PSEUDO_IGNORE_PATHS', False).replace('/usr/,','')}"

I did test it parses and gave the right value with bitbake -e however I not expanding it will be much safer as I suspect the first version won't work in recipe context at build time.

Cheers,

Richard