From 8daf5c335a12d5a0d045b98b94be14050e02301a Mon Sep 17 00:00:00 2001 From: neodix42 Date: Sat, 19 Oct 2024 14:03:10 +0400 Subject: [PATCH] Improve artifacts' stripping (#1286) * add ton build on mac-15 gh action * rename action titles * fix https://github.com/ton-blockchain/ton/issues/1246 * improve artifacts' stripping * improve artifacts' stripping * use strip -xSX on mac on github runner * use strip -xSX on mac on github runner + sudo --- .../build-ton-macos-15-arm64-shared.yml | 25 ++++++++++++++ .../build-ton-macos-arm64-shared.yml | 2 +- CMake/FindSodium.cmake | 8 ++++- assembly/native/build-macos-portable.sh | 34 +++++++++---------- assembly/native/build-macos-shared.sh | 34 +++++++++---------- assembly/native/build-ubuntu-portable.sh | 2 +- assembly/native/build-ubuntu-shared.sh | 2 +- assembly/native/build-windows-2019.bat | 2 +- assembly/native/build-windows.bat | 2 +- assembly/nix/build-linux-arm64-nix.sh | 19 +++++++++++ assembly/nix/build-linux-x86-64-nix.sh | 19 +++++++++++ assembly/nix/build-macos-nix.sh | 19 +++++++++++ 12 files changed, 128 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/build-ton-macos-15-arm64-shared.yml diff --git a/.github/workflows/build-ton-macos-15-arm64-shared.yml b/.github/workflows/build-ton-macos-15-arm64-shared.yml new file mode 100644 index 000000000..8379a0b04 --- /dev/null +++ b/.github/workflows/build-ton-macos-15-arm64-shared.yml @@ -0,0 +1,25 @@ +name: MacOS-15 TON build (shared, arm64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + runs-on: macos-15 + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Build TON + run: | + cp assembly/native/build-macos-shared.sh . + chmod +x build-macos-shared.sh + ./build-macos-shared.sh -t -a + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-binaries-macos-15 + path: artifacts diff --git a/.github/workflows/build-ton-macos-arm64-shared.yml b/.github/workflows/build-ton-macos-arm64-shared.yml index 2a68272cc..aadd23dd0 100644 --- a/.github/workflows/build-ton-macos-arm64-shared.yml +++ b/.github/workflows/build-ton-macos-arm64-shared.yml @@ -1,4 +1,4 @@ -name: MacOS TON build (shared, arm64) +name: MacOS-14 TON build (shared, arm64) on: [push,workflow_dispatch,workflow_call] diff --git a/CMake/FindSodium.cmake b/CMake/FindSodium.cmake index c11e46f1d..3818ef893 100644 --- a/CMake/FindSodium.cmake +++ b/CMake/FindSodium.cmake @@ -127,10 +127,16 @@ elseif (WIN32) endif() string(APPEND _PLATFORM_PATH "/$$CONFIG$$") + message(STATUS "MSVC_VERSION ${MSVC_VERSION}") if (MSVC_VERSION LESS 1900) math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 60") else() - math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50") + if (MSVC_VERSION EQUAL 1941) + math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 51") + else() + math(EXPR _VS_VERSION "${MSVC_VERSION} / 10 - 50") + endif() + endif() string(APPEND _PLATFORM_PATH "/v${_VS_VERSION}") diff --git a/assembly/native/build-macos-portable.sh b/assembly/native/build-macos-portable.sh index 471f29afa..fa4702abd 100644 --- a/assembly/native/build-macos-portable.sh +++ b/assembly/native/build-macos-portable.sh @@ -168,23 +168,23 @@ else test $? -eq 0 || { echo "Can't compile ton"; exit 1; } fi -strip storage/storage-daemon/storage-daemon -strip storage/storage-daemon/storage-daemon-cli -strip blockchain-explorer/blockchain-explorer -strip crypto/fift -strip crypto/func -strip crypto/create-state -strip crypto/tlbc -strip validator-engine-console/validator-engine-console -strip tonlib/tonlib-cli -strip http/http-proxy -strip rldp-http-proxy/rldp-http-proxy -strip dht-server/dht-server -strip lite-client/lite-client -strip validator-engine/validator-engine -strip utils/generate-random-id -strip utils/json2tlo -strip adnl/adnl-proxy +strip -s storage/storage-daemon/storage-daemon +strip -s storage/storage-daemon/storage-daemon-cli +strip -s blockchain-explorer/blockchain-explorer +strip -s crypto/fift +strip -s crypto/func +strip -s crypto/create-state +strip -s crypto/tlbc +strip -s validator-engine-console/validator-engine-console +strip -s tonlib/tonlib-cli +strip -s http/http-proxy +strip -s rldp-http-proxy/rldp-http-proxy +strip -s dht-server/dht-server +strip -s lite-client/lite-client +strip -s validator-engine/validator-engine +strip -s utils/generate-random-id +strip -s utils/json2tlo +strip -s adnl/adnl-proxy cd .. diff --git a/assembly/native/build-macos-shared.sh b/assembly/native/build-macos-shared.sh index 20cb70cff..7fdcfb941 100644 --- a/assembly/native/build-macos-shared.sh +++ b/assembly/native/build-macos-shared.sh @@ -97,23 +97,23 @@ else fi -strip storage/storage-daemon/storage-daemon -strip storage/storage-daemon/storage-daemon-cli -strip blockchain-explorer/blockchain-explorer -strip crypto/fift -strip crypto/func -strip crypto/create-state -strip crypto/tlbc -strip validator-engine-console/validator-engine-console -strip tonlib/tonlib-cli -strip http/http-proxy -strip rldp-http-proxy/rldp-http-proxy -strip dht-server/dht-server -strip lite-client/lite-client -strip validator-engine/validator-engine -strip utils/generate-random-id -strip utils/json2tlo -strip adnl/adnl-proxy +strip -s storage/storage-daemon/storage-daemon +strip -s storage/storage-daemon/storage-daemon-cli +strip -s blockchain-explorer/blockchain-explorer +strip -s crypto/fift +strip -s crypto/func +strip -s crypto/create-state +strip -s crypto/tlbc +strip -s validator-engine-console/validator-engine-console +strip -s tonlib/tonlib-cli +strip -s http/http-proxy +strip -s rldp-http-proxy/rldp-http-proxy +strip -s dht-server/dht-server +strip -s lite-client/lite-client +strip -s validator-engine/validator-engine +strip -s utils/generate-random-id +strip -s utils/json2tlo +strip -s adnl/adnl-proxy cd .. diff --git a/assembly/native/build-ubuntu-portable.sh b/assembly/native/build-ubuntu-portable.sh index 39b49a38f..73ae59264 100644 --- a/assembly/native/build-ubuntu-portable.sh +++ b/assembly/native/build-ubuntu-portable.sh @@ -160,7 +160,7 @@ ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \ test $? -eq 0 || { echo "Can't compile ton"; exit 1; } fi -strip -g storage/storage-daemon/storage-daemon \ +strip -s storage/storage-daemon/storage-daemon \ storage/storage-daemon/storage-daemon-cli \ blockchain-explorer/blockchain-explorer \ crypto/fift \ diff --git a/assembly/native/build-ubuntu-shared.sh b/assembly/native/build-ubuntu-shared.sh index a62698d26..00b9aa9b4 100644 --- a/assembly/native/build-ubuntu-shared.sh +++ b/assembly/native/build-ubuntu-shared.sh @@ -68,7 +68,7 @@ ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \ test $? -eq 0 || { echo "Can't compile ton"; exit 1; } fi -strip -g storage/storage-daemon/storage-daemon \ +strip -s storage/storage-daemon/storage-daemon \ storage/storage-daemon/storage-daemon-cli \ blockchain-explorer/blockchain-explorer \ crypto/fift \ diff --git a/assembly/native/build-windows-2019.bat b/assembly/native/build-windows-2019.bat index b528b05a2..f728b88f8 100644 --- a/assembly/native/build-windows-2019.bat +++ b/assembly/native/build-windows-2019.bat @@ -216,6 +216,6 @@ build\validator-engine\validator-engine.exe ^ build\utils\generate-random-id.exe ^ build\utils\json2tlo.exe ^ build\adnl\adnl-proxy.exe ^ -build\emulator\emulator.dll) do (strip -g %%I & copy %%I artifacts\) +build\emulator\emulator.dll) do (strip -s %%I & copy %%I artifacts\) xcopy /e /k /h /i crypto\smartcont artifacts\smartcont xcopy /e /k /h /i crypto\fift\lib artifacts\lib diff --git a/assembly/native/build-windows.bat b/assembly/native/build-windows.bat index a9871aa96..aa0fd69ad 100644 --- a/assembly/native/build-windows.bat +++ b/assembly/native/build-windows.bat @@ -217,6 +217,6 @@ build\validator-engine\validator-engine.exe ^ build\utils\generate-random-id.exe ^ build\utils\json2tlo.exe ^ build\adnl\adnl-proxy.exe ^ -build\emulator\emulator.dll) do (strip -g %%I & copy %%I artifacts\) +build\emulator\emulator.dll) do (strip -s %%I & copy %%I artifacts\) xcopy /e /k /h /i crypto\smartcont artifacts\smartcont xcopy /e /k /h /i crypto\fift\lib artifacts\lib diff --git a/assembly/nix/build-linux-arm64-nix.sh b/assembly/nix/build-linux-arm64-nix.sh index 6fc2fab20..2c7df521f 100644 --- a/assembly/nix/build-linux-arm64-nix.sh +++ b/assembly/nix/build-linux-arm64-nix.sh @@ -36,3 +36,22 @@ cp ./result/lib/libemulator.so artifacts/ cp ./result/lib/fift/* artifacts/lib/ cp -r ./result/share/ton/smartcont artifacts/ chmod -R +x artifacts +cd artifacts +sudo strip -s storage-daemon \ + storage-daemon-cli \ + blockchain-explorer \ + fift \ + tlbc \ + func \ + create-state \ + validator-engine-console \ + tonlib-cli \ + http-proxy \ + rldp-http-proxy \ + dht-server \ + lite-client \ + validator-engine \ + generate-random-id \ + adnl-proxy \ + libemulator.so \ + libtonlibjson.so diff --git a/assembly/nix/build-linux-x86-64-nix.sh b/assembly/nix/build-linux-x86-64-nix.sh index 30ab79f72..ae478ec2d 100644 --- a/assembly/nix/build-linux-x86-64-nix.sh +++ b/assembly/nix/build-linux-x86-64-nix.sh @@ -36,3 +36,22 @@ cp ./result/lib/libemulator.so artifacts/ cp ./result/lib/fift/* artifacts/lib/ cp -r ./result/share/ton/smartcont artifacts/ chmod -R +x artifacts +cd artifacts +sudo strip -s storage-daemon \ + storage-daemon-cli \ + blockchain-explorer \ + fift \ + tlbc \ + func \ + create-state \ + validator-engine-console \ + tonlib-cli \ + http-proxy \ + rldp-http-proxy \ + dht-server \ + lite-client \ + validator-engine \ + generate-random-id \ + adnl-proxy \ + libemulator.so \ + libtonlibjson.so diff --git a/assembly/nix/build-macos-nix.sh b/assembly/nix/build-macos-nix.sh index 8a07bea20..c92eddb28 100644 --- a/assembly/nix/build-macos-nix.sh +++ b/assembly/nix/build-macos-nix.sh @@ -36,3 +36,22 @@ cp ./result/lib/libemulator.dylib artifacts/ cp ./result/lib/fift/* artifacts/lib/ cp -r ./result/share/ton/smartcont artifacts/ chmod -R +x artifacts +cd artifacts +sudo strip -xSX storage-daemon \ + storage-daemon-cli \ + blockchain-explorer \ + fift \ + tlbc \ + func \ + create-state \ + validator-engine-console \ + tonlib-cli \ + http-proxy \ + rldp-http-proxy \ + dht-server \ + lite-client \ + validator-engine \ + generate-random-id \ + adnl-proxy \ + libemulator.dylib \ + libtonlibjson.dylib