Skip to content

Commit

Permalink
Inject the current Python bin path into make invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Nov 11, 2024
1 parent 78d733b commit 082a3f3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/build_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from __future__ import annotations

import os
import re
import ast
import sys
Expand Down Expand Up @@ -169,9 +170,9 @@ def load_toolchains(paths: list[pathlib.Path]) -> dict[pathlib.Path, str]:
return toolchains


def subprocess_run_verbose(command: list[str], prefix: str) -> None:
def subprocess_run_verbose(command: list[str], prefix: str, **kwargs) -> None:
with subprocess.Popen(
command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs
) as proc:
for line in proc.stdout:
LOGGER.info("[%s] %r", prefix, line.decode("utf-8").strip())
Expand Down Expand Up @@ -543,7 +544,10 @@ def main():
f"POST_BUILD_EXE={args.postbuild}",
"VERBOSE=1",
],
"make"
"make",
env={
"PATH": f"{pathlib.Path(sys.executable).parent}:{os.environ['PATH']}"
}
)
# fmt: on

Expand Down

0 comments on commit 082a3f3

Please sign in to comment.