<commit_before>@rem Find vswhere tool.
@set toolchain=msvc
@set vsabi=%abi%
@IF /I %PROCESSOR_ARCHITECTURE%==AMD64 IF %abi%==x86 set vsabi=x64_x86
@IF /I %PROCESSOR_ARCHITECTURE%==x86 IF %abi%==x64 set vsabi=x86_x64
@set vswhere="%ProgramFiles%
@IF /I %PROCESSOR_ARCHITECTURE%==AMD64 set vswhere=%vswhere% (x86)
@set vswhere=%vswhere%\Microsoft Visual Studio\Installer\vswhere.exe"

:findcompilers
@set vsenv=null
@set toolset=0
@setlocal ENABLEDELAYEDEXPANSION
@set totaltoolchains=0
@set totalmsvc=0
@IF EXIST %vswhere% for /F "USEBACKQ tokens=*" %%a IN (`%vswhere% -prerelease -property catalog_productDisplayVersion`) do @set /a totalmsvc+=1&set /a totaltoolchains+=1&set msvcversions[!totalmsvc!]=%%a
@IF NOT %msysstate%==0 set /a totaltoolchains+=1
@set msvccount=0
@IF EXIST %vswhere% for /F "USEBACKQ tokens=*" %%a IN (`%vswhere% -prerelease -property displayName`) do @set /a msvccount+=1&set msvcnames[!msvccount!]=%%a
@cls
@IF %totalmsvc% GTR 0 FOR /L %%a IN (1,1,%totalmsvc%) do @echo %%a.!msvcnames[%%a]! v!msvcversions[%%a]!
@IF NOT %msysstate%==0 echo %totaltoolchains%. MSYS2 Mingw-w64 GCC
@echo.
@IF %totaltoolchains%==0 (
@echo Error: No compiler found. Cannot continue.
@echo.
@pause
@exit
)

@rem Select compiler
@set selecttoolchain=0
@set /p selecttoolchain=Select compiler:
@echo.
@IF "%selecttoolchain%"=="%totaltoolchains%" IF NOT %msysstate%==0 (
@set toolchain=gcc
@GOTO selectedgcc
)
@IF "%selecttoolchain%"=="" (
@echo Invalid entry
@pause
@endlocal
@GOTO findcompilers
)
@IF %selecttoolchain% LEQ 0 (
@echo Invalid entry
@pause
@endlocal
@GOTO findcompilers
)
@IF %selecttoolchain% GTR %totaltoolchains% (
@echo Invalid entry
@pause
@endlocal
@GOTO findcompilers
)

@rem Determine version and build enviroment launcher PATH for selected Visual Studio installation
@set msvccount=0
@for /F "USEBACKQ tokens=*" %%a IN (`%vswhere% -prerelease -property installationPath`) do @set /a msvccount+=1&IF !msvccount!==%selecttoolchain% set vsenv="%%a\VC\Auxiliary\Build\vcvarsall.bat"
@FOR /L %%a IN (1,1,%totalmsvc%) do @IF "%%a"=="%selecttoolchain%" set msvcname=!msvcnames[%%a]!&IF "%%a"=="%selecttoolchain%" set msvcver=!msvcversions[%%a]!

:novcpp
@IF NOT EXIST %vsenv% echo Error: Selected Visual Studio installation lacks Desktop development with C++ workload necessary to build Mesa3D.
@IF NOT EXIST %vsenv% set /p addvcpp=Add Desktop development with C++ workload - y/n:
@IF NOT EXIST %vsenv% echo.
@IF NOT EXIST %vsenv% IF /I NOT "%addvcpp%"=="y" pause
@IF NOT EXIST %vsenv% IF /I NOT "%addvcpp%"=="y" GOTO findcompilers
@IF NOT EXIST %vsenv% %vswhere:~0,-12%vs_installer.exe"
@IF NOT EXIST %vsenv% GOTO findcompilers

:selectedmsvc
@set TITLE=%TITLE% using Visual Studio
@endlocal&set vsenv=%vsenv%&set msvcver=%msvcver%&set msvcname=%msvcname%&set toolchain=%toolchain%&set TITLE=%TITLE%
@set toolset=%msvcver:~0,2%
@GOTO selectedcompiler

:selectedgcc
@set TITLE=%TITLE% using MSYS2 Mingw-w64 GCC
@endlocal&set toolchain=%toolchain%&set TITLE=%TITLE%

