From 896d11546bed6635daba4f2a2727be35628da1b1 Mon Sep 17 00:00:00 2001 From: Abdo Date: Fri, 5 Nov 2021 04:08:23 +0300 Subject: [PATCH] Fix invalid path in cargo-env.bat (#1477) * Fix invalid path in cargo-env.bat * Assume cargo-env.bat is run from repo root; fix package script (dae) * mention cargo-raze doesn't work on Windows (dae) --- cargo/README.md | 4 ++++ qt/package/build.bat | 4 ++-- scripts/cargo-env.bat | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cargo/README.md b/cargo/README.md index 8809de386..caa9027ed 100644 --- a/cargo/README.md +++ b/cargo/README.md @@ -12,6 +12,10 @@ After updating dependencies in ../rslib/Cargo.toml, change to this folder and run python update.py to update the external Bazel repositories to point to the updated deps. +Note: cargo-raze does not currently work when run from Windows, and nobody +has investigated why yet. For now, you'll need a Mac or Linux machine, or +will need to run update.py from within WSL. + A couple of crates need extra work to build with Bazel, and are listed in ../Cargo.toml. For example: diff --git a/qt/package/build.bat b/qt/package/build.bat index 4320c8053..78c3ca4c2 100755 --- a/qt/package/build.bat +++ b/qt/package/build.bat @@ -1,6 +1,7 @@ -:: ensure wheels are built +:: ensure wheels are built and set up Rust env pushd ..\.. call scripts\build || exit /b +call scripts\cargo-env set ROOT=%CD% popd @@ -16,6 +17,5 @@ if not exist %VENV% ( :: run the rest of the build in Python FOR /F "tokens=*" %%g IN ('call ..\..\bazel.bat info output_base --ui_event_filters=-INFO') do (SET BAZEL_EXTERNAL=%%g/external) -call %ROOT%\scripts\cargo-env call ..\..\bazel.bat query @pyqt515//:* %VENV%\scripts\python build.py %ROOT% %BAZEL_EXTERNAL% || exit /b diff --git a/scripts/cargo-env.bat b/scripts/cargo-env.bat index 51f6b2c06..0ca775e93 100644 --- a/scripts/cargo-env.bat +++ b/scripts/cargo-env.bat @@ -1,2 +1,4 @@ -FOR /F "tokens=*" %%g IN ('call ..\..\bazel.bat info output_base --ui_event_filters=-INFO') do (SET BAZEL_EXTERNAL=%%g/external) +rem Run this from the repo root folder + +FOR /F "tokens=*" %%g IN ('call bazel.bat info output_base --ui_event_filters=-INFO') do (SET BAZEL_EXTERNAL=%%g/external) set PATH=%BAZEL_EXTERNAL%\rust_windows_x86_64\bin;%PATH%