From 4969176ec9224ea63499f9e6ef0ad92bee2104ea Mon Sep 17 00:00:00 2001 From: neodix42 Date: Tue, 12 Mar 2024 17:11:42 +0100 Subject: [PATCH] Improve windows build (#921) * fix windows build * exclude test-bigint execution on windows --------- Co-authored-by: My Name --- assembly/cicd/jenkins/test-builds.groovy | 2 +- assembly/native/build-windows.bat | 54 ++++++++++++++---------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/assembly/cicd/jenkins/test-builds.groovy b/assembly/cicd/jenkins/test-builds.groovy index 960ac8db7..7e377f0e8 100644 --- a/assembly/cicd/jenkins/test-builds.groovy +++ b/assembly/cicd/jenkins/test-builds.groovy @@ -182,7 +182,7 @@ pipeline { timeout(time: 90, unit: 'MINUTES') { bat ''' copy assembly\\native\\build-windows.bat . - build-windows.bat + build-windows.bat -t ''' bat ''' cd artifacts diff --git a/assembly/native/build-windows.bat b/assembly/native/build-windows.bat index 2e3f20824..2c64e80a5 100644 --- a/assembly/native/build-windows.bat +++ b/assembly/native/build-windows.bat @@ -14,24 +14,26 @@ choco feature enable -n allowEmptyChecksums echo Installing pkgconfiglite... choco install -y pkgconfiglite -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't install pkgconfiglite exit /b %errorlevel% ) echo Installing ninja... choco install -y ninja -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't install ninja exit /b %errorlevel% ) if not exist "zlib" ( git clone https://github.com/madler/zlib.git -cd zlib\contrib\vstudio\vc14 +cd zlib +git checkout v1.3.1 +cd contrib\vstudio\vc14 msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v143 -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't install zlib exit /b %errorlevel% ) @@ -41,14 +43,20 @@ echo Using zlib... ) if not exist "secp256k1" ( -git clone https://github.com/libbitcoin/secp256k1.git -cd secp256k1\builds\msvc\vs2017 -msbuild /p:Configuration=StaticRelease -p:PlatformToolset=v143 -p:Platform=x64 -IF errorlevel 1 ( +git clone https://github.com/bitcoin-core/secp256k1.git +cd secp256k1 +git checkout v0.3.2 +cmake -G "Visual Studio 17 2022" -A x64 -S . -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DBUILD_SHARED_LIBS=OFF +IF %errorlevel% NEQ 0 ( + echo Can't configure secp256k1 + exit /b %errorlevel% +) +cmake --build build --config Release +IF %errorlevel% NEQ 0 ( echo Can't install secp256k1 exit /b %errorlevel% ) -cd ..\..\..\.. +cd .. ) else ( echo Using secp256k1... ) @@ -56,7 +64,7 @@ echo Using secp256k1... if not exist "libsodium" ( curl -Lo libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't download libsodium exit /b %errorlevel% ) @@ -67,7 +75,7 @@ echo Using libsodium... if not exist "openssl-3.1.4" ( curl -Lo openssl-3.1.4.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/openssl-3.1.4.zip -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't download OpenSSL exit /b %errorlevel% ) @@ -78,7 +86,7 @@ echo Using openssl... if not exist "libmicrohttpd-0.9.77-w32-bin" ( curl -Lo libmicrohttpd-0.9.77-w32-bin.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/libmicrohttpd-0.9.77-w32-bin.zip -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't download libmicrohttpd exit /b %errorlevel% ) @@ -89,7 +97,7 @@ echo Using libmicrohttpd... if not exist "readline-5.0-1-lib" ( curl -Lo readline-5.0-1-lib.zip https://github.com/neodiX42/precompiled-openssl-win64/raw/main/readline-5.0-1-lib.zip -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't download readline exit /b %errorlevel% ) @@ -110,7 +118,7 @@ cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^ -DSODIUM_USE_STATIC_LIBS=1 ^ -DSECP256K1_FOUND=1 ^ -DSECP256K1_INCLUDE_DIR=%root%\secp256k1\include ^ --DSECP256K1_LIBRARY=%root%\secp256k1\bin\x64\Release\v143\static\secp256k1.lib ^ +-DSECP256K1_LIBRARY=%root%\secp256k1\build\src\Release\libsecp256k1.lib ^ -DMHD_FOUND=1 ^ -DMHD_LIBRARY=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static\libmicrohttpd.lib ^ -DMHD_INCLUDE_DIR=%root%\libmicrohttpd-0.9.77-w32-bin\x86_64\VS2019\Release-static ^ @@ -118,10 +126,12 @@ cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^ -DZLIB_INCLUDE_DIR=%root%\zlib ^ -DZLIB_LIBRARIES=%root%\zlib\contrib\vstudio\vc14\x64\ZlibStatReleaseWithoutAsm\zlibstat.lib ^ -DOPENSSL_FOUND=1 ^ --DOPENSSL_INCLUDE_DIR=%root%/openssl-3.1.4/x64/include ^ --DOPENSSL_CRYPTO_LIBRARY=%root%/openssl-3.1.4/x64/lib/libcrypto_static.lib ^ +-DOPENSSL_INCLUDE_DIR=%root%\openssl-3.1.4\x64\include ^ +-DOPENSSL_CRYPTO_LIBRARY=%root%\openssl-3.1.4\x64\lib\libcrypto_static.lib ^ +-DREADLINE_INCLUDE_DIR=%root%\readline-5.0-1-lib\include ^ +-DREADLINE_LIBRARY=%root%\readline-5.0-1-lib\lib\readline.lib ^ -DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" .. -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't configure TON exit /b %errorlevel% ) @@ -133,7 +143,7 @@ json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-ha test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont test-net ^ test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^ test-fec test-tddb test-db test-validator-session-state -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't compile TON exit /b %errorlevel% ) @@ -141,14 +151,14 @@ IF errorlevel 1 ( ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tonlib tonlibjson ^ tonlib-cli validator-engine lite-client pow-miner validator-engine-console generate-random-id ^ json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo Can't compile TON exit /b %errorlevel% ) ) copy validator-engine\validator-engine.exe test -IF errorlevel 1 ( +IF %errorlevel% NEQ 0 ( echo validator-engine.exe does not exist exit /b %errorlevel% ) @@ -156,8 +166,8 @@ IF errorlevel 1 ( IF "%1"=="-t" ( echo Running tests... REM ctest -C Release --output-on-failure -E "test-catchain|test-actors|test-validator-session-state" - ctest -C Release --output-on-failure --timeout 1800 - IF errorlevel 1 ( + ctest -C Release --output-on-failure -E "test-bigint" --timeout 1800 + IF %errorlevel% NEQ 0 ( echo Some tests failed exit /b %errorlevel% )