build.run: use correct working directory in BuildPlan.execute_local.

This regression was introduced in commit 3200a3961. Fixes #1020.
This commit is contained in:
Catherine 2024-01-09 15:45:31 +00:00
parent e59e2aa715
commit 4e1b2451ec

View file

@ -112,18 +112,16 @@ class BuildPlan:
# See https://stackoverflow.com/a/30736987 for a detailed explanation of why.
# Running the script manually from a command prompt is unaffected.
subprocess.check_call(["cmd", "/c", f"call {self.script}.bat"],
env=os.environ if env is None else env)
cwd=build_dir, env=os.environ if env is None else env)
else:
subprocess.check_call(["sh", f"{self.script}.sh"],
env=os.environ if env is None else env)
cwd=build_dir, env=os.environ if env is None else env)
# TODO(amaranth-0.5): remove
if run_script is not None:
warnings.warn("The `run_script` argument is deprecated. If you only want to "
"extract the files from the BuildPlan, use the .extract() method",
DeprecationWarning, stacklevel=2)
return LocalBuildProducts(build_dir)