diff mbox series

[v2] bitbake.conf: ignore ${HOME}/. files in pseudo

Message ID 20250505074031.920194-1-mikko.rapeli@linaro.org
State New
Headers show
Series [v2] bitbake.conf: ignore ${HOME}/. files in pseudo | expand

Commit Message

Mikko Rapeli May 5, 2025, 7:40 a.m. UTC
vim and less always write to these files in users home directory.
Using vim and less via pseudo in "bitbake -c devshell recipe" and
outside of pseudo triggers pseudo aborts which makes interactive
use of devshell difficult. Fixes vim and less crashes and related
pseudo log entries:

inode mismatch: '/home/builder/.viminfo' ino 33270730 in db, 33269736 in request.
inode mismatch: '/home/builder/.lesshst' ino 33270625 in db, 33270730 in request.

Ignoring all files with ${HOME}/. in path since many tools
with e.g. GNU readline support will write files there.
Hopefully no-one compiles in such paths.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/conf/bitbake.conf | 1 +
 1 file changed, 1 insertion(+)

v2: ignore all files from ${HOME}/. instead of just ${HOME}/.vim and ${HOME}/.less

v1: https://lists.openembedded.org/g/openembedded-core/message/215986

Comments

Peter Kjellerstedt May 5, 2025, 10:43 a.m. UTC | #1
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Mikko Rapeli via lists.openembedded.org
> Sent: den 5 maj 2025 09:41
> To: openembedded-core@lists.openembedded.org
> Cc: Mikko Rapeli <mikko.rapeli@linaro.org>
> Subject: [OE-core] [PATCH v2] bitbake.conf: ignore ${HOME}/. files in pseudo
> 
> vim and less always write to these files in users home directory.
> Using vim and less via pseudo in "bitbake -c devshell recipe" and
> outside of pseudo triggers pseudo aborts which makes interactive
> use of devshell difficult. Fixes vim and less crashes and related
> pseudo log entries:
> 
> inode mismatch: '/home/builder/.viminfo' ino 33270730 in db, 33269736 in request.
> inode mismatch: '/home/builder/.lesshst' ino 33270625 in db, 33270730 in request.
> 
> Ignoring all files with ${HOME}/. in path since many tools
> with e.g. GNU readline support will write files there.
> Hopefully no-one compiles in such paths.
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  meta/conf/bitbake.conf | 1 +
>  1 file changed, 1 insertion(+)
> 
> v2: ignore all files from ${HOME}/. instead of just ${HOME}/.vim and ${HOME}/.less
> 
> v1: https://lists.openembedded.org/g/openembedded-core/message/215986
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index b1dae17267..8d71c8f50c 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -748,6 +748,7 @@ PSEUDO_IGNORE_PATHS =
> "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysro
>  PSEUDO_IGNORE_PATHS .= ",${TMPDIR}/sstate-control,${TMPDIR}/buildstats,${TMPDIR}/sysroots-components,${TMPDIR}/pkgdata"
>  PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/deploy-,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/pkgdata-sysroot"
>  PSEUDO_IGNORE_PATHS .= ",${DEPLOY_DIR},${BUILDHISTORY_DIR},${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR},${S},${B}"

Please add a comment here because it would be all too easy to mistake 
that for something that can be simplified to just "${HOME}" (by expecting 
normal path rules). E.g.:

# Ignore all files and directories starting with a . in the ${HOME} directory

> +PSEUDO_IGNORE_PATHS .= ",${HOME}/."
> 
>  export PSEUDO_DISABLED = "1"
>  #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
> --
> 2.43.0

//Peter
Mikko Rapeli May 5, 2025, 12:21 p.m. UTC | #2
Hi,

