diff options
author | Arno Baumfalk <a.baumfalk@astro-kom.de> | 2023-05-16 17:18:26 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-25 13:16:21 +0100 |
commit | 893f3b116b628457fe0bfaf4b8394b1cd05a90a5 (patch) | |
tree | afb76b2fab7c6582a85b288650097cb0e05735dd | |
parent | 7090a14b0035842112d073acf7f2ed1a01fdeccf (diff) | |
download | bitbake-893f3b116b628457fe0bfaf4b8394b1cd05a90a5.tar.gz |
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.
Signed-off-by: Arno Baumfalk <a.baumfalk@astro-kom.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/fetch2/npm.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py index 8a179a339..e6d0598f5 100644 --- a/lib/bb/fetch2/npm.py +++ b/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: |