[PATCH] devshell: Fix wrong PATH value if disabled ccache

14 views
Skip to first unread message

Anton Mikanovich

unread,
Jan 8, 2025, 10:23:07 AM1/8/25
to isar-...@googlegroups.com, Anton Mikanovich
In case USE_CCACHE is set to 0 the value of PATH_PREPEND env variable
will be empty. This makes PATH in devshell looks like:

:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

If building the packages having directories named the same as some
binaries used during the build (like dh-python with dh directory inside
its sources), it will fail with the following error:

...
debian/rules binary
dh binary
make: dh: Permission denied
make: *** [debian/rules:4: binary] Error 127

Make devshell expand PATH only if PATH_PREPEND is non-empty.

Signed-off-by: Anton Mikanovich <ami...@ilbers.de>
---
meta/classes/dpkg-base.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index c02c07a8..4468a49a 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -258,7 +258,7 @@ python do_devshell() {
apt-get -y -q update -o Dir::Etc::SourceList=\"sources.list.d/isar-apt.list\" -o Dir::Etc::SourceParts=\"-\" -o APT::Get::List-Cleanup=\"0\"; \
apt-get -y upgrade; \
{2}; \
- export PATH=$PATH_PREPEND:$PATH; \
+ if [ -n \"$PATH_PREPEND\" ]; then export PATH=$PATH_PREPEND:$PATH; fi; \
$SHELL -i \
'"
oe_terminal(termcmd.format(schroot, pp_pps, install_deps), "Isar devshell", d)
--
2.34.1

Uladzimir Bely

unread,
Jan 16, 2025, 2:02:36 AM1/16/25
to Anton Mikanovich, isar-...@googlegroups.com
Applied to next.

--
Best regards,
Uladzimir.
Reply all
Reply to author
Forward
0 new messages