diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index 0d59259506d..00000000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Android - -on: - push: - branches: [ RC_2_0 master ] - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} - cancel-in-progress: true - -env: - NDK_VERSION: "r21d" - OPENSSL_VERSION: "1.1.1i" - OPENSSL_OPTS: "no-deprecated no-shared no-makedepend -fvisibility=hidden -O3" - -jobs: - - android_arm32_build: - name: Build Android Arm 32bits - runs-on: ubuntu-24.04 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: install boost - run: | - git clone --depth=1 --branch=boost-1.75.0 https://github.com/boostorg/boost.git - cd boost - git submodule update --init --depth=1 - ./bootstrap.sh - ./b2 headers - cd .. - - - name: install ndk - run: | - wget -nv -O android-ndk.zip https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip - unzip -qq android-ndk.zip - export NDK=${PWD}/android-ndk-${NDK_VERSION} - ${NDK}/build/tools/make_standalone_toolchain.py --arch arm --api 19 --stl libc++ --install-dir android-toolchain - - - name: install openssl - run: | - export ANDROID_TOOLCHAIN=${PWD}/android-toolchain - export PATH=${ANDROID_TOOLCHAIN}/arm-linux-androideabi/bin:${PATH} - export CC=${ANDROID_TOOLCHAIN}/bin/arm-linux-androideabi-clang - wget -nv -O openssl.tar.gz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz - tar xzf openssl.tar.gz - cd openssl-${OPENSSL_VERSION} - ./Configure linux-armv4 ${OPENSSL_OPTS} -march=armv7-a -mfpu=neon -fPIC --prefix=${PWD}/../openssl - make &> /dev/null - make install_sw &> /dev/null - cd .. - - - name: build library - run: | - export ANDROID_TOOLCHAIN=${PWD}/android-toolchain - export PATH=${ANDROID_TOOLCHAIN}/arm-linux-androideabi/bin:${PATH} - export BOOST_ROOT=${PWD}/boost - export OPENSSL_ROOT=${PWD}/openssl - echo "boost-build ${BOOST_ROOT}/tools/build/src ;" > boost-build.jam - echo "using clang-linux : arm : ${ANDROID_TOOLCHAIN}/bin/arm-linux-androideabi-clang++ - -fPIC - -march=armv7-a - -mfpu=neon ;" >>~/user-config.jam; - ${BOOST_ROOT}/b2 warnings-as-errors=on cxxstd=14 toolset=clang-linux-arm target-os=android link=static crypto=openssl openssl-include=${OPENSSL_ROOT}/include openssl-lib=${OPENSSL_ROOT}/lib diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml deleted file mode 100644 index b037caf409d..00000000000 --- a/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: CIFuzz -on: [pull_request] -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'libtorrent' - dry-run: false - language: c++ - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'libtorrent' - fuzz-seconds: 300 - dry-run: false - language: c++ - - name: Upload Crash - uses: actions/upload-artifact@v4 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 66d5c3d5958..00000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ "RC_2_0", "RC_1_0", "RC_1_1", "RC_1_2", "master" ] - pull_request: - branches: [ "RC_2_0" ] - schedule: - - cron: "3 12 * * 2" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ cpp ] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 1 - filter: tree:0 - - - name: Install Packages (cpp) - if: ${{ matrix.language == 'cpp' }} - run: | - sudo apt-get update - sudo apt-get install --yes libboost-all-dev libssl-dev ninja-build - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - queries: +security-and-quality - - - name: Build cpp - if: ${{ matrix.language == 'cpp' }} - run: | - cmake -Dbuild_examples=ON -Dbuild_tests=ON -Dbuild_tools=ON -GNinja . - cmake --build . - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 79baca08fec..00000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Documentation - -on: - push: - branches: [ RC_1_2 RC_2_0 master ] - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - - docs: - name: Docs - runs-on: ubuntu-24.04 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - name: install dependencies - run: | - sudo apt install python3-docutils python3-pygments python3-pil gsfonts inkscape icoutils graphviz hunspell imagemagick - python3 -m pip install aafigure - ~/.local/bin/aafigure --version - - - name: spell-check - run: | - cd docs - make AAFIGURE=~/.local/bin/aafigure RST2HTML=rst2html spell-check html - - - name: build docs - run: | - cd docs - make AAFIGURE=~/.local/bin/aafigure RST2HTML=rst2html diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 7f772d46842..00000000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,375 +0,0 @@ -name: Linux - -on: - push: - branches: [ RC_1_2 RC_2_0 master ] - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 1 - filter: tree:0 - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - uses: pre-commit/action@v3.0.1 - - build: - name: build - runs-on: ubuntu-22.04 - continue-on-error: true - - strategy: - matrix: - include: - - config: asio-debugging=on picker-debugging=on - - config: extensions=off logging=off streaming=off super-seeding=off share-mode=off predictive-pieces=off dht=off alert-msg=off encryption=off mutable-torrents=off deprecated-functions=off - - config: crypto=gcrypt - - config: mmap-disk-io=off - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-build-${{ github.base_ref }}-${{ matrix.config }} - ccache_options: | - max_size=5G - - - name: install boost - run: | - sudo apt install libboost-python-dev libboost-tools-dev libboost-dev libboost-system-dev python3 - echo "using gcc ;" >>~/user-config.jam - - - name: install gcrypt - if: ${{ contains(matrix.config, 'crypto=gcrypt') }} - run: sudo apt install libgcrypt20-dev - - - name: build library - run: | - b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on - - - name: build examples - run: | - cd examples - b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on - - - name: build tools - run: | - cd tools - b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on - - - name: build python bindings - run: | - cd bindings/python - echo "using python ;" >>~/user-config.jam - BOOST_ROOT="" b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on - - - fuzzers: - name: Fuzzers - runs-on: ubuntu-24.04 - continue-on-error: true - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-fuzzers-${{ github.base_ref }} - ccache_options: | - max_size=500M - - - name: install clang-14 - continue-on-error: true - run: | - sudo apt install clang-14 - - - name: install boost - run: | - sudo apt install libboost-tools-dev libboost-dev libboost-system-dev - echo "using clang : 14 : clang++-14 ;" >>~/user-config.jam - - - name: build fuzzers - run: | - cd fuzzers - b2 clang cxxstd=14 warnings-as-errors=on - - - - check_headers: - name: check headers - runs-on: ubuntu-24.04 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-check-headers-${{ github.base_ref }} - ccache_options: | - max_size=500M - - - name: install boost - run: | - sudo apt install libboost-tools-dev libboost-dev libboost-system-dev - echo "using gcc ;" >>~/user-config.jam - - - name: compile header files individually - run: | - b2 check-headers cxxstd=14 warnings-as-errors=on - - - - clang_tidy: - name: clang-tidy - runs-on: ubuntu-24.04 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-clang-tidy-${{ github.base_ref }} - ccache_options: | - max_size=500M - - - name: install clang-tidy - run: sudo apt install clang-tidy libc++-dev - - - name: install boost - run: | - sudo apt install libboost-tools-dev libboost-dev - echo "using clang_tidy : : clang-tidy \"-checks=-clang-analyzer-core.*,-clang-analyzer-optin.core.EnumCastOutOfRange,-clang-analyzer-unix.*\" : -std=c++14 -I/usr/local/clang-7.0.0/include/c++/v1 -stdlib=libc++ -Wno-unknown-warning-option -stdlib=libc++ ;" >> ~/user-config.jam; - - - name: analyze - run: | - b2 -a clang_tidy - - - - test: - name: Tests - runs-on: ubuntu-22.04 - continue-on-error: true - - strategy: - matrix: - include: - - config: address-sanitizer=norecover undefined-sanitizer=norecover crypto=openssl - - config: toolset=clang logging=off address-sanitizer=norecover undefined-sanitizer=norecover - - config: thread-sanitizer=norecover crypto=openssl release debug-symbols=on cxxflags=-Wno-tsan - - config: crypto=gnutls - - config: deprecated-functions=off - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-tests-${{ matrix.config }}-${{ github.base_ref }} - ccache_options: | - max_size=5G - - - name: install gnutls - if: ${{ contains(matrix.config, 'crypto=gnutls') }} - run: | - sudo apt install libgnutls28-dev - - - name: install clang-12 - continue-on-error: true - run: | - sudo apt install clang-12 - - - name: install GCC-12 - continue-on-error: true - run: | - sudo apt install gcc-12 - - - name: install boost - run: | - sudo apt install libboost-tools-dev libboost-dev libboost-system-dev - echo "using gcc : 12 : g++-12 ;" >>~/user-config.jam - echo "using clang : 12 : clang++-12 ;" >>~/user-config.jam - - - name: build and run tests - run: | - cd test - b2 ${{ matrix.config }} -l500 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on deterministic-tests - - - name: run tests (flaky) - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - retry_wait_seconds: 4 - max_attempts: 3 - command: (cd test; b2 ${{ matrix.config }} -l500 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on) - - - - sim: - name: Simulations - runs-on: ubuntu-24.04 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-simulations-${{ github.base_ref }} - ccache_options: | - max_size=5G - - - name: install boost - run: | - sudo apt install libboost-tools-dev libboost-dev libboost-system-dev - echo "using gcc ;" >>~/user-config.jam - - - name: build and run simulations - run: | - cd simulation - b2 debug-iterators=on invariant-checks=full asserts=on picker-debugging=on - - - name: build simulations no deprecated - run: | - cd simulation - b2 testing.execute=off deprecated-functions=off - - - dist: - name: build dist - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-24.04, ubuntu-22.04] - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: update package lists - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - with: - update_packager_index: false - override_cache_key: ccache-linux-dist-${{ matrix.os }}-${{ github.base_ref }} - ccache_options: | - max_size=15G - - - name: install dependencies - run: | - sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev - sudo apt install python3-docutils python3-pygments python3-pil gsfonts inkscape icoutils graphviz hunspell imagemagick python3-setuptools - python3 -m pip install aafigure - echo "using gcc ;" >>~/user-config.jam - - - name: build tarball - run: AAFIGURE=~/.local/bin/aafigure RST2HTML=rst2html make dist - - - uses: actions/upload-artifact@v4 - with: - name: tarball-${{ matrix.os }} - path: libtorrent-rasterbar-*.tar.gz - - - name: test-tarball (b2 install) - run: | - tar xvzf libtorrent-rasterbar-*.tar.gz - cd libtorrent-rasterbar-*/ - b2 install cxxstd=14 --prefix=test-install-root - cat test-install-root/lib/pkgconfig/libtorrent-rasterbar.pc - - - name: test-tarball (b2 tests) - run: | - cd libtorrent-rasterbar-*/test - b2 testing.execute=off - b2 test_torrent_info - - - name: test-tarball (python bindings) - run: | - cd libtorrent-rasterbar-*/ - python3 bindings/python/setup.py build diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index f8d93eeecf1..00000000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: MacOS - -on: - push: - branches: [ RC_1_2 RC_2_0 master ] - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} - cancel-in-progress: true - -env: - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - -jobs: - - test: - name: Tests - runs-on: macos-latest - continue-on-error: true - - strategy: - matrix: - config: [ crypto=built-in, deprecated-functions=off ] - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - uses: Chocobo1/setup-ccache-action@v1 - with: - override_cache_key: ccache-macos-test-${{ matrix.config }}-${{ github.base_ref }} - ccache_options: | - max_size=1G - - - name: install boost - run: | - brew install boost-build boost openssl@3 - echo "using darwin ;" >>~/user-config.jam - - - name: build and run tests - run: (cd test; b2 ${{ matrix.config }} -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on deterministic-tests) - - - name: run tests (flaky) - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - retry_wait_seconds: 1 - max_attempts: 3 - command: (cd test; b2 ${{ matrix.config }} -l400 warnings-as-errors=on debug-iterators=on invariant-checks=full asserts=on) - - - sim: - name: Simulations - runs-on: macos-latest - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - uses: Chocobo1/setup-ccache-action@v1 - with: - override_cache_key: ccache-macos-sim-${{ github.base_ref }} - ccache_options: | - max_size=1G - - - name: install boost - run: | - brew install boost-build boost openssl@3 - echo "using darwin ;" >>~/user-config.jam - - - name: build and run simulations - run: | - cd simulation - b2 -l400 debug-iterators=on invariant-checks=full asserts=on - - - build: - name: Build - runs-on: macos-latest - continue-on-error: true - - strategy: - matrix: - config: [ crypto=built-in, release ] - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - uses: Chocobo1/setup-ccache-action@v1 - with: - override_cache_key: ccache-macos-build-${{ matrix.config }}-${{ github.base_ref }} - ccache_options: | - max_size=1G - - - name: install boost - run: | - brew install boost-build boost openssl@3 - echo "using darwin ;" >>~/user-config.jam - - - name: build library - run: | - b2 ${{ matrix.config }} -l400 warnings-as-errors=on cxxstd=14 - - - ios_build: - name: Build iOS - runs-on: macos-latest - continue-on-error: true - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: install boost - run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git - cd boost - ./bootstrap.sh - - - name: boost headers - run: | - cd boost - ./b2 headers - cp b2 .. - - - name: user-config - run: | - echo "using darwin : ios_sim : clang++ : -Wno-deprecated-declarations - \"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk\" - -mios-simulator-version-min=7 - -fobjc-abi-version=2 - \"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk\" - -mios-simulator-version-min=7 - -fobjc-abi-version=2 ;" >>~/user-config.jam; - - echo "using darwin : ios : clang++ : -Wno-deprecated-declarations - \"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk\" - -mios-version-min=7 - \"-arch armv7\" - -fobjc-abi-version=2 - \"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk\" - -mios-version-min=7 - \"-arch armv7\" - -fobjc-abi-version=2 ;" >>~/user-config.jam; - - - name: build library - run: | - BOOST_ROOT=boost ./b2 -l400 cxxstd=14 target-os=iphone crypto=built-in darwin-ios darwin-ios_sim address-model=64 link=static diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index b4bc664bce3..00000000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Python bindings - -on: - push: - branches: [ RC_1_2 RC_2_0 master ] - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} - cancel-in-progress: true - -env: - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - -jobs: - - test: - name: build - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-24.04, macos-latest, windows-latest ] - - steps: - - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: dependencies (MacOS) - if: runner.os == 'macOS' - run: | - brew install boost-build boost boost-python3 python@3.13 openssl@3 python-setuptools - export PATH=$(brew --prefix)/opt/python@3.13/bin:$PATH - - - name: update package lists (linux) - if: runner.os == 'Linux' - continue-on-error: true - run: | - sudo apt update - - - uses: Chocobo1/setup-ccache-action@v1 - if: runner.os != 'Windows' - with: - update_packager_index: false - override_cache_key: ccache-python-${{ matrix.os }}-${{ github.base_ref }} - ccache_options: | - max_size=500M - - - name: dependencies (linux) - if: runner.os == 'Linux' - run: | - sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev python3 python3-setuptools libssl-dev - - - name: install boost (windows) - if: runner.os == 'Windows' - shell: cmd - run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git - cd boost - bootstrap.bat - - - name: boost headers (windows) - if: runner.os == 'Windows' - shell: cmd - run: | - cd boost - .\b2 headers - - - name: build/install (windows) - if: runner.os == 'Windows' - shell: cmd - run: | - set BOOST_ROOT=%CD%\boost - set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build - set PATH=%BOOST_ROOT%;%PATH% - - cd bindings\python - python setup.py build_ext --b2-args "asserts=on invariant-checks=full" install --user --prefix= - - - name: tests (windows) - if: runner.os == 'Windows' - shell: cmd - run: | - cd bindings\python - python test.py - - - name: build no-deprecated (Linux) - if: runner.os == 'Linux' - run: | - cd bindings/python - python3 setup.py build_ext --b2-args "deprecated-functions=off" - - - name: build/install (Linux) - if: runner.os == 'Linux' - run: | - cd bindings/python - python3 setup.py build_ext install --user --prefix= - - - name: build/install (MacOS) - if: runner.os == 'macOS' - run: | - # Install to Homebrew's python site-packages. no need for --user and --prefix - cd bindings/python - export PATH=$(brew --prefix)/opt/python@3.13/bin:$PATH - python3.13 setup.py build_ext install --install-lib $(brew --prefix)/lib/python3.13/site-packages - - - name: tests (Linux) - if: runner.os == 'Linux' - run: | - cd bindings/python - python3 test.py - - - name: tests (MacOS) - if: runner.os == 'macOS' - run: | - cd bindings/python - export PATH=$(brew --prefix)/opt/python@3.13/bin:$PATH - python3.13 test.py diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index f249b5f241e..00000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,217 +0,0 @@ -name: Windows - -on: - push: - branches: [ RC_1_2 RC_2_0 master ] - pull_request: - -defaults: - run: - shell: cmd - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - - tests: - name: Test - runs-on: windows-latest - continue-on-error: true - - strategy: - matrix: - include: - - config: address-model=32 crypto=built-in - - config: address-model=64 - - config: release - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: install boost - run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git - cd boost - bootstrap.bat - - - name: boost headers - run: | - cd boost - .\b2 headers - - - name: tests (deterministic) - run: | - set BOOST_ROOT=%CD%\boost - set PATH=%BOOST_ROOT%;%PATH% - set PYTHON_INTERPRETER=python - cd test - b2 -l400 msvc-version-macro=on warnings=all warnings-as-errors=on ${{ matrix.config }} deterministic-tests - - - - name: tests (flaky) - run: | - set BOOST_ROOT=%CD%\boost - set PATH=%BOOST_ROOT%;%PATH% - set PYTHON_INTERPRETER=python - cd test - set c=3 - :retry - if %c%==0 exit /B 1 - set /a c = %c% -1 - b2 -l400 msvc-version-macro=on warnings=all warnings-as-errors=on ${{ matrix.config }} - if %errorlevel%==0 exit /B 0 - if %c% gtr 0 goto retry - exit /B 1 - - simulations: - name: Simulations - runs-on: windows-2019 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: install boost - run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git - cd boost - bootstrap.bat - - - name: boost headers - run: | - cd boost - .\b2 headers - - - shell: pwsh - run: | - echo "BOOST_ROOT=$(pwd)/boost" >> $env:GITHUB_ENV - echo "$(pwd)/boost" >> $env:GITHUB_PATH - - # debug iterators are turned off here because msvc has issues with noexcept - # specifiers when debug iterators are enabled. Specifically, constructors that - # allocate memory are still marked as noexcept. That results in program - # termination - # the IOCP backend in asio appears to have an issue where it hangs under - # certain unexpected terminations (through exceptions) - - name: build sims - run: | - echo %BOOST_ROOT% - echo %PATH% - cd simulation - b2 --hash release msvc-version-macro=on address-model=64 link=static debug-iterators=off invariant-checks=on define=BOOST_ASIO_DISABLE_IOCP asserts=on testing.execute=off - - - name: run sims - uses: nick-fields/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 120 - command: | - cd simulation - b2 --hash -l700 release msvc-version-macro=on address-model=64 link=static debug-iterators=off invariant-checks=on define=BOOST_ASIO_DISABLE_IOCP asserts=on - - build: - name: Build - runs-on: windows-2019 - continue-on-error: true - - strategy: - matrix: - include: - - config: asio-debugging=on picker-debugging=on windows-version=vista - - config: windows-api=store windows-version=win10 - - config: deprecated-functions=off - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: install boost - run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git - cd boost - bootstrap.bat - - - name: boost headers - run: | - cd boost - .\b2 headers - - - name: build library - run: | - set BOOST_ROOT=%CD%\boost - set PATH=%BOOST_ROOT%;%PATH% - b2 ${{ matrix.config }} cxxstd=14 msvc-version-macro=on address-model=64 warnings=all warnings-as-errors=on - - - name: build examples - if: ${{ ! contains(matrix.config, 'windows-api=store') }} - run: | - set BOOST_ROOT=%CD%\boost - set PATH=%BOOST_ROOT%;%PATH% - cd examples - b2 ${{ matrix.config }} msvc-version-macro=on address-model=64 warnings=all warnings-as-errors=on - - - name: build tools - if: ${{ ! contains(matrix.config, 'windows-api=store') }} - run: | - set BOOST_ROOT=%CD%\boost - set PATH=%BOOST_ROOT%;%PATH% - cd tools - b2 ${{ matrix.config }} msvc-version-macro=on address-model=64 warnings=all warnings-as-errors=on - - mingw: - name: MingW - runs-on: windows-latest - continue-on-error: true - - strategy: - matrix: - include: - - config: address-model=64 - - steps: - - name: checkout - uses: actions/checkout@v4 - with: - submodules: true - fetch-depth: 1 - filter: tree:0 - - - name: install boost - run: | - git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git - cd boost - bootstrap.bat - - - name: boost headers - run: | - cd boost - .\b2 headers - - - name: Set up MinGW - uses: egor-tensin/setup-mingw@v2 - with: - static: 0 - platform: x64 - - - name: tests (deterministic) - run: | - set BOOST_ROOT=%CD%\boost - set PATH=%BOOST_ROOT%;%PATH% - set PYTHON_INTERPRETER=python - cd test - b2 toolset=gcc asserts=on release target-os=windows -l400 warnings=all warnings-as-errors=on ${{ matrix.config }} cxxflags=-Wno-error=array-bounds cxxflags=-Wno-error=stringop-overflow deterministic-tests testing.execute=off diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2630bac6be..bc0bbdf0038 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,11 +31,6 @@ repos: - id: debug-statements - id: check-symlinks - id: check-toml -- repo: https://github.com/pappasam/toml-sort - rev: v0.24.2 - hooks: - - id: toml-sort - args: [--all, --in-place] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 0f4af51b6a8..36871359468 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ PATH = "/tmp/boost:$PATH" before-all = [ "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", "./tools/cibuildwheel/setup_ccache_on_manylinux.sh", - "./tools/cibuildwheel/setup_openssl.sh", - "yum install -y glibc-static" # needed for libutil.a and libdl.a + "yum install -y openssl-devel", + "yum install -y glibc-static", # needed for libutil.a and libdl.a ] before-test = "ccache -s" select = "*-manylinux_*" diff --git a/tools/cibuildwheel/manylinux/build-openssl.sh b/tools/cibuildwheel/manylinux/build-openssl.sh index b93e209acad..faa9757808e 100755 --- a/tools/cibuildwheel/manylinux/build-openssl.sh +++ b/tools/cibuildwheel/manylinux/build-openssl.sh @@ -8,19 +8,20 @@ set -exuo pipefail MY_DIR=$(dirname "${BASH_SOURCE[0]}") # Get build utilities -source $MY_DIR/build_utils.sh +# shellcheck source-path=SCRIPTDIR +source "${MY_DIR}/build_utils.sh" # Install a more recent openssl -check_var ${OPENSSL_ROOT} -check_var ${OPENSSL_HASH} -check_var ${OPENSSL_DOWNLOAD_URL} +check_var "${OPENSSL_ROOT}" +check_var "${OPENSSL_HASH}" +check_var "${OPENSSL_DOWNLOAD_URL}" OPENSSL_VERSION=${OPENSSL_ROOT#*-} OPENSSL_MIN_VERSION=1.1.1 # || test $? -eq 141 is there to ignore SIGPIPE with set -o pipefail # c.f. https://stackoverflow.com/questions/22464786/ignoring-bash-pipefail-for-error-code-141#comment60412687_33026977 -INSTALLED=$((openssl version | head -1 || test $? -eq 141) | awk '{ print $2 }') +INSTALLED=$( (openssl version | head -1 || test $? -eq 141) | awk '{ print $2 }') SMALLEST=$(echo -e "${INSTALLED}\n${OPENSSL_MIN_VERSION}" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | head -1 || test $? -eq 141) # Ignore letters in version numbers @@ -29,23 +30,24 @@ if [ "${SMALLEST}" = "${OPENSSL_MIN_VERSION}" ]; then exit 0 fi -if which yum; then - yum erase -y openssl-devel -elif which apk; then - apk del openssl-dev -else - apt-get remove -y libssl-dev +if [ "${OS_ID_LIKE}" = "rhel" ];then + manylinux_pkg_remove openssl-devel +elif [ "${OS_ID_LIKE}" = "alpine" ]; then + manylinux_pkg_remove openssl-dev fi -fetch_source ${OPENSSL_ROOT}.tar.gz ${OPENSSL_DOWNLOAD_URL} -check_sha256sum ${OPENSSL_ROOT}.tar.gz ${OPENSSL_HASH} -tar -xzf ${OPENSSL_ROOT}.tar.gz -pushd ${OPENSSL_ROOT} -./config no-shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS} -fPIC" CXXFLAGS="${MANYLINUX_CXXFLAGS} -fPIC" LDFLAGS="${MANYLINUX_LDFLAGS} -fPIC" > /dev/null -make > /dev/null -make install_sw > /dev/null +PREFIX=/opt/_internal/openssl-${OPENSSL_VERSION%.*} + +fetch_source "${OPENSSL_ROOT}.tar.gz" "${OPENSSL_DOWNLOAD_URL}" +check_sha256sum "${OPENSSL_ROOT}.tar.gz" "${OPENSSL_HASH}" +tar -xzf "${OPENSSL_ROOT}.tar.gz" +pushd "${OPENSSL_ROOT}" +./Configure "--prefix=${PREFIX}" "--openssldir=${PREFIX}" --libdir=lib CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" CXXFLAGS="${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS} -Wl,-rpath,\$(LIBRPATH)" > /dev/null +make +make install_sw popd -rm -rf ${OPENSSL_ROOT} ${OPENSSL_ROOT}.tar.gz +rm -rf "${OPENSSL_ROOT}" "${OPENSSL_ROOT}.tar.gz" +strip_ "${PREFIX}" -/usr/local/ssl/bin/openssl version +"${PREFIX}/bin/openssl" version diff --git a/tools/cibuildwheel/manylinux/build_utils.sh b/tools/cibuildwheel/manylinux/build_utils.sh index 961e34d0512..04dfa2446a4 100755 --- a/tools/cibuildwheel/manylinux/build_utils.sh +++ b/tools/cibuildwheel/manylinux/build_utils.sh @@ -10,58 +10,114 @@ MANYLINUX_CFLAGS="-g -O2 -Wall -fdebug-prefix-map=/=. -fstack-protector-strong - MANYLINUX_CXXFLAGS="-g -O2 -Wall -fdebug-prefix-map=/=. -fstack-protector-strong -Wformat -Werror=format-security" MANYLINUX_LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now" -export BASE_POLICY=manylinux -if [ "${AUDITWHEEL_POLICY:0:9}" == "musllinux" ]; then +if [ "${AUDITWHEEL_POLICY:0:10}" == "musllinux_" ]; then export BASE_POLICY=musllinux + PACKAGE_MANAGER=apk +else + export BASE_POLICY=manylinux + if command -v dnf >/dev/null 2>&1; then + PACKAGE_MANAGER=dnf + elif command -v yum >/dev/null 2>&1; then + PACKAGE_MANAGER=yum + else + echo "unsupported image" + exit 1 + fi fi +# shellcheck source=/dev/null +OS_ID_LIKE=$(. /etc/os-release; echo "${ID} ${ID_LIKE:-}") +case "${OS_ID_LIKE}" in + *rhel*) OS_ID_LIKE=rhel;; + *alpine*) OS_ID_LIKE=alpine;; + *) echo "unsupported image"; exit 1;; +esac + function check_var { - if [ -z "$1" ]; then - echo "required variable not defined" - exit 1 - fi + if [ -z "$1" ]; then + echo "required variable not defined" + exit 1 + fi } function fetch_source { - # This is called both inside and outside the build context (e.g. in Travis) to prefetch - # source tarballs, where curl exists (and works) - local file=$1 - check_var ${file} - local url=$2 - check_var ${url} - if [ -f ${file} ]; then - echo "${file} exists, skipping fetch" - else - curl -fsSL -o ${file} ${url}/${file} - fi + # This is called both inside and outside the build context (e.g. in Travis) to prefetch + # source tarballs, where curl exists (and works) + local file=$1 + check_var "${file}" + local url=$2 + check_var "${url}" + if [ -f "${file}" ]; then + echo "${file} exists, skipping fetch" + else + curl -fsSL -o "${file}" "${url}/${file}" + fi } function check_sha256sum { - local fname=$1 - check_var ${fname} - local sha256=$2 - check_var ${sha256} - - echo "${sha256} ${fname}" > ${fname}.sha256 - sha256sum -c ${fname}.sha256 - rm -f ${fname}.sha256 -} + local fname=$1 + check_var "${fname}" + local sha256=$2 + check_var "${sha256}" + echo "${sha256} ${fname}" > "${fname}.sha256" + sha256sum -c "${fname}.sha256" + rm -f "${fname}.sha256" +} +# shellcheck disable=SC2120 # optional arguments function do_standard_install { - ./configure "$@" CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" "CXXFLAGS=${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS}" > /dev/null - make > /dev/null - make install > /dev/null + ./configure "$@" CPPFLAGS="${MANYLINUX_CPPFLAGS}" CFLAGS="${MANYLINUX_CFLAGS}" "CXXFLAGS=${MANYLINUX_CXXFLAGS}" LDFLAGS="${MANYLINUX_LDFLAGS}" > /dev/null + make > /dev/null + make install > /dev/null } function strip_ { # Strip what we can -- and ignore errors, because this just attempts to strip # *everything*, including non-ELF files: - find $1 -type f -print0 | xargs -0 -n1 strip --strip-unneeded 2>/dev/null || true + find "$1" -type f -print0 | xargs -0 -n1 strip --strip-unneeded 2>/dev/null || true } function clean_pyc { - find $1 -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete + find "$1" -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete +} + +function manylinux_pkg_install { + if [ "${PACKAGE_MANAGER}" = "yum" ]; then + yum -y install "$@" + elif [ "${PACKAGE_MANAGER}" = "dnf" ]; then + dnf -y install --allowerasing "$@" + elif [ "${PACKAGE_MANAGER}" = "apk" ]; then + apk add --no-cache "$@" + else + return 1 + fi +} + +function manylinux_pkg_remove { + if [ "${PACKAGE_MANAGER}" = "yum" ]; then + yum erase -y "$@" + elif [ "${PACKAGE_MANAGER}" = "dnf" ];then + dnf erase -y "$@" + elif [ "${PACKAGE_MANAGER}" = "apk" ]; then + apk del "$@" + else + return 1 + fi +} + +function manylinux_pkg_clean { + if [ "${PACKAGE_MANAGER}" = "yum" ]; then + yum clean all + rm -rf /var/cache/yum + elif [ "${PACKAGE_MANAGER}" = "dnf" ]; then + dnf clean all + rm -rf /var/cache/dnf + elif [ "${PACKAGE_MANAGER}" = "apk" ]; then + : + else + return 1 + fi } diff --git a/tools/cibuildwheel/manylinux/openssl-version.sh b/tools/cibuildwheel/manylinux/openssl-version.sh index 8c645e1bad8..09eb43bf9f0 100755 --- a/tools/cibuildwheel/manylinux/openssl-version.sh +++ b/tools/cibuildwheel/manylinux/openssl-version.sh @@ -1,5 +1,5 @@ #!/bin/bash -export OPENSSL_ROOT=openssl-1.1.1l -export OPENSSL_HASH=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 -export OPENSSL_DOWNLOAD_URL=https://www.openssl.org/source +export OPENSSL_ROOT=openssl-3.0.15 +export OPENSSL_HASH=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533 +export OPENSSL_DOWNLOAD_URL=https://github.com/openssl/openssl/releases/download/${OPENSSL_ROOT}