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:24 +0100 |
commit | 34004afb65cd5c677b8e2c944144eeb91d86abfd (patch) | |
tree | 8b14ea0aa9af9de7b69f41c27174dbc0c91f19f3 | |
parent | 695998f921b691f196825e9067b6db399d691e53 (diff) | |
download | poky-34004afb65cd5c677b8e2c944144eeb91d86abfd.tar.gz |
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 <a.baumfalk@astro-kom.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/fetch2/npm.py | 1 |
1 files changed, 1 insertions, 0 deletions
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): | |||
103 | """Run npm command in a controlled environment""" | 103 | """Run npm command in a controlled environment""" |
104 | with tempfile.TemporaryDirectory() as tmpdir: | 104 | with tempfile.TemporaryDirectory() as tmpdir: |
105 | d = bb.data.createCopy(self.d) | 105 | d = bb.data.createCopy(self.d) |
106 | d.setVar("PATH", d.getVar("PATH")) # PATH might contain $HOME - evaluate it before patching | ||
106 | d.setVar("HOME", tmpdir) | 107 | d.setVar("HOME", tmpdir) |
107 | 108 | ||
108 | if not workdir: | 109 | if not workdir: |