diff --git a/.github/actions/odbc-windows/action.yml b/.github/actions/odbc-windows/action.yml index 8323f364464b..609417331945 100644 --- a/.github/actions/odbc-windows/action.yml +++ b/.github/actions/odbc-windows/action.yml @@ -83,11 +83,15 @@ runs: $(vcpkg fetch nuget | tail -n 1) \ setapikey "${{ inputs.github-token }}" \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" + - name: Find Visual Studio + shell: pwsh + run: | + "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV - name: Build shell: cmd run: | set VCPKG_ROOT_KEEP=%VCPKG_ROOT% - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 set VCPKG_ROOT=%VCPKG_ROOT_KEEP% bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - name: Register Flight SQL ODBC Driver diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 046e95292b04..6da67d1eb63f 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -418,10 +418,15 @@ jobs: path: ${{ steps.ccache-info.outputs.cache-dir }} key: jni-windows + - name: Find Visual Studio + shell: pwsh + run: | + "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV + - name: CMake shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 cmake ^ -S cpp ^ -B cpp.build ^ @@ -432,13 +437,13 @@ jobs: - name: Build shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 cmake --build cpp.build - name: Install shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 cmake --install cpp.build - name: Test @@ -448,7 +453,7 @@ jobs: ARROW_TEST_DATA: ${{ github.workspace }}\testing\data PARQUET_TEST_DATA: ${{ github.workspace }}\cpp\submodules\parquet-testing\data run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 set TZDIR=%MSYS2_LOCATION%\usr\share\zoneinfo set exclude_tests=arrow-acero-asof-join-node-test @@ -465,7 +470,7 @@ jobs: - name: Build example shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 cmake ^ -S cpp/examples/minimal_build ^ @@ -728,7 +733,7 @@ jobs: shell: cmd run: | set VCPKG_ROOT_KEEP=%VCPKG_ROOT% - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 set VCPKG_ROOT=%VCPKG_ROOT_KEEP% # Convert VCPKG Windows path to MSYS path for /f "usebackq delims=" %%I in (`bash -c "cygpath -u \"$VCPKG_ROOT_KEEP\""` ) do set VCPKG_ROOT=%%I diff --git a/.github/workflows/cpp_windows.yml b/.github/workflows/cpp_windows.yml index a91656f35787..17c9debb2962 100644 --- a/.github/workflows/cpp_windows.yml +++ b/.github/workflows/cpp_windows.yml @@ -115,12 +115,16 @@ jobs: with: path: ${{ steps.ccache-info.outputs.cache-dir }} key: cpp-ccache-windows-${{ inputs.arch }} + - name: Find Visual Studio + shell: pwsh + run: | + "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV - name: Build shell: cmd env: VCVARS_ARCH: ${{ inputs.arch }} run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %VCVARS_ARCH% + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %VCVARS_ARCH% || exit /b 1 bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - name: Save ccache if: ${{ !cancelled() }} @@ -135,7 +139,7 @@ jobs: VCVARS_ARCH: ${{ inputs.arch }} MSYS2_LOCATION: ${{ steps.setup-msys2.outputs.msys2-location }} run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %VCVARS_ARCH% + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" %VCVARS_ARCH% || exit /b 1 # For ORC set TZDIR=%MSYS2_LOCATION%\usr\share\zoneinfo bash -c "ci/scripts/cpp_test.sh $(pwd) $(pwd)/build" diff --git a/.github/workflows/matlab.yml b/.github/workflows/matlab.yml index 60914eae7ce2..da36b83bbec9 100644 --- a/.github/workflows/matlab.yml +++ b/.github/workflows/matlab.yml @@ -167,10 +167,14 @@ jobs: ${{ steps.ccache-info.outputs.cache-dir }} key: matlab-ccache-windows-${{ hashFiles('cpp/**', 'matlab/**', '!matlab/build/**') }} restore-keys: matlab-ccache-windows- + - name: Find Visual Studio + shell: pwsh + run: | + "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV - name: Build MATLAB Interface shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 bash -c "ci/scripts/matlab_build.sh $(pwd)" - name: Run MATLAB Tests env: diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 9df6cf694b93..7feb8296a318 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -450,18 +450,22 @@ jobs: $(vcpkg fetch nuget | tail -n 1) \ setapikey "${{ secrets.GITHUB_TOKEN }}" \ -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" + - name: Find Visual Studio + shell: pwsh + run: | + "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV - name: Build C++ shell: cmd run: | set VCPKG_ROOT_KEEP=%VCPKG_ROOT% - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 set VCPKG_ROOT=%VCPKG_ROOT_KEEP% bash -c "ci/scripts/cpp_build.sh $(pwd) $(pwd)/build" - name: Build GLib shell: cmd run: | set VCPKG_ROOT_KEEP=%VCPKG_ROOT% - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 set VCPKG_ROOT=%VCPKG_ROOT_KEEP% bash -c "ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build" - name: Save ccache diff --git a/ci/scripts/python_build.bat b/ci/scripts/python_build.bat index 536901e3af13..255b44486ede 100644 --- a/ci/scripts/python_build.bat +++ b/ci/scripts/python_build.bat @@ -30,9 +30,9 @@ py -0p %PYTHON_CMD% -m sysconfig || exit /B 1 -@REM Setup MSVC environment - -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 +@REM Setup MSVC environment. Find the Visual Studio Path first. +for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "VS_INSTALL_PATH=%%i" +call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /B 1 @echo on echo "=== CCACHE Stats before build ===" diff --git a/dev/release/verify-release-candidate.bat b/dev/release/verify-release-candidate.bat index e3e9e800e80a..add36194f03e 100644 --- a/dev/release/verify-release-candidate.bat +++ b/dev/release/verify-release-candidate.bat @@ -84,8 +84,9 @@ set PATH=%INSTALL_DIR%\bin;%PATH% mkdir !ARROW_SOURCE!\cpp\build pushd !ARROW_SOURCE!\cpp\build -@rem This is the path for Visual Studio Community 2017 -call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 +@REM Setup MSVC environment. Find the Visual Studio Path first. +for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "VS_INSTALL_PATH=%%i" +call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /B 1 @rem NOTE(wesm): not using Ninja for now to be able to more easily control the @rem generator used @@ -116,7 +117,7 @@ cmake -G "%GENERATOR%" ^ -DCMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library ^ -DCMAKE_UNITY_BUILD=ON ^ -DPARQUET_REQUIRE_ENCRYPTION=ON ^ - .. || exit /B + .. || exit /B 1 cmake --build . --target INSTALL --config Release || exit /B 1 diff --git a/dev/tasks/matlab/github.yml b/dev/tasks/matlab/github.yml index d2a0b0a0bc0b..89ccc8e47f5c 100644 --- a/dev/tasks/matlab/github.yml +++ b/dev/tasks/matlab/github.yml @@ -111,12 +111,16 @@ jobs: shell: bash run: arrow/ci/scripts/install_sccache.sh pc-windows-msvc $(pwd)/sccache {{ macros.github_configure_aws_credentials()|indent }} + - name: Find Visual Studio + shell: pwsh + run: | + "VS_INSTALL_PATH=$(vswhere -latest -property installationPath)" >> $env:GITHUB_ENV - name: Build MATLAB Interface shell: cmd env: {{ macros.github_set_sccache_envvars()|indent(8) }} run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + call "%VS_INSTALL_PATH%\VC\Auxiliary\Build\vcvarsall.bat" x64 || exit /b 1 bash -c "arrow/ci/scripts/matlab_build.sh $(pwd)/arrow" - name: Compress into single artifact shell: bash