Fix some Windows path issues

- Don't bake modified PATH in to build.ninja; instead set it at run time.
- Add win audio in build.rs, as doing it in run.bat results in it being
added multiple times when you run multiple times.
This commit is contained in:
Damien Elmes 2023-07-02 17:56:31 +10:00
parent dfae9f353a
commit 711c28e1a5
3 changed files with 2 additions and 11 deletions

View File

@ -372,12 +372,6 @@ impl BuildAction for GenTypescriptProto<'_> {
);
build.add_inputs("protoc", inputs![":protoc_binary"]);
build.add_inputs("gen-es", inputs![":node_modules:protoc-gen-es"]);
if cfg!(windows) {
build.add_env_var(
"PATH",
&format!("node_modules/.bin;{}", std::env::var("PATH").unwrap()),
);
}
build.add_inputs_vec("in", proto_files);
build.add_inputs("", inputs!["yarn.lock"]);
build.add_inputs("pyenv_bin", inputs![":pyenv:bin"]);

View File

@ -27,7 +27,7 @@ pub fn run_build(args: BuildArgs) {
let path = if cfg!(windows) {
format!(
"out\\bin;out\\extracted\\node;{};\\msys64\\usr\\bin",
"out\\bin;out\\extracted\\node;node_modules\\.bin;out\\extracted\\win_amd64_audio;{};\\msys64\\usr\\bin",
env::var("PATH").unwrap()
)
} else {
@ -61,7 +61,7 @@ pub fn run_build(args: BuildArgs) {
.arg(&build_file)
.args(ninja_args)
.env("NINJA_STATUS", "[%f/%t; %r active; %es] ")
.env("PATH", path)
.env("PATH", &path)
.env(
"MYPY_CACHE_DIR",
build_root.join("tests").join("mypy").into_string(),

View File

@ -5,9 +5,6 @@ set PYTHONWARNINGS=default
set PYTHONPYCACHEPREFIX=out\pycache
set ANKIDEV=1
REM put mpv on the path
set PATH=%PATH%;out\extracted\win_amd64_audio
call tools\ninja pylib qt extract:win_amd64_audio || exit /b 1
.\out\pyenv\scripts\python tools\run.py %* || exit /b 1
popd