From 34004afb65cd5c677b8e2c944144eeb91d86abfd Mon Sep 17 00:00:00 2001 From: Arno Baumfalk Date: Tue, 16 May 2023 17:18:26 +0200 Subject: bitbake: fetch2/npm: evaluate PATH before patching HOME When the user configures the TMPDIR variable in a way that it contains $HOME (in local.conf), the DataSmart (d) object's PATH variable will also contain $HOME. As the NpmEnvironment patches HOME with a temporary directory, further evaluation of PATH will become invalid an the build breaks with an error (npm not found). As countermeasure PATH is evaluated *before* patching HOME. (Bitbake rev: 893f3b116b628457fe0bfaf4b8394b1cd05a90a5) Signed-off-by: Arno Baumfalk Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/npm.py | 1 + 1 file changed, 1 insertion(+) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py index 8a179a339a..e6d0598f5d 100644 --- a/bitbake/lib/bb/fetch2/npm.py +++ b/bitbake/lib/bb/fetch2/npm.py @@ -103,6 +103,7 @@ class NpmEnvironment(object): """Run npm command in a controlled environment""" with tempfile.TemporaryDirectory() as tmpdir: d = bb.data.createCopy(self.d) + d.setVar("PATH", d.getVar("PATH")) # PATH might contain $HOME - evaluate it before patching d.setVar("HOME", tmpdir) if not workdir: -- cgit v1.2.3-54-g00ecf