This is an automated email from the ASF dual-hosted git repository.

hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-rust-diesel-adapter.git


The following commit(s) were added to refs/heads/master by this push:
     new facff67  fix(ci): locate MSVC via vswhere instead of hardcoded VS 2022 
path
facff67 is described below

commit facff671151868905c03632270597de7306fecdf
Author: Yang Luo <[email protected]>
AuthorDate: Thu Aug 6 23:44:10 2026 +0800

    fix(ci): locate MSVC via vswhere instead of hardcoded VS 2022 path
---
 .github/workflows/ci.yml | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d609877..d505364 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -57,13 +57,15 @@ jobs:
           "C:\Program Files\PostgreSQL\11\bin\psql" -d casbin -c "GRANT CREATE 
ON SCHEMA public TO casbin_rs;"
           "C:\tools\mysql\current\bin\mysql" -e "create user 
'casbin_rs'@'localhost' identified by 'casbin_rs'; create database casbin; 
grant all on `casbin`.* to 'casbin_rs'@'localhost';" -uroot
           cd /D C:\ProgramData\chocolatey\lib\SQLite\tools
-          dir "C:\Program Files\Microsoft Visual Studio"
-          dir "C:\Program Files\Microsoft Visual Studio\2022"
-          dir "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
-          dir "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC"
-          dir "C:\Program Files\Microsoft Visual 
Studio\2022\Enterprise\VC\Auxiliary"
-          dir "C:\Program Files\Microsoft Visual 
Studio\2022\Enterprise\VC\Auxiliary\Build"
-          call "C:\Program Files\Microsoft Visual 
Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
+          set "VSWHERE=C:\Program Files (x86)\Microsoft Visual 
Studio\Installer\vswhere.exe"
+          for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * 
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property 
installationPath`) do set "VSINSTALL=%%i"
+          if not defined VSINSTALL for /f "usebackq tokens=*" %%i in 
(`"%VSWHERE%" -latest -products * -property installationPath`) do set 
"VSINSTALL=%%i"
+          if not defined VSINSTALL (
+            echo Could not locate a Visual Studio installation with the MSVC 
toolset
+            exit /b 1
+          )
+          echo Using Visual Studio at "%VSINSTALL%"
+          call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" || exit /b 1
           lib /machine:x64 /def:sqlite3.def /out:sqlite3.lib
 
       - name: Set environment variables (for windows)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to