:selectedcompiler
@TITLE %TITLE%<commit_msg>Fix a regression introduceed in last commit. Steps for issue reproducing: - select a Visual Studio installation lacking MSVC workload; - allow or deny MSVC workload installation; - select MSYS2 toolchain.<commit_after>@rem Find vswhere tool.
@set toolchain=msvc
@set vsabi=%abi%
@IF /I %PROCESSOR_ARCHITECTURE%==AMD64 IF %abi%==x86 set vsabi=x64_x86
@IF /I %PROCESSOR_ARCHITECTURE%==x86 IF %abi%==x64 set vsabi=x86_x64
@set vswhere="%ProgramFiles%
@IF /I %PROCESSOR_ARCHITECTURE%==AMD64 set vswhere=%vswhere% (x86)
@set vswhere=%vswhere%\Microsoft Visual Studio\Installer\vswhere.exe"

:findcompilers
@set vsenv=null
@set toolset=0
@setlocal ENABLEDELAYEDEXPANSION
@set totaltoolchains=0
@set totalmsvc=0
@IF EXIST %vswhere% for /F "USEBACKQ tokens=*" %%a IN (`%vswhere% -prerelease -property catalog_productDisplayVersion`) do @set /a totalmsvc+=1&set /a totaltoolchains+=1&set msvcversions[!totalmsvc!]=%%a
@IF NOT %msysstate%==0 set /a totaltoolchains+=1
@set msvccount=0
@IF EXIST %vswhere% for /F "USEBACKQ tokens=*" %%a IN (`%vswhere% -prerelease -property displayName`) do @set /a msvccount+=1&set msvcnames[!msvccount!]=%%a
@cls
@IF %totalmsvc% GTR 0 FOR /L %%a IN (1,1,%totalmsvc%) do @echo %%a.!msvcnames[%%a]! v!msvcversions[%%a]!
@IF NOT %msysstate%==0 echo %totaltoolchains%. MSYS2 Mingw-w64 GCC
@echo.
@IF %totaltoolchains%==0 (
@echo Error: No compiler found. Cannot continue.
@echo.
@pause
@exit
)

@rem Select compiler
@set selecttoolchain=0
@set /p selecttoolchain=Select compiler:
@echo.
@IF "%selecttoolchain%"=="%totaltoolchains%" IF NOT %msysstate%==0 (
@set toolchain=gcc
@GOTO selectedgcc
)
@IF "%selecttoolchain%"=="" (
@echo Invalid entry
@pause
@endlocal
@GOTO findcompilers
)
@IF %selecttoolchain% LEQ 0 (
@echo Invalid entry
@pause
@endlocal
@GOTO findcompilers
)
@IF %selecttoolchain% GTR %totaltoolchains% (
@echo Invalid entry
@pause
@endlocal
@GOTO findcompilers
)

@rem Determine version and build enviroment launcher PATH for selected Visual Studio installation
@set msvccount=0
@for /F "USEBACKQ tokens=*" %%a IN (`%vswhere% -prerelease -property installationPath`) do @set /a msvccount+=1&IF !msvccount!==%selecttoolchain% set vsenv="%%a\VC\Auxiliary\Build\vcvarsall.bat"
@FOR /L %%a IN (1,1,%totalmsvc%) do @IF "%%a"=="%selecttoolchain%" set msvcname=!msvcnames[%%a]!&IF "%%a"=="%selecttoolchain%" set msvcver=!msvcversions[%%a]!

:novcpp
@IF NOT EXIST %vsenv% echo Error: Selected Visual Studio installation lacks Desktop development with C++ workload necessary to build Mesa3D.
@IF NOT EXIST %vsenv% set /p addvcpp=Add Desktop development with C++ workload - y/n:
@IF NOT EXIST %vsenv% echo.
@IF NOT EXIST %vsenv% IF /I NOT "%addvcpp%"=="y" pause
@IF NOT EXIST %vsenv% IF /I NOT "%addvcpp%"=="y" endlocal
@IF NOT EXIST %vsenv% IF /I NOT "%addvcpp%"=="y" GOTO findcompilers
@IF NOT EXIST %vsenv% %vswhere:~0,-12%vs_installer.exe"
@IF NOT EXIST %vsenv% endlocal
@IF NOT EXIST %vsenv% GOTO findcompilers

:selectedmsvc
@set TITLE=%TITLE% using Visual Studio
@endlocal&set vsenv=%vsenv%&set msvcver=%msvcver%&set msvcname=%msvcname%&set toolchain=%toolchain%&set TITLE=%TITLE%
@set toolset=%msvcver:~0,2%
@GOTO selectedcompiler

:selectedgcc
@set TITLE=%TITLE% using MSYS2 Mingw-w64 GCC
@endlocal&set toolchain=%toolchain%&set TITLE=%TITLE%

:selectedcompiler
@TITLE %TITLE%
{'fraction_non_alphanumeric': 0.14873817034700315, 'fraction_numerical': 0.016876971608832808, 'mean_word_length': 6.742368742368742, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5543172', 'n_tokens_mistral': 2546, 'n_tokens_neox': 2433, 'n_words': 680}