Skip to content

Commit

Permalink
Improve artifacts' stripping (ton-blockchain#1286)
Browse files Browse the repository at this point in the history
* add ton build on mac-15 gh action

* rename action titles

* fix ton-blockchain#1246

* improve artifacts' stripping

* improve artifacts' stripping

* use strip -xSX on mac on github runner

* use strip -xSX on mac on github runner + sudo
  • Loading branch information
neodix42 authored Oct 19, 2024
1 parent c1ee18c commit 8daf5c3
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 40 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-ton-macos-15-arm64-shared.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/build-ton-macos-arm64-shared.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS TON build (shared, arm64)
name: MacOS-14 TON build (shared, arm64)

on: [push,workflow_dispatch,workflow_call]

Expand Down
8 changes: 7 additions & 1 deletion CMake/FindSodium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
34 changes: 17 additions & 17 deletions assembly/native/build-macos-portable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..

Expand Down
34 changes: 17 additions & 17 deletions assembly/native/build-macos-shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..

Expand Down
2 changes: 1 addition & 1 deletion assembly/native/build-ubuntu-portable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion assembly/native/build-ubuntu-shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion assembly/native/build-windows-2019.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion assembly/native/build-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions assembly/nix/build-linux-arm64-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions assembly/nix/build-linux-x86-64-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions assembly/nix/build-macos-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8daf5c3

Please sign in to comment.