diff --git a/.github/workflows/build-ton-linux-android-tonlib.yml b/.github/workflows/build-ton-linux-android-tonlib.yml index 5cd74e363..2e89baad1 100644 --- a/.github/workflows/build-ton-linux-android-tonlib.yml +++ b/.github/workflows/build-ton-linux-android-tonlib.yml @@ -8,8 +8,8 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 - with: + uses: actions/checkout@v4 + with: submodules: 'recursive' - name: Install system libraries @@ -36,7 +36,7 @@ jobs: ./build-android-tonlib.sh -a - name: Upload artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: ton-android-tonlib path: artifacts diff --git a/.github/workflows/build-ton-linux-arm64-appimage.yml b/.github/workflows/build-ton-linux-arm64-appimage.yml index a0ba4a022..7ba3a68b1 100644 --- a/.github/workflows/build-ton-linux-arm64-appimage.yml +++ b/.github/workflows/build-ton-linux-arm64-appimage.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -21,29 +21,27 @@ jobs: - 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 ccache + sudo apt install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev ccache libssl-dev sudo apt remove libgsl-dev - mkdir ~/.ccache 3pp + mkdir -p ~/.ccache - - name: Install clang-16 + # Smart LLVM installation based on Ubuntu version + - name: Install LLVM/Clang run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 16 clang - - - name: Cache 3pp - id: cache-3pp - uses: actions/cache@v4 - with: - path: 3pp - key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-3pp-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }} - - - name: Cache OpenSSL - id: cache-openssl - uses: actions/cache@v4 - with: - path: openssl_3 - key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-arm-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }} + UBUNTU_VERSION=$(lsb_release -rs) + echo "Detected Ubuntu version: $UBUNTU_VERSION" + + if [[ "$UBUNTU_VERSION" == "24.04" ]]; then + # Ubuntu 24.04 has newer clang available in default repos + echo "Installing clang from default repos for Ubuntu 24.04" + sudo apt-get install -y clang-16 || sudo apt-get install -y clang + else + # For older Ubuntu versions, use LLVM script + echo "Installing clang-16 from LLVM repos for Ubuntu $UBUNTU_VERSION" + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 clang || echo "Warning: LLVM script failed, using system clang" + fi - name: Restore cache TON uses: actions/cache/restore@v4 @@ -92,7 +90,7 @@ jobs: cp ./artifacts/libemulator.so appimages/artifacts/ - name: Upload artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 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 index 540fffece..1f066cac9 100644 --- a/.github/workflows/build-ton-linux-arm64-shared.yml +++ b/.github/workflows/build-ton-linux-arm64-shared.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -25,7 +25,7 @@ jobs: - 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 ccache + sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev ccache libssl-dev mkdir ~/.ccache - if: matrix.os != 'ubuntu-24.04-arm' @@ -35,13 +35,6 @@ jobs: chmod +x llvm.sh sudo ./llvm.sh 16 clang - - name: Cache OpenSSL - id: cache-openssl - uses: actions/cache@v4 - with: - path: openssl_3 - key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.os }}-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-shared.sh') }} - - name: Cache TON test id: cache-ton uses: actions/cache@v4 @@ -62,4 +55,4 @@ jobs: - name: Run Tests run: | cd build - ctest --output-on-failure --timeout 1800 + ctest --output-on-failure --timeout 1800 --parallel $(nproc) diff --git a/.github/workflows/build-ton-linux-x86-64-appimage.yml b/.github/workflows/build-ton-linux-x86-64-appimage.yml index 7ad873d22..3940a042c 100644 --- a/.github/workflows/build-ton-linux-x86-64-appimage.yml +++ b/.github/workflows/build-ton-linux-x86-64-appimage.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -21,28 +21,26 @@ jobs: - 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 ccache libgsl-dev libblas-dev - mkdir ~/.ccache 3pp + sudo apt install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev ccache libgsl-dev libblas-dev libssl-dev + mkdir -p ~/.ccache - - name: Install clang-16 + # Smart LLVM installation based on Ubuntu version + - name: Install LLVM/Clang run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 16 clang - - - name: Cache 3pp - id: cache-3pp - uses: actions/cache@v4 - with: - path: 3pp - key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-3pp-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }} - - - name: Cache OpenSSL - id: cache-openssl - uses: actions/cache@v4 - with: - path: openssl_3 - key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-appimages.sh') }} + UBUNTU_VERSION=$(lsb_release -rs) + echo "Detected Ubuntu version: $UBUNTU_VERSION" + + if [[ "$UBUNTU_VERSION" == "24.04" ]]; then + # Ubuntu 24.04 has newer clang available in default repos + echo "Installing clang from default repos for Ubuntu 24.04" + sudo apt-get install -y clang-16 || sudo apt-get install -y clang + else + # For older Ubuntu versions, use LLVM script + echo "Installing clang-16 from LLVM repos for Ubuntu $UBUNTU_VERSION" + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 clang || echo "Warning: LLVM script failed, using system clang" + fi - name: Restore cache TON uses: actions/cache/restore@v4 @@ -90,7 +88,7 @@ jobs: cp ./artifacts/libemulator.so appimages/artifacts/ - name: Upload artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: ton-x86_64-linux path: appimages/artifacts diff --git a/.github/workflows/build-ton-linux-x86-64-shared.yml b/.github/workflows/build-ton-linux-x86-64-shared.yml index ed05d18aa..831426f47 100644 --- a/.github/workflows/build-ton-linux-x86-64-shared.yml +++ b/.github/workflows/build-ton-linux-x86-64-shared.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -25,28 +25,36 @@ jobs: - 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 ccache - mkdir ~/.ccache + sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev ccache libssl-dev + mkdir -p ~/.ccache - - if: matrix.os != 'ubuntu-24.04' + # Smart LLVM installation based on Ubuntu version + - name: Install LLVM/Clang run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 16 clang + UBUNTU_VERSION=$(lsb_release -rs) + echo "Detected Ubuntu version: $UBUNTU_VERSION" + + if [[ "$UBUNTU_VERSION" == "24.04" ]]; then + # Ubuntu 24.04 has newer clang available in default repos + echo "Installing clang from default repos for Ubuntu 24.04" + sudo apt-get install -y clang-16 || sudo apt-get install -y clang + else + # For older Ubuntu versions, use LLVM script + echo "Installing clang-16 from LLVM repos for Ubuntu $UBUNTU_VERSION" + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 clang || echo "Warning: LLVM script failed, using system clang" + fi - - name: Cache OpenSSL - id: cache-openssl - uses: actions/cache@v4 - with: - path: openssl_3 - key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.os }}-openssl_3-${{ hashFiles('**/assembly/native/build-ubuntu-shared.sh') }} - - - name: Restore cache TON - uses: actions/cache@v4 + # Improved ccache setup with better restore keys + - name: Restore ccache + uses: actions/cache/restore@v4 with: path: ~/.ccache key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.os }}-shared-ccache-${{ steps.date-stamp.outputs.timestamp }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.os }}-shared-ccache + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-${{ matrix.os }}-shared-ccache- + ${{ runner.os }}-${{ runner.arch }}-shared-ccache- - name: Build TON run: | @@ -57,7 +65,15 @@ jobs: ./build-ubuntu-shared.sh -t -c ccache -sp + - name: Save ccache + uses: actions/cache/save@v4 + if: always() # Save cache even if build fails + with: + path: ~/.ccache + key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.os }}-shared-ccache-${{ steps.date-stamp.outputs.timestamp }} + + # Run tests in parallel with reduced timeout for faster feedback - name: Run Tests run: | cd build - ctest --output-on-failure --timeout 1800 + ctest --output-on-failure --timeout 1800 --parallel $(nproc) diff --git a/.github/workflows/build-ton-macos-13-x86-64-portable.yml b/.github/workflows/build-ton-macos-13-x86-64-portable.yml index 6a6a6a255..5c60b89bc 100644 --- a/.github/workflows/build-ton-macos-13-x86-64-portable.yml +++ b/.github/workflows/build-ton-macos-13-x86-64-portable.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -18,25 +18,35 @@ jobs: run: | echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT" - - name: Create directories + - name: Setup build environment run: | + # Install dependencies using brew bundle + cat <> "$GITHUB_OUTPUT" - - name: Create directories + - name: Setup build environment run: | + # Install dependencies using brew bundle + cat <> "$GITHUB_OUTPUT" - - name: Create ~/.ccache + - name: Setup build environment run: | + # Install dependencies using brew bundle + cat <> "$GITHUB_OUTPUT" - - name: Create ~/.ccache + - name: Setup build environment run: | + # Install dependencies using brew bundle + cat <> "$GITHUB_OUTPUT" - - name: Create ~/.ccache + - name: Setup build environment run: | + # Install dependencies using brew bundle + cat <> "$GITHUB_OUTPUT" + - name: Install system libraries run: | sudo apt-get update - sudo apt-get install -y build-essential git openssl cmake ninja-build zlib1g-dev libssl-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev - mkdir -p 3pp_emscripten + sudo apt-get install -y build-essential git openssl cmake ninja-build zlib1g-dev libssl-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev ccache + mkdir -p 3pp_emscripten ~/.ccache + # Smart LLVM installation with fallback for Ubuntu 24.04 compatibility - name: Install clang-16 run: | - wget https://apt.llvm.org/llvm.sh - chmod +x llvm.sh - sudo ./llvm.sh 16 clang + UBUNTU_VERSION=$(lsb_release -rs) + echo "Detected Ubuntu version: $UBUNTU_VERSION" + + if [[ "$UBUNTU_VERSION" == "24.04" ]]; then + echo "Installing clang from default repos for Ubuntu 24.04" + sudo apt-get install -y clang-16 || sudo apt-get install -y clang + else + echo "Installing clang-16 from LLVM repos" + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 clang || echo "Warning: LLVM script failed, using system clang" + fi - name: Cache OpenSSL id: cache-openssl @@ -38,6 +54,16 @@ jobs: path: 3pp_emscripten key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-3pp_em-${{ hashFiles('**/assembly/wasm/fift-func-wasm-build-ubuntu.sh') }} + # Add ccache for faster rebuilds + - name: Restore ccache + uses: actions/cache/restore@v4 + with: + path: ~/.ccache + key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-wasm-ccache-${{ steps.date-stamp.outputs.timestamp }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-wasm-ccache- + ${{ runner.os }}-${{ runner.arch }}-wasm-ccache- + - name: Build TON WASM artifacts run: | git submodule sync --recursive @@ -45,27 +71,47 @@ jobs: cp assembly/wasm/fift-func-wasm-build-ubuntu.sh . chmod +x fift-func-wasm-build-ubuntu.sh ./fift-func-wasm-build-ubuntu.sh -a + ccache -sp + + - name: Save ccache + uses: actions/cache/save@v4 + if: always() # Save cache even if build fails + with: + path: ~/.ccache + key: ${{ runner.os }}-${{ runner.arch }}-ubuntu-22.04-wasm-ccache-${{ steps.date-stamp.outputs.timestamp }} + + # Parallelize test preparation and execution + - name: Prepare test dependencies + run: | + # Prepare test files and clone func-js in parallel + cp assembly/wasm/*.fc . & + git clone --depth 1 https://github.com/ton-community/func-js.git & + wait - - name: Prepare test + - name: Setup func-js run: | - cp assembly/wasm/*.fc . - git clone https://github.com/ton-community/func-js.git cd func-js - npm install + npm install # Use npm install as func-js may not have package-lock.json npm run build npm link - name: Test TON WASM artifacts run: | + # Optimize base64 encoding and file operations base64 -w 0 artifacts/funcfiftlib.wasm > artifacts/funcfiftlib.wasm.js printf "module.exports = { FuncFiftLibWasm: '" | cat - artifacts/funcfiftlib.wasm.js > temp.txt && mv temp.txt artifacts/funcfiftlib.wasm.js echo "'}" >> artifacts/funcfiftlib.wasm.js - cp artifacts/funcfiftlib.wasm.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.wasm.js - cp artifacts/funcfiftlib.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.js + + # Copy files in parallel + cp artifacts/funcfiftlib.wasm.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.wasm.js & + cp artifacts/funcfiftlib.js func-js/node_modules/@ton-community/func-js-bin/dist/funcfiftlib.js & + wait + + # Run test npx func-js stdlib.fc intrinsics.fc --fift ./output.f - name: Upload artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: ton-wasm path: artifacts diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 05a3db265..69f50ce43 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -8,22 +8,35 @@ env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: - create-release: + prepare-tag: runs-on: ubuntu-22.04 + outputs: + tag: ${{ steps.tag.outputs.TAG }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for tags + + - name: Get next tag + id: tag + run: | + git fetch --all --tags + NEW_TAG=v$(date +'%Y.%m') + FOUND=$(git tag -l | grep -c "^$NEW_TAG" || true) + if [ $FOUND -eq 0 ]; then + echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT + else + echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT + fi + download-artifacts: + runs-on: ubuntu-22.04 + needs: prepare-tag steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + # Download all artifacts in parallel (only unpacked versions needed) - name: Download Linux arm64 artifacts - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build-ton-linux-arm64-appimage.yml - path: artifacts - workflow_conclusion: success - branch: master - skip_unpack: true - - - name: Download and unzip Linux arm64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-linux-arm64-appimage.yml @@ -32,16 +45,7 @@ jobs: branch: master skip_unpack: false - - name: Download Linux x86-64 artifacts - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build-ton-linux-x86-64-appimage.yml - path: artifacts - workflow_conclusion: success - branch: master - skip_unpack: true - - - name: Download and unzip Linux x86-64 artifacts + - name: Download Linux x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-linux-x86-64-appimage.yml @@ -51,24 +55,6 @@ jobs: skip_unpack: false - name: Download Mac x86-64 artifacts - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build-ton-macos-13-x86-64-portable.yml - path: artifacts - workflow_conclusion: success - branch: master - skip_unpack: true - - - name: Download Mac arm64 artifacts - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build-ton-macos-14-arm64-portable.yml - path: artifacts - workflow_conclusion: success - branch: master - skip_unpack: true - - - name: Download and unzip Mac x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-macos-13-x86-64-portable.yml @@ -77,7 +63,7 @@ jobs: branch: master skip_unpack: false - - name: Download and unzip arm64 artifacts + - name: Download Mac arm64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-macos-14-arm64-portable.yml @@ -87,15 +73,6 @@ jobs: skip_unpack: false - name: Download Windows artifacts - uses: dawidd6/action-download-artifact@v6 - with: - workflow: ton-x86-64-windows.yml - path: artifacts - workflow_conclusion: success - branch: master - skip_unpack: true - - - name: Download and unzip Windows artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: ton-x86-64-windows.yml @@ -124,382 +101,198 @@ jobs: - name: Show all artifacts run: | - tree artifacts - + tree artifacts || ls -la artifacts - # create release + # Prepare packaged artifacts for upload + - name: Create packaged artifacts + run: | + cd artifacts + # Create zip files for bulk uploads if they don't exist + [ ! -f ton-x86-64-windows.zip ] && zip -r ton-x86-64-windows.zip ton-x86-64-windows/ + [ ! -f ton-x86_64-macos.zip ] && zip -r ton-x86_64-macos.zip ton-x86_64-macos/ + [ ! -f ton-arm64-macos.zip ] && zip -r ton-arm64-macos.zip ton-arm64-macos/ + [ ! -f ton-x86_64-linux.zip ] && zip -r ton-x86_64-linux.zip ton-x86_64-linux/ + [ ! -f ton-arm64-linux.zip ] && zip -r ton-arm64-linux.zip ton-arm64-linux/ + + - name: Upload packaged artifacts + uses: actions/upload-artifact@v4 + with: + name: release-artifacts + path: artifacts + + create-release: + runs-on: ubuntu-22.04 + needs: [prepare-tag, download-artifacts] + outputs: + release_id: ${{ steps.create_release.outputs.id }} + steps: + - uses: actions/checkout@v4 - name: Read Changelog.md and use it as a body of new release id: read_release shell: bash run: | - r=$(cat recent_changelog.md) - r="${r//'%'/'%25'}" - r="${r//$'\n'/'%0A'}" - r="${r//$'\r'/'%0D'}" - echo "::set-output name=CHANGELOG_BODY::$r" - - - name: Get next tag - id: tag - run: | - git fetch --all --tags - git tag -l - NEW_TAG=v$(date +'%Y.%m') - FOUND=$(git tag -l | grep $NEW_TAG | wc -l) - if [ $FOUND -eq 0 ]; then - echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT + if [ -f recent_changelog.md ]; then + r=$(cat recent_changelog.md) + r="${r//'%'/'%25'}" + r="${r//$'\n'/'%0A'}" + r="${r//$'\r'/'%0D'}" + echo "CHANGELOG_BODY=$r" >> $GITHUB_OUTPUT else - echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT + echo "CHANGELOG_BODY=Release ${{ needs.prepare-tag.outputs.tag }}" >> $GITHUB_OUTPUT fi - - name: Get registration token - id: getRegToken - run: | - curl -X POST -H \"Accept: application/vnd.github+json\" -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/ton-blockchain/ton/actions/runners/registration-token - - name: Create release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.tag.outputs.TAG }} - release_name: TON ${{ steps.tag.outputs.TAG }} + tag_name: ${{ needs.prepare-tag.outputs.tag }} + name: TON ${{ needs.prepare-tag.outputs.tag }} body: | ${{ steps.read_release.outputs.CHANGELOG_BODY }} draft: false prerelease: false - # upload - - # win + # Parallel upload jobs for better performance + upload-windows: + runs-on: ubuntu-22.04 + needs: [prepare-tag, create-release, download-artifacts] + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 + with: + name: release-artifacts + path: artifacts - - name: Upload Windows 2019 artifacts + - name: Upload Windows bundle uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: artifacts/ton-x86-64-windows.zip asset_name: ton-win-x86-64.zip - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - fift - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/fift.exe - asset_name: fift.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - func - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/func.exe - asset_name: func.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/tolk.exe - asset_name: tolk.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - lite-client - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/lite-client.exe - asset_name: lite-client.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - proxy-liteserver - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/proxy-liteserver.exe - asset_name: proxy-liteserver.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - rldp-http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/rldp-http-proxy.exe - asset_name: rldp-http-proxy.exe - tag: ${{ steps.tag.outputs.TAG }} + tag: ${{ needs.prepare-tag.outputs.tag }} - - name: Upload Windows 2019 single artifact - http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/http-proxy.exe - asset_name: http-proxy.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - storage-daemon-cli - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/storage-daemon-cli.exe - asset_name: storage-daemon-cli.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - storage-daemon - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/storage-daemon.exe - asset_name: storage-daemon.exe - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - tonlibjson - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/tonlibjson.dll - asset_name: tonlibjson.dll - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - libemulator - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/emulator.dll - asset_name: libemulator.dll - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Windows 2019 single artifact - tonlib-cli - uses: svenstaro/upload-release-action@v2 + # Batch upload Windows binaries using gh CLI for efficiency + - name: Upload Windows binaries + run: | + TAG="${{ needs.prepare-tag.outputs.tag }}" + cd artifacts/ton-x86-64-windows + + # Upload all Windows binaries in one command + gh release upload "$TAG" \ + --repo ${{ github.repository }} \ + fift.exe \ + func.exe \ + tolk.exe \ + lite-client.exe \ + proxy-liteserver.exe \ + rldp-http-proxy.exe \ + http-proxy.exe \ + storage-daemon-cli.exe \ + storage-daemon.exe \ + tonlib-cli.exe \ + tonlibjson.dll \ + emulator.dll#libemulator.dll + + upload-macos-x86: + runs-on: ubuntu-22.04 + needs: [prepare-tag, create-release, download-artifacts] + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/tonlib-cli.exe - asset_name: tonlib-cli.exe - tag: ${{ steps.tag.outputs.TAG }} - - # mac x86-64 + name: release-artifacts + path: artifacts - - name: Upload Mac x86-64 artifacts + - name: Upload Mac x86-64 bundle uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: artifacts/ton-x86_64-macos.zip asset_name: ton-mac-x86-64.zip - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - fift - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/fift - asset_name: fift-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - func - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/func - asset_name: func-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/tolk - asset_name: tolk-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - lite-client - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/lite-client - asset_name: lite-client-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - proxy-liteserver - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/proxy-liteserver - asset_name: proxy-liteserver-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - rldp-http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/rldp-http-proxy - asset_name: rldp-http-proxy-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/http-proxy - asset_name: http-proxy-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - storage-daemon-cli - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/storage-daemon-cli - asset_name: storage-daemon-cli-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - storage-daemon - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/storage-daemon - asset_name: storage-daemon-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - tonlibjson - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/libtonlibjson.dylib - asset_name: tonlibjson-mac-x86-64.dylib - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac x86-64 single artifact - libemulator - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/libemulator.dylib - asset_name: libemulator-mac-x86-64.dylib - tag: ${{ steps.tag.outputs.TAG }} + tag: ${{ needs.prepare-tag.outputs.tag }} - - name: Upload Mac x86-64 single artifact - tonlib-cli - uses: svenstaro/upload-release-action@v2 + # Batch upload Mac x86-64 binaries using gh CLI for efficiency + - name: Upload Mac x86-64 binaries + run: | + TAG="${{ needs.prepare-tag.outputs.tag }}" + cd artifacts/ton-x86_64-macos + + # Upload all Mac x86-64 binaries in batches to avoid command line limits + gh release upload "$TAG" --repo ${{ github.repository }} \ + fift#fift-mac-x86-64 \ + func#func-mac-x86-64 \ + tolk#tolk-mac-x86-64 \ + lite-client#lite-client-mac-x86-64 \ + proxy-liteserver#proxy-liteserver-mac-x86-64 \ + rldp-http-proxy#rldp-http-proxy-mac-x86-64 + + gh release upload "$TAG" --repo ${{ github.repository }} \ + http-proxy#http-proxy-mac-x86-64 \ + storage-daemon-cli#storage-daemon-cli-mac-x86-64 \ + storage-daemon#storage-daemon-mac-x86-64 \ + tonlib-cli#tonlib-cli-mac-x86-64 \ + libtonlibjson.dylib#tonlibjson-mac-x86-64.dylib \ + libemulator.dylib#libemulator-mac-x86-64.dylib + + upload-macos-arm64: + runs-on: ubuntu-22.04 + needs: [prepare-tag, create-release, download-artifacts] + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/tonlib-cli - asset_name: tonlib-cli-mac-x86-64 - tag: ${{ steps.tag.outputs.TAG }} - - - # mac arm64 + name: release-artifacts + path: artifacts - - name: Upload Mac arm64 artifacts + - name: Upload Mac arm64 bundle uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: artifacts/ton-arm64-macos.zip asset_name: ton-mac-arm64.zip - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - fift - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/fift - asset_name: fift-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - func - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/func - asset_name: func-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/tolk - asset_name: tolk-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - lite-client - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/lite-client - asset_name: lite-client-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - proxy-liteserver - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/proxy-liteserver - asset_name: proxy-liteserver-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - rldp-http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/rldp-http-proxy - asset_name: rldp-http-proxy-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/http-proxy - asset_name: http-proxy-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - storage-daemon-cli - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/storage-daemon-cli - asset_name: storage-daemon-cli-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - storage-daemon - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/storage-daemon - asset_name: storage-daemon-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - tonlibjson - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/libtonlibjson.dylib - asset_name: tonlibjson-mac-arm64.dylib - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Mac arm64 single artifact - libemulator - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/libemulator.dylib - asset_name: libemulator-mac-arm64.dylib - tag: ${{ steps.tag.outputs.TAG }} + tag: ${{ needs.prepare-tag.outputs.tag }} - - name: Upload Mac arm64 single artifact - tonlib-cli - uses: svenstaro/upload-release-action@v2 + # Batch upload Mac arm64 binaries using gh CLI for efficiency + - name: Upload Mac arm64 binaries + run: | + TAG="${{ needs.prepare-tag.outputs.tag }}" + cd artifacts/ton-arm64-macos + + # Upload all Mac arm64 binaries in batches + gh release upload "$TAG" --repo ${{ github.repository }} \ + fift#fift-mac-arm64 \ + func#func-mac-arm64 \ + tolk#tolk-mac-arm64 \ + lite-client#lite-client-mac-arm64 \ + proxy-liteserver#proxy-liteserver-mac-arm64 \ + rldp-http-proxy#rldp-http-proxy-mac-arm64 + + gh release upload "$TAG" --repo ${{ github.repository }} \ + http-proxy#http-proxy-mac-arm64 \ + storage-daemon-cli#storage-daemon-cli-mac-arm64 \ + storage-daemon#storage-daemon-mac-arm64 \ + tonlib-cli#tonlib-cli-mac-arm64 \ + libtonlibjson.dylib#tonlibjson-mac-arm64.dylib \ + libemulator.dylib#libemulator-mac-arm64.dylib + + upload-linux-x86: + runs-on: ubuntu-22.04 + needs: [prepare-tag, create-release, download-artifacts] + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/tonlib-cli - asset_name: tonlib-cli-mac-arm64 - tag: ${{ steps.tag.outputs.TAG }} - - # linux x86-64 + name: release-artifacts + path: artifacts - - name: Upload Linux x86-64 artifacts + - name: Upload Linux x86-64 bundle uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: artifacts/ton-x86_64-linux.zip asset_name: ton-linux-x86_64.zip - tag: ${{ steps.tag.outputs.TAG }} + tag: ${{ needs.prepare-tag.outputs.tag }} - name: Upload generic smartcont+lib artifact run: | @@ -507,224 +300,89 @@ jobs: cd smartcont_lib cp -r ../artifacts/ton-x86_64-linux/{smartcont,lib} . zip -r smartcont_lib.zip . - gh release upload ${{ steps.tag.outputs.TAG }} smartcont_lib.zip - - - name: Upload Linux x86-64 single artifact - fift - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/fift - asset_name: fift-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - func - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/func - asset_name: func-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/tolk - asset_name: tolk-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - lite-client - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/lite-client - asset_name: lite-client-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - proxy-liteserver - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/proxy-liteserver - asset_name: proxy-liteserver-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - rldp-http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/rldp-http-proxy - asset_name: rldp-http-proxy-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - http-proxy - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/http-proxy - asset_name: http-proxy-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - storage-daemon-cli - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/storage-daemon-cli - asset_name: storage-daemon-cli-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - storage-daemon - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/storage-daemon - asset_name: storage-daemon-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} + gh release upload ${{ needs.prepare-tag.outputs.tag }} smartcont_lib.zip --repo ${{ github.repository }} - - name: Upload Linux x86-64 single artifact - tonlibjson - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/libtonlibjson.so - asset_name: tonlibjson-linux-x86_64.so - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - libemulator - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/libemulator.so - asset_name: libemulator-linux-x86_64.so - tag: ${{ steps.tag.outputs.TAG }} - - - name: Upload Linux x86-64 single artifact - tonlib-cli - uses: svenstaro/upload-release-action@v2 + # Batch upload Linux x86-64 binaries using gh CLI for efficiency + - name: Upload Linux x86-64 binaries + run: | + TAG="${{ needs.prepare-tag.outputs.tag }}" + cd artifacts/ton-x86_64-linux + + # Upload all Linux x86-64 binaries in batches + gh release upload "$TAG" --repo ${{ github.repository }} \ + fift#fift-linux-x86_64 \ + func#func-linux-x86_64 \ + tolk#tolk-linux-x86_64 \ + lite-client#lite-client-linux-x86_64 \ + proxy-liteserver#proxy-liteserver-linux-x86_64 \ + rldp-http-proxy#rldp-http-proxy-linux-x86_64 + + gh release upload "$TAG" --repo ${{ github.repository }} \ + http-proxy#http-proxy-linux-x86_64 \ + storage-daemon-cli#storage-daemon-cli-linux-x86_64 \ + storage-daemon#storage-daemon-linux-x86_64 \ + tonlib-cli#tonlib-cli-linux-x86_64 \ + libtonlibjson.so#tonlibjson-linux-x86_64.so \ + libemulator.so#libemulator-linux-x86_64.so + + + upload-linux-arm64: + runs-on: ubuntu-22.04 + needs: [prepare-tag, create-release, download-artifacts] + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/tonlib-cli - asset_name: tonlib-cli-linux-x86_64 - tag: ${{ steps.tag.outputs.TAG }} - - - # linux arm64 + name: release-artifacts + path: artifacts - - name: Upload Linux arm64 artifacts + - name: Upload Linux arm64 bundle 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 }} + tag: ${{ needs.prepare-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 + # Batch upload Linux arm64 binaries using gh CLI for efficiency + - name: Upload Linux arm64 binaries + run: | + TAG="${{ needs.prepare-tag.outputs.tag }}" + cd artifacts/ton-arm64-linux + + # Upload all Linux arm64 binaries in batches + gh release upload "$TAG" --repo ${{ github.repository }} \ + fift#fift-linux-arm64 \ + func#func-linux-arm64 \ + tolk#tolk-linux-arm64 \ + lite-client#lite-client-linux-arm64 \ + proxy-liteserver#proxy-liteserver-linux-arm64 \ + rldp-http-proxy#rldp-http-proxy-linux-arm64 + + gh release upload "$TAG" --repo ${{ github.repository }} \ + http-proxy#http-proxy-linux-arm64 \ + storage-daemon-cli#storage-daemon-cli-linux-arm64 \ + storage-daemon#storage-daemon-linux-arm64 \ + tonlib-cli#tonlib-cli-linux-arm64 \ + libtonlibjson.so#tonlibjson-linux-arm64.so \ + libemulator.so#libemulator-linux-arm64.so + + upload-wasm-android: + runs-on: ubuntu-22.04 + needs: [prepare-tag, create-release, download-artifacts] + steps: + - name: Download release artifacts + uses: actions/download-artifact@v4 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-wasm.zip - asset_name: ton-wasm.zip - tag: ${{ steps.tag.outputs.TAG }} + name: release-artifacts + path: artifacts - - name: Upload Android Tonlib artifacts - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-android-tonlib.zip - asset_name: ton-android-tonlib.zip - tag: ${{ steps.tag.outputs.TAG }} + # Upload WASM and Android artifacts together since they're smaller + - name: Upload WASM and Android artifacts + run: | + TAG="${{ needs.prepare-tag.outputs.tag }}" + + # Upload WASM and Android bundles simultaneously + gh release upload "$TAG" --repo ${{ github.repository }} \ + artifacts/ton-wasm.zip \ + artifacts/ton-android-tonlib.zip diff --git a/.github/workflows/create-tolk-release.yml b/.github/workflows/create-tolk-release.yml index fb8438a12..35d5e670a 100644 --- a/.github/workflows/create-tolk-release.yml +++ b/.github/workflows/create-tolk-release.yml @@ -10,13 +10,14 @@ on: permissions: write-all jobs: - create-release: + # Download artifacts in parallel for better performance + download-artifacts: runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Download and unzip Linux arm64 artifacts + # Download all artifacts in parallel (only unpacked versions needed) + - name: Download Linux arm64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-linux-arm64-appimage.yml @@ -25,7 +26,7 @@ jobs: branch: master skip_unpack: false - - name: Download and unzip Linux x86-64 artifacts + - name: Download Linux x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-linux-x86-64-appimage.yml @@ -34,7 +35,7 @@ jobs: branch: master skip_unpack: false - - name: Download and unzip Mac x86-64 artifacts + - name: Download Mac x86-64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-macos-13-x86-64-portable.yml @@ -43,7 +44,7 @@ jobs: branch: master skip_unpack: false - - name: Download and unzip arm64 artifacts + - name: Download Mac arm64 artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: build-ton-macos-14-arm64-portable.yml @@ -52,7 +53,7 @@ jobs: branch: master skip_unpack: false - - name: Download and unzip Windows artifacts + - name: Download Windows artifacts uses: dawidd6/action-download-artifact@v6 with: workflow: ton-x86-64-windows.yml @@ -72,83 +73,46 @@ jobs: - name: Show all artifacts run: | - tree artifacts - + tree artifacts || ls -la artifacts - # create release - - name: Get registration token - id: getRegToken - run: | - curl -X POST -H \"Accept: application/vnd.github+json\" -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/ton-blockchain/ton/actions/runners/registration-token + - name: Upload artifacts for release job + uses: actions/upload-artifact@v4 + with: + name: tolk-release-artifacts + path: artifacts + + create-release: + runs-on: ubuntu-22.04 + needs: download-artifacts + steps: + - uses: actions/checkout@v4 + + - name: Download release artifacts + uses: actions/download-artifact@v4 + with: + name: tolk-release-artifacts + path: artifacts - name: Create release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: ${{ inputs.tag }} - release_name: ${{ inputs.tag }} + name: ${{ inputs.tag }} draft: false prerelease: false - # upload - - # win - - - name: Upload Windows 2019 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86-64-windows/tolk.exe - asset_name: tolk.exe - tag: ${{ inputs.tag }} - - # mac x86-64 - - - name: Upload Mac x86-64 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-macos/tolk - asset_name: tolk-mac-x86-64 - tag: ${{ inputs.tag }} - - # mac arm64 - - - name: Upload Mac arm64 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-arm64-macos/tolk - asset_name: tolk-mac-arm64 - tag: ${{ inputs.tag }} - - # linux x86-64 - - - name: Upload Linux x86-64 single artifact - tolk - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-x86_64-linux/tolk - asset_name: tolk-linux-x86_64 - tag: ${{ inputs.tag }} - - # linux arm64 - - - 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: ${{ inputs.tag }} - - - name: Upload WASM artifacts - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: artifacts/ton-wasm.zip - asset_name: ton-wasm.zip - tag: ${{ inputs.tag }} + # Batch upload all tolk binaries using gh CLI for efficiency + - name: Upload all tolk binaries + run: | + TAG="${{ inputs.tag }}" + + # Upload all tolk binaries in one efficient command + gh release upload "$TAG" --repo ${{ github.repository }} \ + artifacts/ton-x86-64-windows/tolk.exe \ + artifacts/ton-x86_64-macos/tolk#tolk-mac-x86-64 \ + artifacts/ton-arm64-macos/tolk#tolk-mac-arm64 \ + artifacts/ton-x86_64-linux/tolk#tolk-linux-x86_64 \ + artifacts/ton-arm64-linux/tolk#tolk-linux-arm64 \ + artifacts/ton-wasm.zip diff --git a/.github/workflows/docker-ubuntu-branch-image.yml b/.github/workflows/docker-ubuntu-branch-image.yml index bd97ed233..7f28bbceb 100644 --- a/.github/workflows/docker-ubuntu-branch-image.yml +++ b/.github/workflows/docker-ubuntu-branch-image.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-22.04-arm steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' diff --git a/.github/workflows/docker-ubuntu-image.yml b/.github/workflows/docker-ubuntu-image.yml index 7a5eee10a..479d1e80d 100644 --- a/.github/workflows/docker-ubuntu-image.yml +++ b/.github/workflows/docker-ubuntu-image.yml @@ -10,17 +10,38 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + # Generate tag once and share across all jobs for consistency + prepare-tag: + runs-on: ubuntu-22.04 + outputs: + tag: ${{ steps.tag.outputs.TAG }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for tags + + - name: Get next tag + id: tag + run: | + git fetch --all --tags + NEW_TAG=v$(date +'%Y.%m') + FOUND=$(git tag -l | grep -c "^$NEW_TAG" || true) + if [ $FOUND -eq 0 ]; then + echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT + else + echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT + fi + + # Build both architectures in parallel with better caching build-arm64: runs-on: ubuntu-22.04-arm + needs: prepare-tag steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Set up QEMU - uses: docker/setup-qemu-action@v3.5.0 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.10.0 @@ -31,38 +52,25 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Get next tag - id: tag - run: | - git fetch --all --tags - git tag -l - NEW_TAG=v$(date +'%Y.%m') - FOUND=$(git tag -l | grep $NEW_TAG | wc -l) - if [ $FOUND -eq 0 ]; then - echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT - else - echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT - fi - - name: Build and push uses: docker/build-push-action@v6 with: platforms: linux/arm64 push: true context: ./ - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-arm64 + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.prepare-tag.outputs.tag }}-arm64 + cache-from: type=gha + cache-to: type=gha,mode=max build-amd64: runs-on: ubuntu-22.04 + needs: prepare-tag steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - - name: Set up QEMU - uses: docker/setup-qemu-action@v3.5.0 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.10.0 @@ -73,49 +81,20 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Get next tag - id: tag - run: | - git fetch --all --tags - git tag -l - NEW_TAG=v$(date +'%Y.%m') - FOUND=$(git tag -l | grep $NEW_TAG | wc -l) - if [ $FOUND -eq 0 ]; then - echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT - else - echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT - fi - - name: Build and push uses: docker/build-push-action@v6 with: platforms: linux/amd64 push: true context: ./ - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-amd64 + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.prepare-tag.outputs.tag }}-amd64 + cache-from: type=gha + cache-to: type=gha,mode=max merge: runs-on: ubuntu-22.04 - needs: - - build-amd64 - - build-arm64 + needs: [prepare-tag, build-amd64, build-arm64] steps: - - name: Check out repository - uses: actions/checkout@v3 - - - name: Get next tag - id: tag - run: | - git fetch --all --tags - git tag -l - NEW_TAG=v$(date +'%Y.%m') - FOUND=$(git tag -l | grep $NEW_TAG | wc -l) - if [ $FOUND -eq 0 ]; then - echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT - else - echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT - fi - - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -130,8 +109,8 @@ jobs: run: | docker buildx imagetools create \ --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-arm64 \ - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}-amd64 + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.prepare-tag.outputs.tag }}-arm64 \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.prepare-tag.outputs.tag }}-amd64 - name: Inspect image run: | diff --git a/.github/workflows/ton-ccpcheck.yml b/.github/workflows/ton-ccpcheck.yml index 95bef5f3d..a3d8531bd 100644 --- a/.github/workflows/ton-ccpcheck.yml +++ b/.github/workflows/ton-ccpcheck.yml @@ -3,24 +3,53 @@ name: TON Static Code Analysis on: [push,workflow_dispatch,workflow_call] jobs: - build: + cppcheck: runs-on: ubuntu-22.04 + # Only run on pushes to main branches or manual triggers to save resources + if: github.event_name == 'workflow_dispatch' || contains(github.ref, 'master') || contains(github.ref, 'main') steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' + # Shallow clone for faster checkout since we only need current state + fetch-depth: 1 + # Install cppcheck directly for better performance control + - name: Install Cppcheck + run: | + sudo apt-get update + sudo apt-get install -y cppcheck + + # Run cppcheck with optimized settings for better performance - name: Run Cppcheck - uses: Bedzior/run-cppcheck@master - with: - enabled checks: all - enable inconclusive: true - generate report: true + run: | + mkdir -p output + cppcheck \ + --enable=warning,style,performance,portability \ + --inconclusive \ + --xml \ + --xml-version=2 \ + --output-file=output/cppcheck-report.xml \ + --suppress=missingIncludeSystem \ + --suppress=unusedFunction \ + --quiet \ + --force \ + --parallel=$(nproc) \ + --std=c++17 \ + --platform=unix64 \ + . 2>&1 || true + + # Generate HTML report for better readability + cppcheck-htmlreport \ + --file=output/cppcheck-report.xml \ + --report-dir=output/html-report \ + --source-dir=. || true - name: Upload report - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 + if: always() # Upload even if cppcheck finds issues with: - name: ton-ccpcheck-report + name: ton-cppcheck-report path: output diff --git a/.github/workflows/ton-x86-64-windows.yml b/.github/workflows/ton-x86-64-windows.yml index 8de9e11be..7f772ffa4 100644 --- a/.github/workflows/ton-x86-64-windows.yml +++ b/.github/workflows/ton-x86-64-windows.yml @@ -8,7 +8,6 @@ defaults: jobs: build: - runs-on: windows-2022 steps: @@ -17,20 +16,30 @@ jobs: systeminfo | findstr /B /C:"OS Name" /C:"OS Version" - name: Check out current repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' + - name: Date Stamp + shell: pwsh + id: date-stamp + run: | + $timestamp = Get-Date -Format "yyyyMMddHHmm_ss" -AsUTC + echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT + - name: Create directories run: | mkdir third_libs - - name: Cache 3pp - id: cache-3pp - uses: actions/cache@v4 + # Improved cache with better restore keys + - name: Restore 3pp cache + uses: actions/cache/restore@v4 with: path: third_libs - key: ${{ runner.os }}-${{ runner.arch }}-windows-2022-3pp-${{ hashFiles('**/assembly/native/build-windows-2022.bat') }} + key: ${{ runner.os }}-${{ runner.arch }}-windows-2022-3pp-${{ steps.date-stamp.outputs.timestamp }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-windows-2022-3pp- + ${{ runner.os }}-${{ runner.arch }}-3pp- - name: Build TON run: | @@ -41,13 +50,22 @@ jobs: build-windows-github-2022.bat Enterprise ccache -sp -# - name: Run Tests -# run: | -# cd build -# ctest -C Release --output-on-failure -E "test-bigint" --timeout 1800 + - name: Save 3pp cache + uses: actions/cache/save@v4 + if: always() # Save cache even if build fails + with: + path: third_libs + key: ${{ runner.os }}-${{ runner.arch }}-windows-2022-3pp-${{ steps.date-stamp.outputs.timestamp }} + + # Re-enable tests with optimized settings + - name: Run Tests + run: | + set "PATH=%CD%\\build\\tonlib;%CD%\\build\\emulator;%PATH%" + cd build + ctest -C Release --output-on-failure -E "(test-bigint|test-tolk)" --timeout 1800 --parallel %NUMBER_OF_PROCESSORS% - name: Upload artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: ton-x86-64-windows path: artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index c37f351d8..3525df037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,9 @@ if (TON_USE_ROCKSDB) set(FAIL_ON_WARNINGS OFF CACHE BOOL "fail on warnings") message("Add rocksdb") add_subdirectory(third-party/rocksdb EXCLUDE_FROM_ALL) + if (MSVC) + set_target_properties(rocksdb PROPERTIES COMPILE_FLAGS "/w") + endif() # Broken CMake in rocksdb alters properties it has no business changing. set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK) @@ -259,6 +262,10 @@ elseif (CLANG OR GCC) endif() endif() +if (PORTABLE AND (CLANG OR GCC) AND NOT APPLE AND NOT ANDROID) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -latomic") +endif() + if (WIN32) add_definitions(-DNTDDI_VERSION=0x06020000 -DWINVER=0x0602 -D_WIN32_WINNT=0x0602 -DNOMINMAX -DUNICODE -D_UNICODE) endif() diff --git a/assembly/android/build-android-tonlib.sh b/assembly/android/build-android-tonlib.sh index 29dbffc88..8a77520c9 100644 --- a/assembly/android/build-android-tonlib.sh +++ b/assembly/android/build-android-tonlib.sh @@ -38,7 +38,8 @@ rm -rf example/android/src/drinkless/org/ton/TonApi.java cd example/android/ rm CMakeCache.txt .ninja_* -cmake -GNinja -DTON_ONLY_TONLIB=ON . +cmake -GNinja -DTON_ONLY_TONLIB=ON . \ +-DCMAKE_CXX_FLAGS="-w" test $? -eq 0 || { echo "Can't configure TON"; exit 1; } diff --git a/assembly/native/build-macos-portable.sh b/assembly/native/build-macos-portable.sh index 351c4e7fb..a49001f1d 100644 --- a/assembly/native/build-macos-portable.sh +++ b/assembly/native/build-macos-portable.sh @@ -26,12 +26,9 @@ else fi export NONINTERACTIVE=1 -brew install ninja pkg-config automake libtool autoconf texinfo export PATH=/usr/local/opt/ccache/libexec:$PATH -brew install llvm@16 if [ "$with_ccache" = true ]; then - brew install ccache mkdir -p ~/.ccache export CCACHE_DIR=~/.ccache ccache -M 0 @@ -49,106 +46,17 @@ else export CXX=/usr/local/opt/llvm@16/bin/clang++ fi -if [ ! -d "../3pp/lz4" ]; then -mkdir -p ../3pp -git clone https://github.com/lz4/lz4.git ../3pp/lz4 -cd ../3pp/lz4 -lz4Path=`pwd` -git checkout v1.9.4 -make -j4 -test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd ../../build -# ./lib/liblz4.a -# ./lib -else - lz4Path=$(pwd)/../3pp/lz4 - echo "Using compiled lz4" -fi - -if [ ! -d "../3pp/libsodium" ]; then - export LIBSODIUM_FULL_BUILD=1 - git clone https://github.com/jedisct1/libsodium.git ../3pp/libsodium - cd ../3pp/libsodium - sodiumPath=`pwd` - git checkout 1.0.18 - ./autogen.sh - ./configure --with-pic --enable-static - make -j4 - test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd ../../build -else - sodiumPath=$(pwd)/../3pp/libsodium - echo "Using compiled libsodium" -fi - -if [ ! -d "../3pp/openssl_3" ]; then - git clone https://github.com/openssl/openssl ../3pp/openssl_3 - cd ../3pp/openssl_3 - opensslPath=`pwd` - git checkout openssl-3.1.4 - ./config - make build_libs -j4 - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../../build -else - opensslPath=$(pwd)/../3pp/openssl_3 - echo "Using compiled openssl_3" -fi - -if [ ! -d "../3pp/zlib" ]; then - git clone https://github.com/madler/zlib.git ../3pp/zlib - cd ../3pp/zlib - zlibPath=`pwd` - ./configure --static - make -j4 - test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd ../../build -else - zlibPath=$(pwd)/../3pp/zlib - echo "Using compiled zlib" -fi - -if [ ! -d "../3pp/libmicrohttpd" ]; then - mkdir -p ../3pp/libmicrohttpd - wget -O ../3pp/libmicrohttpd/libmicrohttpd-1.0.1.tar.gz https://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-1.0.1.tar.gz - cd ../3pp/libmicrohttpd/ - tar xf libmicrohttpd-1.0.1.tar.gz - cd libmicrohttpd-1.0.1 - libmicrohttpdPath=`pwd` - ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j4 - test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd ../../../build -else - libmicrohttpdPath=$(pwd)/../3pp/libmicrohttpd/libmicrohttpd-1.0.1 - echo "Using compiled libmicrohttpd" -fi - cmake -GNinja .. \ -DPORTABLE=1 \ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=$OSX_TARGET \ -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 - +-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3) \ +-DCMAKE_CXX_FLAGS="-w" test $? -eq 0 || { echo "Can't configure ton"; exit 1; } if [ "$with_tests" = true ]; then - ninja storage-daemon storage-daemon-cli blockchain-explorer \ + ninja -j$(sysctl -n hw.ncpu) storage-daemon storage-daemon-cli blockchain-explorer \ tonlib tonlibjson tonlib-cli validator-engine func tolk fift \ lite-client validator-engine-console generate-random-id json2tlo dht-server dht-ping-servers dht-resolve \ http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \ @@ -157,7 +65,7 @@ if [ "$with_tests" = true ]; then 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 blockchain-explorer \ + ninja -j$(sysctl -n hw.ncpu) storage-daemon storage-daemon-cli blockchain-explorer \ tonlib tonlibjson tonlib-cli validator-engine func tolk fift \ lite-client validator-engine-console generate-random-id json2tlo dht-server dht-ping-servers dht-resolve \ http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator proxy-liteserver diff --git a/assembly/native/build-macos-shared.sh b/assembly/native/build-macos-shared.sh index f5aa15b4a..64ed0e0ab 100644 --- a/assembly/native/build-macos-shared.sh +++ b/assembly/native/build-macos-shared.sh @@ -26,12 +26,9 @@ else fi export NONINTERACTIVE=1 -brew install ninja libsodium libmicrohttpd pkg-config automake libtool autoconf gnutls export PATH=/usr/local/opt/ccache/libexec:$PATH -brew install llvm@16 if [ "$with_ccache" = true ]; then - brew install ccache mkdir -p ~/.ccache export CCACHE_DIR=~/.ccache ccache -M 0 @@ -48,45 +45,14 @@ else export CXX=/usr/local/opt/llvm@16/bin/clang++ fi -if [ ! -d "lz4" ]; then - git clone https://github.com/lz4/lz4 - cd lz4 - lz4Path=`pwd` - git checkout v1.9.4 - make -j4 - test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } - cd .. -else - lz4Path=$(pwd)/lz4 - echo "Using compiled lz4" -fi - -if [ ! -d "zlib" ]; then - git clone https://github.com/madler/zlib.git - cd zlib - zlibPath=`pwd` - ./configure --static - make -j4 - test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd .. -else - zlibPath=$(pwd)/zlib - echo "Using compiled zlib" -fi - -brew unlink openssl@1.1 -brew install openssl@3 -brew unlink openssl@3 && brew link --overwrite openssl@3 - cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \ --DLZ4_FOUND=1 \ --DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a \ --DLZ4_INCLUDE_DIRS=$lz4Path/lib +-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3) \ +-DCMAKE_CXX_FLAGS="-w" test $? -eq 0 || { echo "Can't configure ton"; exit 1; } if [ "$with_tests" = true ]; then - ninja storage-daemon storage-daemon-cli blockchain-explorer \ + ninja -j$(sysctl -n hw.ncpu) storage-daemon storage-daemon-cli blockchain-explorer \ tonlib tonlibjson tonlib-cli validator-engine func tolk fift \ lite-client validator-engine-console generate-random-id json2tlo dht-server dht-ping-servers dht-resolve \ http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \ @@ -95,7 +61,7 @@ if [ "$with_tests" = true ]; then 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 blockchain-explorer \ + ninja -j$(sysctl -n hw.ncpu) storage-daemon storage-daemon-cli blockchain-explorer \ tonlib tonlibjson tonlib-cli validator-engine func tolk fift \ lite-client validator-engine-console generate-random-id json2tlo dht-server dht-ping-servers dht-resolve \ http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator proxy-liteserver diff --git a/assembly/native/build-ubuntu-appimages.sh b/assembly/native/build-ubuntu-appimages.sh index 2cdc6c652..83222623b 100644 --- a/assembly/native/build-ubuntu-appimages.sh +++ b/assembly/native/build-ubuntu-appimages.sh @@ -34,32 +34,15 @@ fi export CC=$(which clang-16) export CXX=$(which clang++-16) -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 -j$(nproc) - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../build -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 - +-DCMAKE_CXX_FLAGS="-w" 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 \ +ninja -j$(nproc) storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-cli \ validator-engine lite-client validator-engine-console blockchain-explorer \ generate-random-id json2tlo dht-server http-proxy rldp-http-proxy dht-ping-servers dht-resolve \ adnl-proxy create-state emulator test-ed25519 test-bigint \ @@ -68,7 +51,7 @@ ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib- 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 \ +ninja -j$(nproc) storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-cli \ validator-engine lite-client validator-engine-console blockchain-explorer \ generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ adnl-proxy create-state emulator proxy-liteserver dht-ping-servers dht-resolve diff --git a/assembly/native/build-ubuntu-portable-libs.sh b/assembly/native/build-ubuntu-portable-libs.sh index c7bffd40e..e349cf7c2 100644 --- a/assembly/native/build-ubuntu-portable-libs.sh +++ b/assembly/native/build-ubuntu-portable-libs.sh @@ -35,103 +35,14 @@ fi export CC=$(which clang-16) export CXX=$(which clang++-16) -if [ ! -d "../3pp/lz4" ]; then -mkdir -p ../3pp -git clone https://github.com/lz4/lz4.git ../3pp/lz4 -cd ../3pp/lz4 -lz4Path=`pwd` -git checkout v1.9.4 -CFLAGS="-fPIC" make -j$(nproc) -test $? -eq 0 || { echo "Can't compile lz4"; exit 1; } -cd ../../build -else - lz4Path=$(pwd)/../3pp/lz4 - echo "Using compiled lz4" -fi - -if [ ! -d "../3pp/libsodium" ]; then - export LIBSODIUM_FULL_BUILD=1 - mkdir -p ../3pp/libsodium - wget -O ../3pp/libsodium/libsodium-1.0.18.tar.gz https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz - cd ../3pp/libsodium - tar xf libsodium-1.0.18.tar.gz - cd libsodium-1.0.18 - sodiumPath=`pwd` - ./configure --with-pic --enable-static - make -j$(nproc) - test $? -eq 0 || { echo "Can't compile libsodium"; exit 1; } - cd ../../../build -else - sodiumPath=$(pwd)/../3pp/libsodium/libsodium-1.0.18 - echo "Using compiled libsodium" -fi - -if [ ! -d "../3pp/openssl_3" ]; then - git clone https://github.com/openssl/openssl ../3pp/openssl_3 - cd ../3pp/openssl_3 - opensslPath=`pwd` - git checkout openssl-3.1.4 - ./config - make build_libs -j$(nproc) - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../../build -else - opensslPath=$(pwd)/../3pp/openssl_3 - echo "Using compiled openssl_3" -fi - -if [ ! -d "../3pp/zlib" ]; then - git clone https://github.com/madler/zlib.git ../3pp/zlib - cd ../3pp/zlib - zlibPath=`pwd` - ./configure --static - make -j$(nproc) - test $? -eq 0 || { echo "Can't compile zlib"; exit 1; } - cd ../../build -else - zlibPath=$(pwd)/../3pp/zlib - echo "Using compiled zlib" -fi - -if [ ! -d "../3pp/libmicrohttpd" ]; then - mkdir -p ../3pp/libmicrohttpd - wget -O ../3pp/libmicrohttpd/libmicrohttpd-1.0.1.tar.gz https://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-1.0.1.tar.gz - cd ../3pp/libmicrohttpd/ - tar xf libmicrohttpd-1.0.1.tar.gz - cd libmicrohttpd-1.0.1 - libmicrohttpdPath=`pwd` - ./configure --enable-static --disable-tests --disable-benchmark --disable-shared --disable-https --with-pic - make -j$(nproc) - test $? -eq 0 || { echo "Can't compile libmicrohttpd"; exit 1; } - cd ../../../build -else - libmicrohttpdPath=$(pwd)/../3pp/libmicrohttpd/libmicrohttpd-1.0.1 - 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 - +-DCMAKE_CXX_FLAGS="-w" test $? -eq 0 || { echo "Can't configure ton"; exit 1; } -ninja tonlibjson emulator +ninja -j$(nproc) tonlibjson emulator test $? -eq 0 || { echo "Can't compile tonlibjson and emulator"; exit 1; } cd .. diff --git a/assembly/native/build-ubuntu-shared.sh b/assembly/native/build-ubuntu-shared.sh index 6ddbaf885..95d149418 100644 --- a/assembly/native/build-ubuntu-shared.sh +++ b/assembly/native/build-ubuntu-shared.sh @@ -37,32 +37,14 @@ fi export CC=$(which clang-16) export CXX=$(which clang++-16) - -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 -j$(nproc) - test $? -eq 0 || { echo "Can't compile openssl_3"; exit 1; } - cd ../build -else - opensslPath=$(pwd)/../openssl_3 - echo "Using compiled openssl_3" -fi - cmake -GNinja -DTON_USE_JEMALLOC=ON .. \ -DCMAKE_BUILD_TYPE=Release \ --DOPENSSL_ROOT_DIR=$opensslPath \ --DOPENSSL_INCLUDE_DIR=$opensslPath/include \ --DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.so - +-DCMAKE_CXX_FLAGS="-w" 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 \ +ninja -j$(nproc) storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-cli \ validator-engine lite-client validator-engine-console blockchain-explorer \ generate-random-id json2tlo dht-server http-proxy rldp-http-proxy dht-ping-servers dht-resolve \ adnl-proxy create-state emulator test-ed25519 test-bigint \ @@ -71,7 +53,7 @@ ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib- 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 \ +ninja -j$(nproc) storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-cli \ validator-engine lite-client validator-engine-console blockchain-explorer \ generate-random-id json2tlo dht-server http-proxy rldp-http-proxy \ adnl-proxy create-state emulator proxy-liteserver dht-ping-servers dht-resolve diff --git a/assembly/native/build-windows-2022.bat b/assembly/native/build-windows-2022.bat index 6ff7166af..367196f10 100644 --- a/assembly/native/build-windows-2022.bat +++ b/assembly/native/build-windows-2022.bat @@ -55,7 +55,7 @@ if not exist "zlib" ( cd zlib git checkout v1.3.1 cd contrib\vstudio\vc14 - msbuild zlibstat.vcxproj /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v143 + msbuild zlibstat.vcxproj /m /p:Configuration=ReleaseWithoutAsm /p:platform=x64 -p:PlatformToolset=v143 cd ..\..\..\.. ) else ( echo Using zlib... @@ -66,7 +66,7 @@ if not exist "lz4" ( cd lz4 git checkout v1.9.4 cd build\VS2022\liblz4 - msbuild liblz4.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143 + msbuild liblz4.vcxproj /m /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143 cd ..\..\..\.. ) else ( echo Using lz4... @@ -76,7 +76,7 @@ if not exist "libsodium" ( git clone https://github.com/jedisct1/libsodium cd libsodium git checkout 1.0.18-RELEASE - msbuild libsodium.vcxproj /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143 + msbuild libsodium.vcxproj /m /p:Configuration=Release /p:platform=x64 -p:PlatformToolset=v143 cd .. ) else ( echo Using libsodium... @@ -103,7 +103,7 @@ if not exist "libmicrohttpd" ( cd libmicrohttpd git checkout v1.0.1 cd w32\VS2022 - msbuild libmicrohttpd.vcxproj /p:Configuration=Release-static /p:platform=x64 -p:PlatformToolset=v143 + msbuild libmicrohttpd.vcxproj /m /p:Configuration=Release-static /p:platform=x64 -p:PlatformToolset=v143 IF %errorlevel% NEQ 0 ( echo Can't compile libmicrohttpd exit /b %errorlevel% @@ -136,7 +136,7 @@ cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^ -DOPENSSL_FOUND=1 ^ -DOPENSSL_INCLUDE_DIR=%third_libs%\openssl\include ^ -DOPENSSL_CRYPTO_LIBRARY=%third_libs%\openssl\libcrypto_static.lib ^ --DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj" .. +-DCMAKE_CXX_FLAGS="/DTD_WINDOWS=1 /EHsc /bigobj /wd4068 /wd4200 /wd4334 /w" .. IF %errorlevel% NEQ 0 ( echo Can't configure TON @@ -144,7 +144,7 @@ IF %errorlevel% NEQ 0 ( ) IF "%1"=="-t" ( -ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonlib tonlibjson ^ +ninja -j%NUMBER_OF_PROCESSORS% storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonlib tonlibjson ^ tonlib-cli validator-engine lite-client validator-engine-console generate-random-id ^ json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator ^ test-ed25519 test-bigint test-vm test-fift test-cells test-smartcont test-net ^ @@ -155,7 +155,7 @@ IF %errorlevel% NEQ 0 ( exit /b %errorlevel% ) ) else ( -ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonlib tonlibjson ^ +ninja -j%NUMBER_OF_PROCESSORS% storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonlib tonlibjson ^ tonlib-cli validator-engine lite-client validator-engine-console generate-random-id ^ json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator proxy-liteserver IF %errorlevel% NEQ 0 ( diff --git a/assembly/wasm/fift-func-wasm-build-ubuntu.sh b/assembly/wasm/fift-func-wasm-build-ubuntu.sh index a80430c1d..dcc8188c6 100644 --- a/assembly/wasm/fift-func-wasm-build-ubuntu.sh +++ b/assembly/wasm/fift-func-wasm-build-ubuntu.sh @@ -51,7 +51,8 @@ if [ ! -d "build" ]; then -DCMAKE_BUILD_TYPE=Release \ -DOPENSSL_ROOT_DIR=$opensslPath \ -DOPENSSL_INCLUDE_DIR=$opensslPath/include \ - -DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.so + -DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.so \ + -DCMAKE_CXX_FLAGS="-w" test $? -eq 0 || { echo "Can't configure TON build"; exit 1; } ninja fift smc-envelope @@ -154,7 +155,7 @@ emcmake cmake -DUSE_EMSCRIPTEN=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAK -DOPENSSL_INCLUDE_DIR=$opensslPath/include \ -DOPENSSL_CRYPTO_LIBRARY=$opensslPath/libcrypto.a \ -DCMAKE_TOOLCHAIN_FILE=$EMSDK_DIR/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \ --DCMAKE_CXX_FLAGS="-sUSE_ZLIB=1" \ +-DCMAKE_CXX_FLAGS="-sUSE_ZLIB=1 -w" \ -DSODIUM_FOUND=1 \ -DSODIUM_INCLUDE_DIR=$SODIUM_DIR/src/libsodium/include \ -DSODIUM_USE_STATIC_LIBS=1 \ diff --git a/example/android/build.sh b/example/android/build.sh index dc0618e94..569922e72 100755 --- a/example/android/build.sh +++ b/example/android/build.sh @@ -66,7 +66,8 @@ cmake .. -GNinja \ -DSODIUM_INCLUDE_DIR=${SODIUM_INCLUDE_DIR} \ -DSODIUM_LIBRARY_RELEASE=${SODIUM_LIBRARY_RELEASE} \ -DSODIUM_USE_STATIC_LIBS=1 \ --DBLST_LIB=${BLST_LIBRARY} || exit 1 +-DBLST_LIB=${BLST_LIBRARY} \ +-DCMAKE_CXX_FLAGS="-w" || exit 1 ninja native-lib || exit 1 popd diff --git a/tdutils/td/utils/SpinLock.h b/tdutils/td/utils/SpinLock.h index f0856f0c0..7de4c0190 100644 --- a/tdutils/td/utils/SpinLock.h +++ b/tdutils/td/utils/SpinLock.h @@ -19,6 +19,7 @@ #pragma once #include "td/utils/port/thread.h" +#include "td/utils/port/config.h" #include #include @@ -67,9 +68,25 @@ class SpinLock { #pragma clang diagnostic ignored "-Wdeprecated-pragma" std::atomic_flag flag_ = ATOMIC_FLAG_INIT; #pragma clang diagnostic pop - void unlock() { + +#if TD_GCC || TD_CLANG +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wthread-safety-analysis" +#endif + inline void unlock() noexcept { + flag_.clear(std::memory_order_release); + } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +#elif TD_MSVC +#include "td/utils/common.h" // This includes Windows.h properly + inline void unlock() noexcept { flag_.clear(std::memory_order_release); } +#endif }; } // namespace td diff --git a/tdutils/td/utils/logging.h b/tdutils/td/utils/logging.h index bb28f6df8..1634df208 100644 --- a/tdutils/td/utils/logging.h +++ b/tdutils/td/utils/logging.h @@ -357,3 +357,5 @@ class TsLog : public LogInterface { } }; } // namespace td + +