On Mon, May 05, 2025 at 10:43:34AM +0000, Peter Kjellerstedt wrote:
> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Mikko Rapeli via lists.openembedded.org
> > Sent: den 5 maj 2025 09:41
> > To: openembedded-core@lists.openembedded.org
> > Cc: Mikko Rapeli <mikko.rapeli@linaro.org>
> > Subject: [OE-core] [PATCH v2] bitbake.conf: ignore ${HOME}/. files in pseudo
> > 
> > vim and less always write to these files in users home directory.
> > Using vim and less via pseudo in "bitbake -c devshell recipe" and
> > outside of pseudo triggers pseudo aborts which makes interactive
> > use of devshell difficult. Fixes vim and less crashes and related
> > pseudo log entries:
> > 
> > inode mismatch: '/home/builder/.viminfo' ino 33270730 in db, 33269736 in request.
> > inode mismatch: '/home/builder/.lesshst' ino 33270625 in db, 33270730 in request.
> > 
> > Ignoring all files with ${HOME}/. in path since many tools
> > with e.g. GNU readline support will write files there.
> > Hopefully no-one compiles in such paths.
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > ---
> >  meta/conf/bitbake.conf | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > v2: ignore all files from ${HOME}/. instead of just ${HOME}/.vim and ${HOME}/.less
> > 
> > v1: https://lists.openembedded.org/g/openembedded-core/message/215986
> > 
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index b1dae17267..8d71c8f50c 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -748,6 +748,7 @@ PSEUDO_IGNORE_PATHS =
> > "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysro
> >  PSEUDO_IGNORE_PATHS .= ",${TMPDIR}/sstate-control,${TMPDIR}/buildstats,${TMPDIR}/sysroots-components,${TMPDIR}/pkgdata"
> >  PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/deploy-,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/pkgdata-sysroot"
> >  PSEUDO_IGNORE_PATHS .= ",${DEPLOY_DIR},${BUILDHISTORY_DIR},${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR},${S},${B}"
> 
> Please add a comment here because it would be all too easy to mistake 
> that for something that can be simplified to just "${HOME}" (by expecting 
> normal path rules). E.g.:
> 
> # Ignore all files and directories starting with a . in the ${HOME} directory

Yes, I can add a comment.

Unfortunatetly I already run into problems with full ${HOME}/. filter
in trusted-firmware-a from meta-arm. Looks like the dtb etc tooling
does not work correctly and files end up without root owner:

ERROR: trusted-firmware-a-2.12.1+git-r0 do_package_qa: QA Issue: trusted-firmware-a: /optee_ffa_spmc_manifest.dtb is owned by uid 1004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
ERROR: trusted-firmware-a-2.12.1+git-r0 do_package_qa: QA Issue: trusted-firmware-a: /optee_ffa_spmc_manifest.dtb is owned by gid 1004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
ERROR: trusted-firmware-a-2.12.1+git-r0 do_package_qa: QA Issue: trusted-firmware-a: /firmware/bl31.bin is owned by uid 1004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
ERROR: trusted-firmware-a-2.12.1+git-r0 do_package_qa: QA Issue: trusted-firmware-a: /firmware/bl31.bin is owned by gid 1004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
ERROR: trusted-firmware-a-2.12.1+git-r0 do_package_qa: QA Issue: trusted-firmware-a: /firmware/bl31-zynqmp.bin is owned by uid 1004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]

Since pseudo uses strncmp() quoting the dot etc should not have any effect.

I will revert to v1 of this with a comment. That I tested for a few days
without any issues. I used vim and less extensively when rebasing
a number of patches in tf-a, edk2, u-boot, optee etc. As I feared
lots of tools are using ${HOME}/. paths in various ways.


Cheers,

-Mikko

> > +PSEUDO_IGNORE_PATHS .= ",${HOME}/."
> > 
> >  export PSEUDO_DISABLED = "1"
> >  #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
> > --
> > 2.43.0
> 
> //Peter
>
diff mbox series

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index b1dae17267..8d71c8f50c 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -748,6 +748,7 @@  PSEUDO_IGNORE_PATHS = "/usr/,/etc/,/lib,/dev/,/run/,${T},${WORKDIR}/recipe-sysro
 PSEUDO_IGNORE_PATHS .= ",${TMPDIR}/sstate-control,${TMPDIR}/buildstats,${TMPDIR}/sysroots-components,${TMPDIR}/pkgdata"
 PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/deploy-,${WORKDIR}/sstate-build-package_,${WORKDIR}/sstate-install-package_,${WORKDIR}/pkgdata-sysroot"
 PSEUDO_IGNORE_PATHS .= ",${DEPLOY_DIR},${BUILDHISTORY_DIR},${TOPDIR}/cache,${COREBASE}/scripts,${CCACHE_DIR},${S},${B}"
+PSEUDO_IGNORE_PATHS .= ",${HOME}/."
 
 export PSEUDO_DISABLED = "1"
 #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"