prereq-build: fix inconsistent value of $PATH
authorMichael Pratt <mcpratt@pm.me>
Thu, 25 May 2023 06:31:52 +0000 (02:31 -0400)
committerPetr Štetiar <ynezz@true.cz>
Mon, 12 Jun 2023 20:10:21 +0000 (22:10 +0200)
commitc7bd7a9c5143f25dc6137439794fdf075c6cc424
tree8e178af7ba5e1a3743e250c2b29f83589357c469
parent948dc515dc5afca45a233471535e7c463866c9a9
prereq-build: fix inconsistent value of $PATH

In the recipe SetupHostCommand for checking
and creating symlinks, $PATH was only overridden
for one of several commands.

This causes the symlinks to be included
in the paths to pick a program from
when the check was repeated, because
staging_dir/host/bin was included in $PATH,
but only *sometimes*.

When the check ran again, the command succeded
with a $PATH including the symlink,
(eval "$$$$$$$$cmd")
while the path to the program was evaluated
with a $PATH NOT including the symlink,
(bin=...)
causing the symlink to be relinked incorrectly,
instead of passing as exactly the same.

Coincidentally, this was only a problem
if the symlink targeted the alternative
program with a different name.

By overriding the value of $PATH at the invocation of Make,
it will apply to the entire environment of the checks.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 665fe2f818300f0b84c8c458fc49ae58ff8853aa)
include/prereq.mk