From a65b2b22e507f5f593532da6ac62d01ce1829903 Mon Sep 17 00:00:00 2001 From: Vladimir Gladkov Date: Thu, 1 Aug 2024 17:02:05 +0300 Subject: [PATCH] [ci] use wget for file download on windows --- ci/github-actions/install-windows.bat | 72 ++++++++++++++------------- ci/github-actions/set-env.bat | 4 +- 2 files changed, 41 insertions(+), 35 deletions(-) diff --git a/ci/github-actions/install-windows.bat b/ci/github-actions/install-windows.bat index b1d9191fb..e68452c2d 100644 --- a/ci/github-actions/install-windows.bat +++ b/ci/github-actions/install-windows.bat @@ -16,82 +16,86 @@ set DOWNLOAD_DIR_CMAKE=%DOWNLOAD_DIR:\=/% :: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +:: wget + +echo Installing wget... + +choco install wget --no-progress +if %errorlevel% neq 0 exit /b %errorlevel% + +:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + :: Ragel -echo Downloading Ragel %RAGEL_DOWNLOAD_URL%... +echo Downloading %RAGEL_DOWNLOAD_URL%... mkdir %DOWNLOAD_DIR% -powershell "Invoke-WebRequest -Uri %RAGEL_DOWNLOAD_URL% -OutFile %DOWNLOAD_DIR%\ragel.exe" -if %errorlevel% neq 0 eit /b %errorlevel% +wget -nv %RAGEL_DOWNLOAD_URL% -O %DOWNLOAD_DIR%\ragel.exe +if %errorlevel% neq 0 exit /b %errorlevel% -echo set (RAGEL_EXE %DOWNLOAD_DIR_CMAKE%/ragel.exe) >> paths.cmake +echo set(RAGEL_EXE %DOWNLOAD_DIR_CMAKE%/ragel.exe) >> paths.cmake :: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . :: Lua (CMake-based) -echo Downloading Lua %LUA_DOWNLOAD_URL%... +echo Downloading %LUA_DOWNLOAD_URL%... mkdir %DOWNLOAD_DIR%\lua -powershell "Invoke-WebRequest -Uri %LUA_DOWNLOAD_URL% -OutFile %DOWNLOAD_DIR%\lua\lua.zip" -if %errorlevel% neq 0 eit /b %errorlevel% +wget -nv %LUA_DOWNLOAD_URL% -O %DOWNLOAD_DIR%\lua\lua.zip +if %errorlevel% neq 0 exit /b %errorlevel% 7z x -y %DOWNLOAD_DIR%\lua\lua.zip -if %errorlevel% neq 0 eit /b %errorlevel% +if %errorlevel% neq 0 exit /b %errorlevel% ren Lua-%LUA_VERSION% lua -if %errorlevel% neq 0 eit /b %errorlevel% +if %errorlevel% neq 0 exit /b %errorlevel% :: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . :: OpenSSL -echo Installing OpenSSL... +echo Installing OpenSSL %OPENSSL_VERSION%... -choco install openssl --version=1.1.1.2000 --no-progress -- %CHOCO_PLATFORM% -if %errorlevel% neq 0 eit /b %errorlevel% +choco install openssl --version=%OPENSSL_VERSION% --no-progress -- %CHOCO_PLATFORM% +if %errorlevel% neq 0 exit /b %errorlevel% set OPENSSL_ROOT_DIR=C:/Program Files%PROGRAM_FILES_DIR_SUFFIX%/OpenSSL%OPENSSL_DIR_SUFFIX% -echo set (OPENSSL_INC_DIR "%OPENSSL_ROOT_DIR%/include") >> paths.cmake -echo set (OPENSSL_LIB_DIR "%OPENSSL_ROOT_DIR%/lib") >> paths.cmake -echo set (OPENSSL_DLL_DIR "%OPENSSL_ROOT_DIR%/bin") >> paths.cmake -echo set (OPENSSL_CRYPTO_LIB_NAME libcrypto) >> paths.cmake -echo set (OPENSSL_CRYPTO_DLL_NAME libcrypto%OPENSSL_DLL_SUFFIX%) >> paths.cmake -echo set (OPENSSL_SSL_LIB_NAME libssl) >> paths.cmake -echo set (OPENSSL_SSL_DLL_NAME libssl%OPENSSL_DLL_SUFFIX%) >> paths.cmake +echo set(OPENSSL_INC_DIR "%OPENSSL_ROOT_DIR%/include") >> paths.cmake +echo set(OPENSSL_LIB_DIR "%OPENSSL_ROOT_DIR%/lib") >> paths.cmake +echo set(OPENSSL_DLL_DIR "%OPENSSL_ROOT_DIR%/bin") >> paths.cmake +echo set(OPENSSL_CRYPTO_LIB_NAME libcrypto) >> paths.cmake +echo set(OPENSSL_CRYPTO_DLL_NAME libcrypto%OPENSSL_DLL_SUFFIX%) >> paths.cmake +echo set(OPENSSL_SSL_LIB_NAME libssl) >> paths.cmake +echo set(OPENSSL_SSL_DLL_NAME libssl%OPENSSL_DLL_SUFFIX%) >> paths.cmake :: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . :: LLVM -echo Downloading LLVM %LLVM_DOWNLOAD_URL%... - -powershell "Invoke-WebRequest -Uri %LLVM_DOWNLOAD_URL% -OutFile %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%" -if %errorlevel% neq 0 eit /b %errorlevel% +echo Downloading %LLVM_DOWNLOAD_URL%... -dir "%DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%" - -echo Extracting %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%... +wget -nv %LLVM_DOWNLOAD_URL% -O %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE% +if %errorlevel% neq 0 exit /b %errorlevel% 7z x -y %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE% -o%DOWNLOAD_DIR% -if %errorlevel% neq 0 eit /b %errorlevel% - -echo Done extracting +if %errorlevel% neq 0 exit /b %errorlevel% ren %DOWNLOAD_DIR%\%LLVM_RELEASE_NAME% llvm +if %errorlevel% neq 0 exit /b %errorlevel% perl %COMPARE_VERSIONS_PL% %LLVM_VERSION% 3.5 if %errorlevel% == -1 goto llvm34x -echo set (LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib/cmake/llvm) >> paths.cmake +echo set(LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib/cmake/llvm) >> paths.cmake goto :eof :llvm34x -echo set (LLVM_INC_DIR %DOWNLOAD_DIR_CMAKE%/llvm/include) >> paths.cmake -echo set (LLVM_LIB_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib) >> paths.cmake -echo set (LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/share/llvm/cmake) >> paths.cmake -echo set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) >> paths.cmake +echo set(LLVM_INC_DIR %DOWNLOAD_DIR_CMAKE%/llvm/include) >> paths.cmake +echo set(LLVM_LIB_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib) >> paths.cmake +echo set(LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/share/llvm/cmake) >> paths.cmake +echo set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) >> paths.cmake ::.............................................................................. diff --git a/ci/github-actions/set-env.bat b/ci/github-actions/set-env.bat index 313dc4078..ded5753fc 100644 --- a/ci/github-actions/set-env.bat +++ b/ci/github-actions/set-env.bat @@ -110,6 +110,8 @@ set LLVM_DOWNLOAD_URL=https://github.com/vovkos/llvm-package-windows/releases/do set LUA_VERSION=5.4.5 set LUA_DOWNLOAD_URL=https://github.com/walterschell/Lua/archive/refs/tags/v%LUA_VERSION%.zip +set OPENSSL_VERSION=1.1.1.2100 + set RAGEL_DOWNLOAD_URL=https://github.com/eloraiby/ragel-windows/raw/master/ragel.exe set CMAKE_CONFIGURE_FLAGS=-G "%CMAKE_GENERATOR%" %CMAKE_OPTIONS% @@ -124,7 +126,7 @@ set CMAKE_BUILD_FLAGS= ^ echo --------------------------------------------------------------------------- echo LLVM_VERSION: %LLVM_VERSION% echo LLVM_DOWNLOAD_URL: %LLVM_DOWNLOAD_URL% -echo LUA_LIB_NAME: %LUA_LIB_NAME% echo LUA_DOWNLOAD_URL: %LUA_DOWNLOAD_URL% +echo OPENSSL_VERSION: %OPENSSL_VERSION% echo RAGEL_DOWNLOAD_URL: %RAGEL_DOWNLOAD_URL% echo ---------------------------------------------------------------------------