From e0605156defc570bebf41b8d0032e9cbb1ec46b1 Mon Sep 17 00:00:00 2001 From: neodix42 Date: Tue, 21 Jan 2025 12:27:25 +0400 Subject: [PATCH] Reworked TON portable artifacts (#1486) * improve windows builds * install nasm for openssl compilation on win * install nasm for openssl compilation on win for github * add create-state, proxy-liteserver, rldp-http-proxy, http-proxy, adnl-proxy, dht-server, libtonlibjson.so and libemulator.so to docker image * build new artifacts inside Docker * add files smartcont/auto/* to docker image * build arm64 in docker branch build * improve secp256k1 build * adding natively portable binaries (all statically linked with libc++, without nixpkgs help) for x86-64 linux * install missing headers on ubuntu 20.04 * use clang-16 on ubuntu 20.04 * remove gsl for portable artifacts; add -f key to generate-random-id in order to read addr_list from file; * typo * decode json * decode json * add github workflow for appimages creation * add missing dependencies * use libc++ for appimages artifacts * typo * appimages wihtout libc++ * appimages with libc++ and some checks * add appimages to release (for testing) * add appimages to release (for testing) * add appimages to release (for testing) * add appimages to release (for testing) 2 * add appimages to release (for testing) 3 * appimages only on ubuntu 22 with ssl-3 for now * appimages only on ubuntu 20 with ssl-3 for now * appimages only on ubuntu 20 with ssl-3 for now * add export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}" to appimage AppRun * create release * appimages without jemalloc * bind specific libraries to appimages * add libreadline * add plain portable libs * add proper /lib/x86_64-linux-gnu/libreadline.so.8 * app images build with libc * try to ensure ABI compatibility with older glibc * try to ensure ABI compatibility with older glibc for shared libraries * shared lib without libc but with D_GLIBCXX_USE_CXX11_ABI and -static-libgcc -static-libstdc++ * add -fPIC -fcommon * add /lib/x86_64-linux-gnu/libstdc++.so.6 to static binaries * add -static-libgcc -static-libstdc++ to libtonlibjson and emulator when PORTABLE=1 * add -static-libgcc -static-libstdc++ to libtonlibjson and emulator when PORTABLE=1 * update emulator portable * Update CMakeLists.txt * test portable macos binaries * do not use -static-libgcc -static-libstdc++ on mac for shared libs * do not use -static-libgcc -static-libstdc++ on mac for shared libs * adjust create-release.yml * minor fixes, typos * minor fixes * linux apps double check * avoid infinite loop when place in system bin dir * avoid infinite loop when place in system bin dir 2 * test compilation on linux arm64 * test appimages on arm64 linux * test appimages on arm64 linux 2 * add portable linux arm64 to release * clean up * update README.md --- .github/script/amd64-20.04.Dockerfile | 20 -- .github/script/amd64-22.04.Dockerfile | 20 -- .github/script/arm64-20.04.Dockerfile | 20 -- .github/script/arm64-22.04.Dockerfile | 20 -- .../build-ton-linux-arm64-appimage.yml | 57 ++++ .../build-ton-linux-arm64-shared.yml | 43 +++ .../build-ton-linux-x86-64-appimage.yml | 63 +++++ .../build-ton-macos-13-x86-64-portable.yml | 27 ++ .../build-ton-macos-14-arm64-portable.yml | 27 ++ .../workflows/build-ton-wasm-emscripten.yml | 2 +- .github/workflows/create-release.yml | 244 +++++++++++++----- .github/workflows/ton-arm64-macos.yml | 40 --- .github/workflows/ton-x86-64-linux.yml | 44 ---- .github/workflows/ton-x86-64-macos.yml | 40 --- .github/workflows/ton-x86-64-windows.yml | 2 +- README.md | 18 +- assembly/appimage/AppRun | 3 + assembly/appimage/create-appimages.sh | 50 ++++ assembly/appimage/ton.png | Bin 0 -> 5571 bytes assembly/cicd/jenkins/test-builds.groovy | 237 ----------------- assembly/native/build-ubuntu-appimages.sh | 109 ++++++++ assembly/native/build-ubuntu-portable-libs.sh | 132 ++++++++++ assembly/native/build-ubuntu-portable.sh | 8 +- emulator/CMakeLists.txt | 7 +- tonlib/CMakeLists.txt | 7 +- 25 files changed, 718 insertions(+), 522 deletions(-) delete mode 100644 .github/script/amd64-20.04.Dockerfile delete mode 100644 .github/script/amd64-22.04.Dockerfile delete mode 100644 .github/script/arm64-20.04.Dockerfile delete mode 100644 .github/script/arm64-22.04.Dockerfile create mode 100644 .github/workflows/build-ton-linux-arm64-appimage.yml create mode 100644 .github/workflows/build-ton-linux-arm64-shared.yml create mode 100644 .github/workflows/build-ton-linux-x86-64-appimage.yml create mode 100644 .github/workflows/build-ton-macos-13-x86-64-portable.yml create mode 100644 .github/workflows/build-ton-macos-14-arm64-portable.yml delete mode 100644 .github/workflows/ton-arm64-macos.yml delete mode 100644 .github/workflows/ton-x86-64-linux.yml delete mode 100644 .github/workflows/ton-x86-64-macos.yml create mode 100644 assembly/appimage/AppRun create mode 100644 assembly/appimage/create-appimages.sh create mode 100644 assembly/appimage/ton.png delete mode 100644 assembly/cicd/jenkins/test-builds.groovy create mode 100644 assembly/native/build-ubuntu-appimages.sh create mode 100644 assembly/native/build-ubuntu-portable-libs.sh diff --git a/.github/script/amd64-20.04.Dockerfile b/.github/script/amd64-20.04.Dockerfile deleted file mode 100644 index 1ec89ebd7..000000000 --- a/.github/script/amd64-20.04.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:20.04 - -RUN apt update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata -RUN apt install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git curl libreadline-dev ccache libmicrohttpd-dev ninja-build libsecp256k1-dev libsodium-dev pkg-config - -WORKDIR / - -ARG BRANCH -ARG REPO -RUN git clone --recurse-submodules https://github.com/$REPO ton && cd ton && git checkout $BRANCH && git submodule update - -WORKDIR /ton -RUN mkdir /ton/build -WORKDIR /ton/build -ENV CC clang -ENV CXX clang++ -ENV CCACHE_DISABLE 1 -RUN cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= -DCMAKE_CXX_FLAGS="-mavx2" .. -RUN ninja storage-daemon storage-daemon-cli tonlibjson blockchain-explorer fift func tolk validator-engine validator-engine-console create-state generate-random-id create-hardfork dht-server lite-client diff --git a/.github/script/amd64-22.04.Dockerfile b/.github/script/amd64-22.04.Dockerfile deleted file mode 100644 index 6134d1673..000000000 --- a/.github/script/amd64-22.04.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:22.04 - -RUN apt update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata -RUN apt install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git curl libreadline-dev ccache libmicrohttpd-dev ninja-build libsecp256k1-dev libsodium-dev pkg-config - -WORKDIR / - -ARG BRANCH -ARG REPO -RUN git clone --recurse-submodules https://github.com/$REPO ton && cd ton && git checkout $BRANCH && git submodule update - -WORKDIR /ton -RUN mkdir /ton/build -WORKDIR /ton/build -ENV CC clang -ENV CXX clang++ -ENV CCACHE_DISABLE 1 -RUN cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= -DCMAKE_CXX_FLAGS="-mavx2" .. -RUN ninja storage-daemon storage-daemon-cli tonlibjson blockchain-explorer fift func tolk validator-engine validator-engine-console create-state generate-random-id create-hardfork dht-server lite-client diff --git a/.github/script/arm64-20.04.Dockerfile b/.github/script/arm64-20.04.Dockerfile deleted file mode 100644 index 5e3505345..000000000 --- a/.github/script/arm64-20.04.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:20.04 - -RUN apt update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata -RUN apt install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git curl libreadline-dev ccache libmicrohttpd-dev ninja-build libsecp256k1-dev libsodium-dev pkg-config - -WORKDIR / - -ARG BRANCH -ARG REPO -RUN git clone --recurse-submodules https://github.com/$REPO ton && cd ton && git checkout $BRANCH && git submodule update - -WORKDIR /ton -RUN mkdir /ton/build -WORKDIR /ton/build -ENV CC clang -ENV CXX clang++ -ENV CCACHE_DISABLE 1 -RUN cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= .. -RUN ninja storage-daemon storage-daemon-cli tonlibjson blockchain-explorer fift func tolk validator-engine validator-engine-console create-state generate-random-id dht-server lite-client diff --git a/.github/script/arm64-22.04.Dockerfile b/.github/script/arm64-22.04.Dockerfile deleted file mode 100644 index f9805849d..000000000 --- a/.github/script/arm64-22.04.Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:22.04 - -RUN apt update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata -RUN apt install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git curl libreadline-dev ccache libmicrohttpd-dev ninja-build libsecp256k1-dev libsodium-dev pkg-config - -WORKDIR / - -ARG BRANCH -ARG REPO -RUN git clone --recurse-submodules https://github.com/$REPO ton && cd ton && git checkout $BRANCH && git submodule update - -WORKDIR /ton -RUN mkdir /ton/build -WORKDIR /ton/build -ENV CC clang -ENV CXX clang++ -ENV CCACHE_DISABLE 1 -RUN cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= .. -RUN ninja storage-daemon storage-daemon-cli tonlibjson blockchain-explorer fift func tolk validator-engine validator-engine-console create-state generate-random-id dht-server lite-client diff --git a/.github/workflows/build-ton-linux-arm64-appimage.yml b/.github/workflows/build-ton-linux-arm64-appimage.yml new file mode 100644 index 000000000..d464d8a2a --- /dev/null +++ b/.github/workflows/build-ton-linux-arm64-appimage.yml @@ -0,0 +1,57 @@ +name: Ubuntu TON build (AppImages, arm64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + runs-on: ubuntu-22.04-arm + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Install system libraries + run: | + sudo apt update + sudo apt install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev + sudo apt remove libgsl-dev + + - name: Install clang-16 + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 all + + - name: Build TON + run: | + git submodule sync --recursive + git submodule update + cp assembly/native/build-ubuntu-appimages.sh . + chmod +x build-ubuntu-appimages.sh + ./build-ubuntu-appimages.sh -a + + - name: Make AppImages + run: | + cp assembly/appimage/create-appimages.sh . + cp assembly/appimage/AppRun . + cp assembly/appimage/ton.png . + chmod +x create-appimages.sh + ./create-appimages.sh aarch64 + rm -rf artifacts + + + - name: Build TON libs + run: | + cp assembly/native/build-ubuntu-portable-libs.sh . + chmod +x build-ubuntu-portable-libs.sh + ./build-ubuntu-portable-libs.sh -a + cp ./artifacts/libtonlibjson.so appimages/artifacts/ + cp ./artifacts/libemulator.so appimages/artifacts/ + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-arm64-linux + path: appimages/artifacts diff --git a/.github/workflows/build-ton-linux-arm64-shared.yml b/.github/workflows/build-ton-linux-arm64-shared.yml new file mode 100644 index 000000000..6433df0b5 --- /dev/null +++ b/.github/workflows/build-ton-linux-arm64-shared.yml @@ -0,0 +1,43 @@ +name: Ubuntu TON build (shared, arm64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04-arm, ubuntu-24.04-arm] + runs-on: ${{ matrix.os }} + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Install system libraries + run: | + sudo apt-get update + sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev + + - if: matrix.os != 'ubuntu-24.04-arm' + name: Install llvm-16 + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 all + + - name: Build TON + run: | + git submodule sync --recursive + git submodule update + cp assembly/native/build-ubuntu-shared.sh . + chmod +x build-ubuntu-shared.sh + ./build-ubuntu-shared.sh -t -a + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-binaries-${{ matrix.os }} + path: artifacts diff --git a/.github/workflows/build-ton-linux-x86-64-appimage.yml b/.github/workflows/build-ton-linux-x86-64-appimage.yml new file mode 100644 index 000000000..4f78ece9d --- /dev/null +++ b/.github/workflows/build-ton-linux-x86-64-appimage.yml @@ -0,0 +1,63 @@ +name: Ubuntu TON build (AppImages, x86-64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Install system libraries + run: | + sudo apt update + sudo apt install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev + sudo apt remove libgsl-dev + + - name: Install gcc-11 g++-11 + run: | + sudo apt install -y manpages-dev software-properties-common + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update && sudo apt install gcc-11 g++-11 + + - name: Install clang-16 + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 all + + - name: Build TON + run: | + git submodule sync --recursive + git submodule update + cp assembly/native/build-ubuntu-appimages.sh . + chmod +x build-ubuntu-appimages.sh + ./build-ubuntu-appimages.sh -a + + - name: Make AppImages + run: | + cp assembly/appimage/create-appimages.sh . + cp assembly/appimage/AppRun . + cp assembly/appimage/ton.png . + chmod +x create-appimages.sh + ./create-appimages.sh x86_64 + rm -rf artifacts + + + - name: Build TON libs + run: | + cp assembly/native/build-ubuntu-portable-libs.sh . + chmod +x build-ubuntu-portable-libs.sh + ./build-ubuntu-portable-libs.sh -a + cp ./artifacts/libtonlibjson.so appimages/artifacts/ + cp ./artifacts/libemulator.so appimages/artifacts/ + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-x86_64-linux + path: appimages/artifacts diff --git a/.github/workflows/build-ton-macos-13-x86-64-portable.yml b/.github/workflows/build-ton-macos-13-x86-64-portable.yml new file mode 100644 index 000000000..5e50a4680 --- /dev/null +++ b/.github/workflows/build-ton-macos-13-x86-64-portable.yml @@ -0,0 +1,27 @@ +name: MacOS-13 TON build (portable, x86-64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + runs-on: macos-13 + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Build TON + run: | + git submodule sync --recursive + git submodule update + cp assembly/native/build-macos-portable.sh . + chmod +x build-macos-portable.sh + ./build-macos-portable.sh -t -a + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-x86_64-macos + path: artifacts diff --git a/.github/workflows/build-ton-macos-14-arm64-portable.yml b/.github/workflows/build-ton-macos-14-arm64-portable.yml new file mode 100644 index 000000000..8eb3af70a --- /dev/null +++ b/.github/workflows/build-ton-macos-14-arm64-portable.yml @@ -0,0 +1,27 @@ +name: MacOS-14 TON build (portable, arm64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + runs-on: macos-14 + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Build TON + run: | + git submodule sync --recursive + git submodule update + cp assembly/native/build-macos-portable.sh . + chmod +x build-macos-portable.sh + ./build-macos-portable.sh -t -a + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-arm64-macos + path: artifacts diff --git a/.github/workflows/build-ton-wasm-emscripten.yml b/.github/workflows/build-ton-wasm-emscripten.yml index 66fe5e93f..2ac1a2245 100644 --- a/.github/workflows/build-ton-wasm-emscripten.yml +++ b/.github/workflows/build-ton-wasm-emscripten.yml @@ -28,5 +28,5 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@master with: - name: ton-wasm-binaries + name: ton-wasm path: artifacts diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 04f81a248..3063ce06e 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -11,10 +11,26 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Download Linux arm64 artifacts + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build-ton-linux-arm64-appimage.yml + path: artifacts + workflow_conclusion: success + skip_unpack: true + + - name: Download and unzip Linux arm64 artifacts + uses: dawidd6/action-download-artifact@v6 + with: + workflow: build-ton-linux-arm64-appimage.yml + path: artifacts + workflow_conclusion: success + skip_unpack: false + - name: Download Linux x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: ton-x86-64-linux.yml + workflow: build-ton-linux-x86-64-appimage.yml path: artifacts workflow_conclusion: success skip_unpack: true @@ -22,7 +38,7 @@ jobs: - name: Download and unzip Linux x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: ton-x86-64-linux.yml + workflow: build-ton-linux-x86-64-appimage.yml path: artifacts workflow_conclusion: success skip_unpack: false @@ -30,7 +46,7 @@ jobs: - name: Download Mac x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: ton-x86-64-macos.yml + workflow: build-ton-macos-13-x86-64-portable.yml path: artifacts workflow_conclusion: success skip_unpack: true @@ -38,7 +54,7 @@ jobs: - name: Download Mac arm64 artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: ton-arm64-macos.yml + workflow: build-ton-macos-14-arm64-portable.yml path: artifacts workflow_conclusion: success skip_unpack: true @@ -46,7 +62,7 @@ jobs: - name: Download and unzip Mac x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: ton-x86-64-macos.yml + workflow: build-ton-macos-13-x86-64-portable.yml path: artifacts workflow_conclusion: success skip_unpack: false @@ -54,7 +70,7 @@ jobs: - name: Download and unzip arm64 artifacts uses: dawidd6/action-download-artifact@v6 with: - workflow: ton-arm64-macos.yml + workflow: build-ton-macos-14-arm64-portable.yml path: artifacts workflow_conclusion: success skip_unpack: false @@ -147,7 +163,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries.zip + file: artifacts/ton-x86-64-windows.zip asset_name: ton-win-x86-64.zip tag: ${{ steps.tag.outputs.TAG }} @@ -155,7 +171,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/fift.exe + file: artifacts/ton-x86-64-windows/fift.exe asset_name: fift.exe tag: ${{ steps.tag.outputs.TAG }} @@ -163,7 +179,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/func.exe + file: artifacts/ton-x86-64-windows/func.exe asset_name: func.exe tag: ${{ steps.tag.outputs.TAG }} @@ -171,7 +187,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/tolk.exe + file: artifacts/ton-x86-64-windows/tolk.exe asset_name: tolk.exe tag: ${{ steps.tag.outputs.TAG }} @@ -179,7 +195,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/lite-client.exe + file: artifacts/ton-x86-64-windows/lite-client.exe asset_name: lite-client.exe tag: ${{ steps.tag.outputs.TAG }} @@ -187,7 +203,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/proxy-liteserver.exe + file: artifacts/ton-x86-64-windows/proxy-liteserver.exe asset_name: proxy-liteserver.exe tag: ${{ steps.tag.outputs.TAG }} @@ -195,7 +211,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/rldp-http-proxy.exe + file: artifacts/ton-x86-64-windows/rldp-http-proxy.exe asset_name: rldp-http-proxy.exe tag: ${{ steps.tag.outputs.TAG }} @@ -203,7 +219,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/http-proxy.exe + file: artifacts/ton-x86-64-windows/http-proxy.exe asset_name: http-proxy.exe tag: ${{ steps.tag.outputs.TAG }} @@ -211,7 +227,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/storage-daemon-cli.exe + file: artifacts/ton-x86-64-windows/storage-daemon-cli.exe asset_name: storage-daemon-cli.exe tag: ${{ steps.tag.outputs.TAG }} @@ -219,7 +235,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/storage-daemon.exe + file: artifacts/ton-x86-64-windows/storage-daemon.exe asset_name: storage-daemon.exe tag: ${{ steps.tag.outputs.TAG }} @@ -227,7 +243,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/tonlibjson.dll + file: artifacts/ton-x86-64-windows/tonlibjson.dll asset_name: tonlibjson.dll tag: ${{ steps.tag.outputs.TAG }} @@ -235,7 +251,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/emulator.dll + file: artifacts/ton-x86-64-windows/emulator.dll asset_name: libemulator.dll tag: ${{ steps.tag.outputs.TAG }} @@ -243,7 +259,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-win-binaries/tonlib-cli.exe + file: artifacts/ton-x86-64-windows/tonlib-cli.exe asset_name: tonlib-cli.exe tag: ${{ steps.tag.outputs.TAG }} @@ -253,7 +269,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries.zip + file: artifacts/ton-x86_64-macos.zip asset_name: ton-mac-x86-64.zip tag: ${{ steps.tag.outputs.TAG }} @@ -261,7 +277,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/fift + file: artifacts/ton-x86_64-macos/fift asset_name: fift-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -269,7 +285,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/func + file: artifacts/ton-x86_64-macos/func asset_name: func-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -277,7 +293,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/tolk + file: artifacts/ton-x86_64-macos/tolk asset_name: tolk-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -285,7 +301,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/lite-client + file: artifacts/ton-x86_64-macos/lite-client asset_name: lite-client-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -293,7 +309,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/proxy-liteserver + file: artifacts/ton-x86_64-macos/proxy-liteserver asset_name: proxy-liteserver-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -301,7 +317,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/rldp-http-proxy + file: artifacts/ton-x86_64-macos/rldp-http-proxy asset_name: rldp-http-proxy-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -309,7 +325,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/http-proxy + file: artifacts/ton-x86_64-macos/http-proxy asset_name: http-proxy-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -317,7 +333,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/storage-daemon-cli + file: artifacts/ton-x86_64-macos/storage-daemon-cli asset_name: storage-daemon-cli-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -325,7 +341,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/storage-daemon + file: artifacts/ton-x86_64-macos/storage-daemon asset_name: storage-daemon-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -333,7 +349,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/libtonlibjson.dylib + file: artifacts/ton-x86_64-macos/libtonlibjson.dylib asset_name: tonlibjson-mac-x86-64.dylib tag: ${{ steps.tag.outputs.TAG }} @@ -341,7 +357,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/libemulator.dylib + file: artifacts/ton-x86_64-macos/libemulator.dylib asset_name: libemulator-mac-x86-64.dylib tag: ${{ steps.tag.outputs.TAG }} @@ -349,7 +365,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos-binaries/tonlib-cli + file: artifacts/ton-x86_64-macos/tonlib-cli asset_name: tonlib-cli-mac-x86-64 tag: ${{ steps.tag.outputs.TAG }} @@ -360,7 +376,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries.zip + file: artifacts/ton-arm64-macos.zip asset_name: ton-mac-arm64.zip tag: ${{ steps.tag.outputs.TAG }} @@ -368,7 +384,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/fift + file: artifacts/ton-arm64-macos/fift asset_name: fift-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -376,7 +392,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/func + file: artifacts/ton-arm64-macos/func asset_name: func-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -384,7 +400,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/tolk + file: artifacts/ton-arm64-macos/tolk asset_name: tolk-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -392,7 +408,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/lite-client + file: artifacts/ton-arm64-macos/lite-client asset_name: lite-client-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -400,7 +416,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/proxy-liteserver + file: artifacts/ton-arm64-macos/proxy-liteserver asset_name: proxy-liteserver-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -408,7 +424,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/rldp-http-proxy + file: artifacts/ton-arm64-macos/rldp-http-proxy asset_name: rldp-http-proxy-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -416,7 +432,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/http-proxy + file: artifacts/ton-arm64-macos/http-proxy asset_name: http-proxy-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -424,7 +440,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/storage-daemon-cli + file: artifacts/ton-arm64-macos/storage-daemon-cli asset_name: storage-daemon-cli-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -432,7 +448,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/storage-daemon + file: artifacts/ton-arm64-macos/storage-daemon asset_name: storage-daemon-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -440,7 +456,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/libtonlibjson.dylib + file: artifacts/ton-arm64-macos/libtonlibjson.dylib asset_name: tonlibjson-mac-arm64.dylib tag: ${{ steps.tag.outputs.TAG }} @@ -448,7 +464,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/libemulator.dylib + file: artifacts/ton-arm64-macos/libemulator.dylib asset_name: libemulator-mac-arm64.dylib tag: ${{ steps.tag.outputs.TAG }} @@ -456,7 +472,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos-binaries/tonlib-cli + file: artifacts/ton-arm64-macos/tonlib-cli asset_name: tonlib-cli-mac-arm64 tag: ${{ steps.tag.outputs.TAG }} @@ -466,7 +482,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries.zip + file: artifacts/ton-x86_64-linux.zip asset_name: ton-linux-x86_64.zip tag: ${{ steps.tag.outputs.TAG }} @@ -474,7 +490,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/fift + file: artifacts/ton-x86_64-linux/fift asset_name: fift-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -482,7 +498,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/func + file: artifacts/ton-x86_64-linux/func asset_name: func-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -490,7 +506,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/tolk + file: artifacts/ton-x86_64-linux/tolk asset_name: tolk-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -498,7 +514,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/lite-client + file: artifacts/ton-x86_64-linux/lite-client asset_name: lite-client-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -506,7 +522,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/proxy-liteserver + file: artifacts/ton-x86_64-linux/proxy-liteserver asset_name: proxy-liteserver-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -514,7 +530,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/rldp-http-proxy + file: artifacts/ton-x86_64-linux/rldp-http-proxy asset_name: rldp-http-proxy-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -522,7 +538,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/http-proxy + file: artifacts/ton-x86_64-linux/http-proxy asset_name: http-proxy-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -530,7 +546,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/storage-daemon-cli + file: artifacts/ton-x86_64-linux/storage-daemon-cli asset_name: storage-daemon-cli-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -538,7 +554,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/storage-daemon + file: artifacts/ton-x86_64-linux/storage-daemon asset_name: storage-daemon-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} @@ -546,7 +562,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/libtonlibjson.so + file: artifacts/ton-x86_64-linux/libtonlibjson.so asset_name: tonlibjson-linux-x86_64.so tag: ${{ steps.tag.outputs.TAG }} @@ -554,7 +570,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/libemulator.so + file: artifacts/ton-x86_64-linux/libemulator.so asset_name: libemulator-linux-x86_64.so tag: ${{ steps.tag.outputs.TAG }} @@ -562,16 +578,124 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux-binaries/tonlib-cli + file: artifacts/ton-x86_64-linux/tonlib-cli asset_name: tonlib-cli-linux-x86_64 tag: ${{ steps.tag.outputs.TAG }} + + # linux arm64 + + - name: Upload Linux arm64 artifacts + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux.zip + asset_name: ton-linux-arm64.zip + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - fift + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/fift + asset_name: fift-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - func + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/func + asset_name: func-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - tolk + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/tolk + asset_name: tolk-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - lite-client + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/lite-client + asset_name: lite-client-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - proxy-liteserver + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/proxy-liteserver + asset_name: proxy-liteserver-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - rldp-http-proxy + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/rldp-http-proxy + asset_name: rldp-http-proxy-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - http-proxy + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/http-proxy + asset_name: http-proxy-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - storage-daemon-cli + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/storage-daemon-cli + asset_name: storage-daemon-cli-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - storage-daemon + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/storage-daemon + asset_name: storage-daemon-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - tonlibjson + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/libtonlibjson.so + asset_name: tonlibjson-linux-arm64.so + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - libemulator + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/libemulator.so + asset_name: libemulator-linux-arm64.so + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload Linux arm64 single artifact - tonlib-cli + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: artifacts/ton-arm64-linux/tonlib-cli + asset_name: tonlib-cli-linux-arm64 + tag: ${{ steps.tag.outputs.TAG }} + + - name: Upload WASM artifacts uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-wasm-binaries.zip - asset_name: ton-wasm-binaries.zip + file: artifacts/ton-wasm.zip + asset_name: ton-wasm.zip tag: ${{ steps.tag.outputs.TAG }} - name: Upload Android Tonlib artifacts diff --git a/.github/workflows/ton-arm64-macos.yml b/.github/workflows/ton-arm64-macos.yml deleted file mode 100644 index f128680c2..000000000 --- a/.github/workflows/ton-arm64-macos.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: MacOS TON build (portable, arm64) - -on: [push,workflow_dispatch,workflow_call] - -jobs: - build: - runs-on: macos-14 - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - uses: cachix/install-nix-action@v23 - with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: Build TON - run: | - git submodule sync --recursive - git submodule update - cp assembly/nix/build-macos-nix.sh . - chmod +x build-macos-nix.sh - ./build-macos-nix.sh -t - - - name: Simple binaries test - run: | - sudo mv /nix/store /nix/store2 - artifacts/validator-engine -V - artifacts/lite-client -V - artifacts/fift -V - artifacts/func -V - artifacts/tolk -v - - - name: Upload artifacts - uses: actions/upload-artifact@master - with: - name: ton-arm64-macos-binaries - path: artifacts diff --git a/.github/workflows/ton-x86-64-linux.yml b/.github/workflows/ton-x86-64-linux.yml deleted file mode 100644 index 4cdafa114..000000000 --- a/.github/workflows/ton-x86-64-linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Ubuntu TON build (portable, x86-64) - -on: [push,workflow_dispatch,workflow_call] - -jobs: - build: - runs-on: ubuntu-22.04 - - steps: - - run: | - sudo apt update - sudo apt install -y apt-utils - - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - uses: cachix/install-nix-action@v23 - with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: Build TON - run: | - git submodule sync --recursive - git submodule update - cp assembly/nix/build-linux-x86-64-nix.sh . - chmod +x build-linux-x86-64-nix.sh - ./build-linux-x86-64-nix.sh -t - - - name: Simple binaries test - run: | - sudo mv /nix/store /nix/store2 - artifacts/validator-engine -V - artifacts/lite-client -V - artifacts/fift -V - artifacts/func -V - artifacts/tolk -v - - - name: Upload artifacts - uses: actions/upload-artifact@master - with: - name: ton-x86_64-linux-binaries - path: artifacts diff --git a/.github/workflows/ton-x86-64-macos.yml b/.github/workflows/ton-x86-64-macos.yml deleted file mode 100644 index 41b8fa239..000000000 --- a/.github/workflows/ton-x86-64-macos.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: MacOS TON build (portable, x86-64) - -on: [push,workflow_dispatch,workflow_call] - -jobs: - build: - runs-on: macos-13 - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - uses: cachix/install-nix-action@v23 - with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: Build TON - run: | - git submodule sync --recursive - git submodule update - cp assembly/nix/build-macos-nix.sh . - chmod +x build-macos-nix.sh - ./build-macos-nix.sh -t - - - name: Simple binaries test - run: | - sudo mv /nix/store /nix/store2 - artifacts/validator-engine -V - artifacts/lite-client -V - artifacts/fift -V - artifacts/func -V - artifacts/tolk -v - - - name: Upload artifacts - uses: actions/upload-artifact@master - with: - name: ton-x86_64-macos-binaries - path: artifacts diff --git a/.github/workflows/ton-x86-64-windows.yml b/.github/workflows/ton-x86-64-windows.yml index c3c06f905..baaad778b 100644 --- a/.github/workflows/ton-x86-64-windows.yml +++ b/.github/workflows/ton-x86-64-windows.yml @@ -32,5 +32,5 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@master with: - name: ton-win-binaries + name: ton-x86-64-windows path: artifacts diff --git a/README.md b/README.md index 96516d447..d0aa8cb39 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Usually, the response to your pull request will indicate which section it falls ## Build TON blockchain -### Ubuntu 20.4, 22.04 (x86-64, aarch64) +### Ubuntu 20.4, 22.04, 24.04 (x86-64, aarch64) Install additional system libraries ```bash sudo apt-get update @@ -141,18 +141,10 @@ Compile TON tonlib library ./build-android-tonlib.sh ``` -### Build TON portable binaries with Nix package manager -You need to install Nix first. -```bash - sh <(curl -L https://nixos.org/nix/install) --daemon -``` -Then compile TON with Nix by executing below command from the root folder: -```bash - cp -r assembly/nix/* . - export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz - nix-build linux-x86-64-static.nix -``` -More examples for other platforms can be found under `assembly/nix`. +### TON portable binaries + +Linux portable binaries are wrapped into AppImages, at the same time MacOS portable binaries are statically linked executables. +Linux and MacOS binaries are available for both x86-64 and arm64 architectures. ## Running tests diff --git a/assembly/appimage/AppRun b/assembly/appimage/AppRun new file mode 100644 index 000000000..c7f147b3e --- /dev/null +++ b/assembly/appimage/AppRun @@ -0,0 +1,3 @@ +#!/bin/sh +export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}" +exec "$(dirname $0)"/usr/bin/app "$@" diff --git a/assembly/appimage/create-appimages.sh b/assembly/appimage/create-appimages.sh new file mode 100644 index 000000000..2a8cd0ec6 --- /dev/null +++ b/assembly/appimage/create-appimages.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +if [ ! -d "artifacts" ]; then + echo "No artifacts found." + exit 2 +fi +# x86_64 or aarch64 +ARCH=$1 + +rm -rf appimages + +mkdir -p appimages/artifacts + +wget -nc https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage +chmod +x ./appimagetool-$ARCH.AppImage + +cd appimages +for file in ../artifacts/*; do + if [[ -f "$file" && "$file" != *.so ]]; then + appName=$(basename "$file") + echo $appName + # prepare AppDir + mkdir -p $appName.AppDir/usr/{bin,lib} + cp ../AppRun $appName.AppDir/AppRun + sed -i "s/app/$appName/g" $appName.AppDir/AppRun + chmod +x ./$appName.AppDir/AppRun + printf '[Desktop Entry]\nName='$appName'\nExec='$appName'\nIcon='$appName'\nType=Application\nCategories=Utility;\n' > $appName.AppDir/$appName.desktop + cp ../ton.png $appName.AppDir/$appName.png + cp $file $appName.AppDir/usr/bin/ + cp ../build/openssl_3/libcrypto.so.3 \ + /lib/$ARCH-linux-gnu/libatomic.so.1 \ + /lib/$ARCH-linux-gnu/libsodium.so.23 \ + /lib/$ARCH-linux-gnu/libz.so.1 \ + /lib/$ARCH-linux-gnu/liblz4.so.1 \ + /lib/$ARCH-linux-gnu/libmicrohttpd.so.12 \ + /lib/$ARCH-linux-gnu/libreadline.so.8 \ + /lib/$ARCH-linux-gnu/libstdc++.so.6 \ + $appName.AppDir/usr/lib/ + + chmod +x ./$appName.AppDir/usr/bin/$appName + # create AppImage + ./../appimagetool-$ARCH.AppImage -l $appName.AppDir + mv $appName-$ARCH.AppImage artifacts/$appName + fi +done + +ls -larth artifacts +cp -r ../artifacts/{smartcont,lib} artifacts/ +pwd +ls -larth artifacts diff --git a/assembly/appimage/ton.png b/assembly/appimage/ton.png new file mode 100644 index 0000000000000000000000000000000000000000..2a25c863dbab04619e4ff51dd67612439d84f6f7 GIT binary patch literal 5571 zcmV;!6+G&RP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA6h5>%>9^eF z{EAB5>y)Iood3J`o_p>&ny%{}#0I+Jsh3a1{_~Ug>7lSE5%cIN@_$gGc|F1Kf>7*x zw};NB$kL6cj+A#D-Iwj}5$bKIKUclYepmum8chzMV@;N`hYUF9-+}05d;t zA6nAdM>;&Qe`V>~c}1jy(18M=qI}oYUI)MLg;VPH^fgW=9V9m>fSlC4*l{T?!^5cw zYweFzlMXTw6u<=DZ%f>LpqF%HNz+~8V3cC=A{#{M~)4UjvDM(QnF=Hm~<3I zX#t$>8D98m59z4N@%t+lSNTatJrosyw*4w;A=l8iskmrXO8~3h?mc`lK{`k_meu%= zuB{*)1yDr*T63>w1WlhBUqIhdPTEotf8!Nw5EN3v1gaT;mPtMwlrf)r`AFQ~kTsD7^R08N3N>;pprf)B88!Bf?6q+iJ z0MN7PB+~dyWe|Y&{1uO;kq+V*hUq+Z18ED3*aFa6qMpPc=^(BU4D0nJq%9z#dbnCY zkEiE6X#K8}h#4>9;JG;IiiVIQ0M2=MM9dkHU;>!4xBEi>2&8u&%B5ls#Q~>zlmk&OtL)=Y)PIZr<^-GEIT0iUJ&XvK}2oP-Q z7#6`Rg@6fYdSWX_`(+#n06+Zdz|VAumnjfhzf$n?y15VlTEBvD^3q)vKs1p;>sJ=z z)%PY`o`Jh5fcGyBm$Y<}4x%LGEggq043Ul-xV8vh^>)wUix}U7q^YY7ytBrgG(_$Q zpsJ;_D}lSb$T$^2Z&$qwyTvX{fo|N}ht`iwqC1hAvB!nP^iGceCA+$!!%5OXkckur zd;<-Yq~i#VjsTS{ooM|?9t`uSdcje@h;t)AMN3DI+deNu2+I6=Z=*xu5)O?3bq9LT z`VmU{MzrOv4izqOLI6j;h#zW0k0-*w(e~kY&pWX{VEYtkAdxD?-7W;gKz&uQ&6U7y z7XU^&AcbIe+^Eg+LhDBg!)_C@Q2^TZE2M=W1z@Wo*(HEc;bQhe#1b_7#sOOdP}Gc7 zDiDhaH{0S$v0eZtdq##vaJv_=nD|KQM7Q>> z(3(0(3qfqdS~Igu0B@a(dz_7|MifQY51g|sO2V==08V}oC$VZVV9f}C){i)hRVHVF z04iE=>W{cUWs3zGus{G9=#RKUcY-tup-=(fkS{fgbl0)Z#1_|5}Q=mkQG!TRz5`(0{0{o=2{?o~ z;pQ;uBiH!p$ymdO1JV?)q8tRM1aK*utl1-WuB-T#>W~lpSF|LOdT2+7(5d|{ZLFG6 zY(BxE5`e&;|3pfEY6fW|>}bzi_Jr7d<$ORh2$%~XKI{qa5>fzGots7k{Q|}tt3!U1 zQOsQ2B3l2~s(onv7GgZi#g#tN5r?8?^RqJMBY<$~*SA$0S4}#Ib)-_d&sZ1;h3R+D zWCYN5I#jF7DpFg~`t8E&)spGQD-xy#Y&Hc-id5XLdvleBp-Oh*)wEL&RgjJlm>FBCi|jo3`;F^8&H zTf#4{@B@|-E zr?IUc36lB8xO%AnNBhYYkAvYYtk>yi_Kl=Re-io_#c`H2FD-4jwTN`Ck!1uB#`-;; z4GSmV4-JNGrC*z0OD7R<>_1i}{kX0F`O~G?fsz{*#uwE1VLxeIhuBk~-OEZzi<?)U=Kw5$z{?Kir(uE$_p=g z?Y|-KAe}rSg$D_)kxBuxY50Y=AMr;$AMh6R$MGNm0rn^s?(HNkks;P|5L#!L2SQE2 z$l;0*X{by&G^GD@zraK2;V;Pc1rflScLfdsO6b7&wyw>1nAp=@4|xcV9#^n|RR?=B zjj{QI*fEmYbHLTuv)?QxEhTy8FQB(Cd{8a9e(~1;8NA+MP?nA-Z&x}v;;B0zw=Yx5 z99ab5@dS4Q1DT?YitdXIf^NKLNGk7HS^$Hx)P?%@L;aYmbUq z#n9XIO89&v6u_v98sZW?w?T;rxeFUXac_d}eC0w$0T^#s-GV1SxA78Ptvj80CsDi^-Aj?-gjom`yaoHk)C`6fD=3^_r+j0 zCFq$iN}m4hp!dv>%(Gs2*p^V0K+OT)j?{4?Cx;?lPeR@iV3Yw+q?2T2CtV?0;QRq}Be%UO zOr5wwP(lD_pr==Vdw)4;3Cr>CKyIOEhn)MqQ&Bj+7a3%3Uqx+8upVFWdvZ{Dl|YyIpp06oQgsMF!=b&bxHB45p)m$e*UF* zeNIFz0es`l9@1iEM6_@K&;>VtCi$k&RMZlH!R$SdiID!JVCThP7rf;|Nlu5;qnrS~ zhypkM>S~4Y2(1KNYROKuCO;XJ6MzBiZ0kE~gxM1~1iI9yoN@6cs3-vN+16;I07nI2 zdA`88B}GR`0YH5n5x)TbK|r3bbXG~PqL!fOZ5w=W5praVbC)RW^1xXoB|u#PEPET8 ze7CP_&MhP?}ll-vED05tIHhhO99!|_jF z4U-lNN=1EU<(5#)`~5p4PX%QP%q9AxuX9ve>BoOoLRw6y6!n>v@7)>pJ|KH8G#Y;R zYsf;76PGAPeS*1vUdTH=BFWM3Lip$ZQ_B^2FDP%Md{jrERi@&6E`=NOw zmXq?F*Zm_QspHX^uM6=9fbL zT%=jrO#cAZ&rNTGq)or&TawoWV&Z>59+Hy}IhsfD%zEZOck|0={S#>Z)->aP(*lTq zW5Of_79+4}VTiPBX5#|LA3D{C^PdS6jZXa0^s}L9I(tI>-OI{I%Vu7>oB0o6*iSA{ z0NL?2K~}@tmw;k&SZMl7=0A}Zv+`j-xfl}wucw^c<7$j~&aib6Br21MM{i^P6EHE$ z4l#HlfP;0o4xY>nyCJJaSUPe_jY(NCCdXDX%E)n_WTg*iw zVCl#ySwfNOw!{PHrSOi*vVEiO^OubsOGU7seP089YX2`vlS zvMC1mwdbSg`ZQr&0A&~tkrhy#(2++W>DlrC_=UA&3~p@Y5- zslxm)>^}~0TPa1`rU^!lQy>Naeii-kf(}eVejMbsQWktzEWrFK;B3eX;Gs;!90~`o&Eplf0a)24X_lD( zECOg?KXRcOL!8B!q3e@|@7|gv4>V4JfN0P2Gzg&U6H4|6_sIhlq=n={^NjFOEf3ee zG@N=cyGdskz?UmAHrkxP4)@R6CP29y6=Xqqc9X`TvmpNMxXVk=kisQ?Eg`1>I4OU^ zIsfpno6g4vj$qIm6?u#qM}R^JZFepDVBc8`doGlG0=T;dR|4iFTq?ATVLz1IH6x!H z=M%ttYta`(h4Z$E$=>Ms=-zy0Y&HcN&7qE%plQhh#H?n@gTt^Xr1A$u!@Vbmu* zSLiZ4Pzhj0v7;5>gvMT%C`Nr!Go3ES5A6dz|1hou=+Ly3CHb(XfIDCGTv$)Lg+(iX z*=6|cp~Yu|lm1W96z+V{Gpm#~h=IYZFK@z?04=w^VzH<4M$Gh2O~)e)vlRvb+z`Q) z04*nat=y|B-ib$E7^n&}ST)?Nw?UY{ z?2A0JycTGX@C6pSMCs96{y-2(A-F$KC_%N9$d>&rV6exr7 zQb`Lj<7!+tOnkvqk_0 z`&VLlNyH%z)>&q3mI+|(ypTt;?6)CEPBd-x9Ls8%T4}QSRy;S1*p9xHD%}Gm7JsvG zF@V^L!;F?~&CeWoi&)D(}>lM(i(BYP$domd_5ZuEk<|2m@3_D0T{HeFSX<}Cn6JuNnG0C!kH=;1Ypov zU%hs=Nez2M9ah%{43i)oXK{KBa6KPf9A5S|mVH*8L#xYH&bI7?7b|WGz#y7Pm9${> zD|P9wuPULbXKfoU3m^l=POAwIp<-@|Zw!o?QxHyGIu`;kKn*AbKd+k?0T>t$CB)I? zAhr)^#U+pFxL@rLOE5Esdudqn&1dsuj#qz=DESFOO7-&tM9v#c1 zNP*_%Hfb8a0x)>5ZD_>-EEFd;Z>%W0Z@z2$T&8d>fDAYt5*PlRdjhy!jE7i>aYLdp zEu`^p{RRSz0At`#APPd5eg=^o@5W=DUxsIkxn^!zKp^Wk5NQM$1M4XAh+#>OiI)mZ zNC6leIv=llx1V$nw>h$=6kMy_T|^Z?2CXIPNeq$>;tGMV-cUl?0wT5mGT@BJ9mJgT zOhN_$WI!L0lZds_&4WAwFu?O=4$xCyJx!vV22u$iLtFpIti2ddYCWgdmEXi!EN9_J zD1Z!?qscGr=^`DZFfMPZx*;OxSq*6gkRg@w_;%ph08Zl3=>e%vDM>DXF|?h%o@9b_ z5L0{seM>oMON}Z5$gp&O_s=ekkPecKyJq-5y4U(@q}-yG0LDO{=~SfgY%-y!05Y8I zOWpLc>Tc6B4_C}Dv%eAxuP7~mF@Ab7zVQRKB8!@r6gMo2kdDHj048v(E%EIGy`&=} z2kS~#J5qW`6i@&;nYp{8Jto7$nHkaAHo22~nSW3KR8;J`+A~brLSW45d+o0=Dgh_} zW`5p2w4{~CTowCQmad(L(;GHW0EIF%lG^-1-z(=mo}`0ggxCMjT&?-rWf4DSlPm}n zfL(OPlKajkp8oydiFhP^YKJw+m*({ZBe#SGzkg@sujd4BEb)%EYSb} literal 0 HcmV?d00001 diff --git a/assembly/cicd/jenkins/test-builds.groovy b/assembly/cicd/jenkins/test-builds.groovy deleted file mode 100644 index 0b5ab7a38..000000000 --- a/assembly/cicd/jenkins/test-builds.groovy +++ /dev/null @@ -1,237 +0,0 @@ -pipeline { - - agent none - stages { - stage('Run Builds') { - parallel { - stage('Ubuntu 20.04 x86-64 (shared)') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-ubuntu-shared.sh . - chmod +x build-ubuntu-shared.sh - ./build-ubuntu-shared.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-x86_64-linux-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86_64-linux-shared.zip' - } - } - } - stage('Ubuntu 20.04 x86-64 (portable)') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-linux-x86-64-nix.sh . - chmod +x build-linux-x86-64-nix.sh - ./build-linux-x86-64-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-x86-64-linux-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-linux-portable.zip' - } - } - } - stage('Ubuntu 20.04 aarch64 (shared)') { - agent { - label 'Ubuntu_arm64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-ubuntu-shared.sh . - chmod +x build-ubuntu-shared.sh - ./build-ubuntu-shared.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-linux-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-linux-shared.zip' - } - } - } - stage('Ubuntu 20.04 aarch64 (portable)') { - agent { - label 'Ubuntu_arm64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-linux-arm64-nix.sh . - chmod +x build-linux-arm64-nix.sh - ./build-linux-arm64-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-linux-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-linux-portable.zip' - } - } - } - stage('macOS 12.7 x86-64 (shared)') { - agent { - label 'macOS_12.7_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-macos-shared.sh . - chmod +x build-macos-shared.sh - ./build-macos-shared.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-x86-64-macos-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-macos-shared.zip' - } - } - } - stage('macOS 12.7 x86-64 (portable)') { - agent { - label 'macOS_12.7_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-macos-nix.sh . - chmod +x build-macos-nix.sh - ./build-macos-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-x86-64-macos-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-macos-portable.zip' - } - } - } - stage('macOS 12.6 aarch64 (shared)') { - agent { - label 'macOS_12.6-arm64-m1' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-macos-shared.sh . - chmod +x build-macos-shared.sh - ./build-macos-shared.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-macos-m1-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-macos-m1-shared.zip' - } - } - } - stage('macOS 12.6 aarch64 (portable)') { - agent { - label 'macOS_12.6-arm64-m1' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/nix/build-macos-nix.sh . - chmod +x build-macos-nix.sh - ./build-macos-nix.sh - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-macos-portable ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-macos-portable.zip' - } - } - } - stage('macOS 13.2 aarch64 (shared)') { - agent { - label 'macOS_13.2-arm64-m2' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/native/build-macos-shared.sh . - chmod +x build-macos-shared.sh - ./build-macos-shared.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-arm64-macos-m2-shared ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-arm64-macos-m2-shared.zip' - } - } - } - stage('Windows Server 2022 x86-64') { - agent { - label 'Windows_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - bat ''' - copy assembly\\native\\build-windows.bat . - build-windows.bat - ''' - bat ''' - cd artifacts - zip -9r ton-x86-64-windows ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-x86-64-windows.zip' - } - } - } - stage('Android Tonlib') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/android/build-android-tonlib.sh . - chmod +x build-android-tonlib.sh - ./build-android-tonlib.sh -a - ''' - sh ''' - cd artifacts/tonlib-android-jni - zip -9r ton-android-tonlib ./* - ''' - archiveArtifacts artifacts: 'artifacts/tonlib-android-jni/ton-android-tonlib.zip' - } - } - } - stage('WASM fift func emulator') { - agent { - label 'Ubuntu_x86-64' - } - steps { - timeout(time: 180, unit: 'MINUTES') { - sh ''' - cp assembly/wasm/fift-func-wasm-build-ubuntu.sh . - chmod +x fift-func-wasm-build-ubuntu.sh - ./fift-func-wasm-build-ubuntu.sh -a - ''' - sh ''' - cd artifacts - zip -9r ton-wasm-binaries ./* - ''' - archiveArtifacts artifacts: 'artifacts/ton-wasm-binaries.zip' - } - } - } - } - } - } -} diff --git a/assembly/native/build-ubuntu-appimages.sh b/assembly/native/build-ubuntu-appimages.sh new file mode 100644 index 000000000..4e63234d9 --- /dev/null +++ b/assembly/native/build-ubuntu-appimages.sh @@ -0,0 +1,109 @@ +#/bin/bash + +with_tests=false +with_artifacts=false + + +while getopts 'ta' flag; do + case "${flag}" in + t) with_tests=true ;; + a) with_artifacts=true ;; + *) break + ;; + esac +done + +if [ ! -d "build" ]; then + mkdir build + cd build +else + cd build + rm -rf .ninja* CMakeCache.txt +fi + +export CC=$(which clang-16) +export CXX=$(which clang++-16) +export CCACHE_DISABLE=1 + +if [ ! -d "openssl_3" ]; then + git clone https://github.com/openssl/openssl openssl_3 + cd openssl_3 + opensslPath=`pwd` + git checkout openssl-3.1.4 + ./config + make build_libs -j12 + test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } + cd .. +else + opensslPath=$(pwd)/openssl_3 + echo "Using compiled openssl_3" +fi + +cmake -GNinja .. \ +-DCMAKE_BUILD_TYPE=Release \ +-DPORTABLE=1 \ +-DOPENSSL_ROOT_DIR=$opensslPath \ +-DOPENSSL_INCLUDE_DIR=$opensslPath/include \ +-DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.so + + +test $? -eq 0 || { echo "Can't configure ton"; exit 1; } + +if [ "$with_tests" = true ]; then +ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-cli \ + validator-engine lite-client pow-miner validator-engine-console blockchain-explorer \ + generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ + adnl-proxy create-state emulator 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 test-emulator proxy-liteserver + test $? -eq 0 || { echo "Can't compile ton"; exit 1; } +else +ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-cli \ + validator-engine lite-client pow-miner validator-engine-console blockchain-explorer \ + generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ + adnl-proxy create-state emulator proxy-liteserver + test $? -eq 0 || { echo "Can't compile ton"; exit 1; } +fi + +# simple binaries' test +./storage/storage-daemon/storage-daemon -V || exit 1 +./validator-engine/validator-engine -V || exit 1 +./lite-client/lite-client -V || exit 1 +./crypto/fift -V || exit 1 + +echo validator-engine +ldd ./validator-engine/validator-engine || exit 1 +ldd ./validator-engine-console/validator-engine-console || exit 1 +ldd ./crypto/fift || exit 1 +echo blockchain-explorer +ldd ./blockchain-explorer/blockchain-explorer || exit 1 +echo libtonlibjson.so +ldd ./tonlib/libtonlibjson.so.0.5 || exit 1 +echo libemulator.so +ldd ./emulator/libemulator.so || exit 1 + +cd .. + +if [ "$with_artifacts" = true ]; then + rm -rf artifacts + mkdir artifacts + mv build/tonlib/libtonlibjson.so.0.5 build/tonlib/libtonlibjson.so + cp build/storage/storage-daemon/storage-daemon build/storage/storage-daemon/storage-daemon-cli \ + build/crypto/fift build/crypto/tlbc build/crypto/func build/tolk/tolk build/crypto/create-state build/blockchain-explorer/blockchain-explorer \ + build/validator-engine-console/validator-engine-console build/tonlib/tonlib-cli build/utils/proxy-liteserver \ + build/tonlib/libtonlibjson.so build/http/http-proxy build/rldp-http-proxy/rldp-http-proxy \ + build/dht-server/dht-server build/lite-client/lite-client build/validator-engine/validator-engine \ + build/utils/generate-random-id build/utils/json2tlo build/adnl/adnl-proxy build/emulator/libemulator.so \ + artifacts + test $? -eq 0 || { echo "Can't copy final binaries"; exit 1; } + cp -R crypto/smartcont artifacts + cp -R crypto/fift/lib artifacts + chmod -R +x artifacts/* +fi + +if [ "$with_tests" = true ]; then + cd build +# ctest --output-on-failure -E "test-catchain|test-actors|test-smartcont|test-adnl|test-validator-session-state|test-dht|test-rldp" + ctest --output-on-failure --timeout 1800 +fi diff --git a/assembly/native/build-ubuntu-portable-libs.sh b/assembly/native/build-ubuntu-portable-libs.sh new file mode 100644 index 000000000..2f0a1ba4d --- /dev/null +++ b/assembly/native/build-ubuntu-portable-libs.sh @@ -0,0 +1,132 @@ +#/bin/bash + +#sudo apt-get update +#sudo apt-get install -y build-essential git cmake ninja-build automake libtool texinfo autoconf libc++-dev libc++abi-dev + +with_artifacts=false + +while getopts 'ta' flag; do + case "${flag}" in + a) with_artifacts=true ;; + *) break + ;; + esac +done + +if [ ! -d "build" ]; then + mkdir build + cd build +else + cd build + rm -rf .ninja* CMakeCache.txt +fi + +export CC=$(which clang) +export CXX=$(which clang++) +export CCACHE_DISABLE=1 + +if [ ! -d "lz4" ]; then +git clone https://github.com/lz4/lz4.git +cd lz4 +lz4Path=`pwd` +git checkout v1.9.4 +CFLAGS="-fPIC" make -j12 +test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } +cd .. +# ./lib/liblz4.a +# ./lib +else + lz4Path=$(pwd)/lz4 + echo "Using compiled lz4" +fi + +if [ ! -d "libsodium" ]; then + export LIBSODIUM_FULL_BUILD=1 + git clone https://github.com/jedisct1/libsodium.git + cd libsodium + sodiumPath=`pwd` + git checkout 1.0.18 + ./autogen.sh + ./configure --with-pic --enable-static + make -j12 + test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } + cd .. +else + sodiumPath=$(pwd)/libsodium + echo "Using compiled libsodium" +fi + +if [ ! -d "openssl_3" ]; then + git clone https://github.com/openssl/openssl openssl_3 + cd openssl_3 + opensslPath=`pwd` + git checkout openssl-3.1.4 + ./config + make build_libs -j12 + test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } + cd .. +else + opensslPath=$(pwd)/openssl_3 + echo "Using compiled openssl_3" +fi + +if [ ! -d "zlib" ]; then + git clone https://github.com/madler/zlib.git + cd zlib + zlibPath=`pwd` + ./configure --static + make -j12 + test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } + cd .. +else + zlibPath=$(pwd)/zlib + echo "Using compiled zlib" +fi + +if [ ! -d "libmicrohttpd" ]; then + git clone https://git.gnunet.org/libmicrohttpd.git + cd libmicrohttpd + libmicrohttpdPath=`pwd` + ./autogen.sh + ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic + make -j12 + test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } + cd .. +else + libmicrohttpdPath=$(pwd)/libmicrohttpd + echo "Using compiled libmicrohttpd" +fi + +cmake -GNinja .. \ +-DPORTABLE=1 \ +-DCMAKE_BUILD_TYPE=Release \ +-DOPENSSL_FOUND=1 \ +-DOPENSSL_INCLUDE_DIR=$opensslPath/include \ +-DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.a \ +-DZLIB_FOUND=1 \ +-DZLIB_INCLUDE_DIR=$zlibPath \ +-DZLIB_LIBRARIES=$zlibPath/libz.a \ +-DSODIUM_FOUND=1 \ +-DSODIUM_INCLUDE_DIR=$sodiumPath/src/libsodium/include \ +-DSODIUM_LIBRARY_RELEASE=$sodiumPath/src/libsodium/.libs/libsodium.a \ +-DMHD_FOUND=1 \ +-DMHD_INCLUDE_DIR=$libmicrohttpdPath/src/include \ +-DMHD_LIBRARY=$libmicrohttpdPath/src/microhttpd/.libs/libmicrohttpd.a \ +-DLZ4_FOUND=1 \ +-DLZ4_INCLUDE_DIRS=$lz4Path/lib \ +-DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a + + + +test $? -eq 0 || { echo "Can't configure ton"; exit 1; } + +ninja tonlibjson emulator +test $? -eq 0 || { echo "Can't compile ton"; exit 1; } + +cd .. + +mkdir artifacts +mv build/tonlib/libtonlibjson.so.0.5 build/tonlib/libtonlibjson.so +cp build/tonlib/libtonlibjson.so \ + build/emulator/libemulator.so \ + artifacts diff --git a/assembly/native/build-ubuntu-portable.sh b/assembly/native/build-ubuntu-portable.sh index 389c114e6..16e77ac8d 100644 --- a/assembly/native/build-ubuntu-portable.sh +++ b/assembly/native/build-ubuntu-portable.sh @@ -1,7 +1,7 @@ #/bin/bash #sudo apt-get update -#sudo apt-get install -y build-essential git cmake ninja-build automake libtool texinfo autoconf +#sudo apt-get install -y build-essential git cmake ninja-build automake libtool texinfo autoconf libc++-dev libc++abi-dev with_tests=false with_artifacts=false @@ -24,8 +24,8 @@ else rm -rf .ninja* CMakeCache.txt fi -export CC=$(which clang-16) -export CXX=$(which clang++-16) +export CC=$(which clang) +export CXX=$(which clang++) export CCACHE_DISABLE=1 if [ ! -d "lz4" ]; then @@ -33,7 +33,7 @@ git clone https://github.com/lz4/lz4.git cd lz4 lz4Path=`pwd` git checkout v1.9.4 -make -j12 +CFLAGS="-fPIC" make -j12 test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } cd .. # ./lib/liblz4.a diff --git a/emulator/CMakeLists.txt b/emulator/CMakeLists.txt index 61de96d38..66d8309a5 100644 --- a/emulator/CMakeLists.txt +++ b/emulator/CMakeLists.txt @@ -35,7 +35,12 @@ else() add_library(emulator STATIC ${EMULATOR_SOURCE} ${EMULATOR_HEADERS}) endif() -target_link_libraries(emulator PUBLIC emulator_static git) +if (PORTABLE AND NOT APPLE) + target_link_libraries(emulator PUBLIC emulator_static git -static-libgcc -static-libstdc++) +else() + target_link_libraries(emulator PUBLIC emulator_static git) +endif() + generate_export_header(emulator EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/emulator_export.h) target_include_directories(emulator PUBLIC $ diff --git a/tonlib/CMakeLists.txt b/tonlib/CMakeLists.txt index 0855012cc..9a56e5119 100644 --- a/tonlib/CMakeLists.txt +++ b/tonlib/CMakeLists.txt @@ -98,7 +98,12 @@ else() add_library(tonlibjson STATIC ${TONLIB_JSON_SOURCE} ${TONLIB_JSON_HEADERS}) endif() -target_link_libraries(tonlibjson PRIVATE tonlibjson_private) +if (PORTABLE AND NOT APPLE) + target_link_libraries(tonlibjson PRIVATE tonlibjson_private -static-libgcc -static-libstdc++) +else() + target_link_libraries(tonlibjson PRIVATE tonlibjson_private) +endif() + generate_export_header(tonlibjson EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/tonlib/tonlibjson_export.h) if (!BUILD_SHARED_LIBS) target_compile_definitions(tonlibjson PUBLIC TONLIBJSON_STATIC_DEFINE)