diff --git a/.github/workflows/Build_wheels_for_cpython27_x86.yml b/.github/workflows/Build_wheels_for_cpython27_x86.yml index 4eea46a5e..78a7538ca 100644 --- a/.github/workflows/Build_wheels_for_cpython27_x86.yml +++ b/.github/workflows/Build_wheels_for_cpython27_x86.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython2.7 x86 on Ubuntu18 with GCC-7 with All warnings +name: Build wheels for CPython2.7 x86 on Ubuntu16 with GCC-5 with All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+18 i386 CPython 2.7 + - name: Ubuntu 24+16 i386 CPython 2.7 runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: bionic + release: xenial mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 #pyver: "2.7" @@ -63,9 +63,9 @@ jobs: sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list echo "# deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list echo "# deb [trusted=yes] http://apt.llvm.org/${{matrix.os.release}}/ llvm-toolchain-${{matrix.os.release}}-20 main " > clang.list @@ -85,14 +85,14 @@ jobs: - name: Pepare dev files if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y python3 - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install --no-install-recommends -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py" - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72'" - name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' @@ -111,13 +111,22 @@ jobs: - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | - false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ version=`cat version` echo version=$version sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/ sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ ; echo LLH; ls -lh build/*/zstd.so; echo LDD; ldd build/*/zstd.so;echo FILE; file build/*/zstd.so; echo LIBC; bash ./glibc-check.sh build/*/zstd.so" sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version && ${{matrix.os.pypkg}} setup.py test" + - name: Test module for SIMD instructions + if: matrix.os.matrix == 'linux' + run: | + version=`cat version` + echo version=$version + echo cpuinfo + ./simd-cklheck-cpuinfo.py + sudo cp -v simd-check ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ ; echo LLH; ls -lh build/*/zstd.so; echo SIMD; bash ./simd-check build/*/zstd.so" + - name: Pepare wheel for upload if: matrix.os.matrix == 'linux' run: | @@ -127,7 +136,6 @@ jobs: sudo ls -lh ./dist/* sudo mv -v ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-linux_${{matrix.os.tag_arch}}.whl" ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" - - name: Test for secrets access id: check_secrets # If a third party makes a pull request diff --git a/.github/workflows/Build_wheels_for_cpython27_x86_64.yml b/.github/workflows/Build_wheels_for_cpython27_x86_64.yml index 2d216ce3e..a468db480 100644 --- a/.github/workflows/Build_wheels_for_cpython27_x86_64.yml +++ b/.github/workflows/Build_wheels_for_cpython27_x86_64.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython2.7 x64 on Ubuntu18 with GCC-7 with All warnings +name: Build wheels for CPython2.7 x64 on Ubuntu16 with GCC-5 with All warnings on: [push, pull_request] @@ -14,19 +14,19 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 amd64 CPython 2.7 + - name: Ubuntu 24+14 amd64 CPython 2.7 runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: bionic + release: xenial mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 #pyver: "2.7" getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py pypkg: python2.7 pyengine_tag: cp27-cp27mu - libc_tag: manylinux_2_4 + libc_tag: manylinux_2_14 steps: - name: Checkout code uses: actions/checkout@v4 @@ -85,15 +85,15 @@ jobs: - name: Pepare dev files if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y python3 - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools'" - + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72'" + - name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | @@ -102,9 +102,9 @@ jobs: sudo tar -xvf dist/zstd-$version.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC-7 - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc-7 -v - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version && CC=gcc-7 ZSTD_ASM=1 _ZSTD_SMALL=1 ZSTD_WARNINGS=1 _ZSTD_WERRORS=1 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=1 ${{matrix.os.pypkg}} setup.py bdist_wheel" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC-5 + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc-5 -v + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version && CC=gcc-5 ZSTD_ASM=1 _ZSTD_SMALL=1 ZSTD_WARNINGS=1 ZSTD_WERRORS=1 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=1 ${{matrix.os.pypkg}} setup.py bdist_wheel" - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' @@ -122,15 +122,17 @@ jobs: sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/dist/* ./dist sudo ls -lh ./dist/* sudo mv -v ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-linux_${{matrix.os.tag_arch}}.whl" ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" - -# - name: Upload artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: wheels -#. path: ./dist -# compression-level: 0 - + - name: Test module for SIMD instructions + if: matrix.os.matrix == 'linux' + run: | + version=`cat version` + echo version=$version + echo cpuinfo + ./simd-check-cpuinfo.py + sudo cp -v simd-check ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash-c "cd /build_wheel/zstd-$version/ ; echo LLH; ls -lh build/*/zstd.so; echo SIMD; bash ./simd-check build/*/zstd.so" + - name: Test for secrets access id: check_secrets # If a third party makes a pull request diff --git a/.github/workflows/Build_wheels_for_cpython27_x86_ext.yml b/.github/workflows/Build_wheels_for_cpython27_x86_ext.yml index 6f9d0c612..b39f7c717 100644 --- a/.github/workflows/Build_wheels_for_cpython27_x86_ext.yml +++ b/.github/workflows/Build_wheels_for_cpython27_x86_ext.yml @@ -88,10 +88,9 @@ jobs: - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt-cache madison clang-18 sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py" - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools'" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72'" - name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' @@ -103,8 +102,8 @@ jobs: false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC-5 - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc-5 -v + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc -v sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version && _CC=clang-20 ZSTD_ASM=1 ZSTD_WARNINGS=1 ZSTD_WERRORS=1 _ZSTD_SMALL=1 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 ZSTD_EXTERNAL=1 CC=gcc-5 ${{matrix.os.pypkg}} setup.py bdist_wheel " - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} diff --git a/.github/workflows/Build_wheels_for_cpython310_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython310_x86_64_u16.yml similarity index 100% rename from .github/workflows/Build_wheels_for_cpython310_x86_64_u24.yml rename to .github/workflows/Build_wheels_for_cpython310_x86_64_u16.yml diff --git a/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml index 97480dff6..8f7d5cd15 100644 --- a/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython312_x86_u16.yml @@ -24,7 +24,7 @@ jobs: getpipurl: https://bootstrap.pypa.io/pip/get-pip.py pypkg: python3.12 pyengine_tag: cp312-cp312 - libc_tag: manylinux_2_14 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/Build_wheels_for_cpython313_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython313_x64_u18.yml similarity index 88% rename from .github/workflows/Build_wheels_for_cpython313_x86_64_u24.yml rename to .github/workflows/Build_wheels_for_cpython313_x64_u18.yml index 080ce2952..f86acfaa5 100644 --- a/.github/workflows/Build_wheels_for_cpython313_x86_64_u24.yml +++ b/.github/workflows/Build_wheels_for_cpython313_x64_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.13 x86_64 on Ubuntu22 with GCC-10 All warnings +name: Build wheels for CPython3.13 x86_64 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+20 amd64 CPython 3.13 + - name: Ubuntu 24+18 amd64 CPython 3.13 runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: jammy + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu getpipurl: https://bootstrap.pypa.io/pip/get-pip.py pypkg: python3.13 @@ -61,14 +61,12 @@ jobs: sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list - echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list - false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo "# deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d - false && sudo rm -fv ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/trusted.gpg.d/* && sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg' sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg' sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true' @@ -167,3 +165,14 @@ jobs: TWINE_PASSWORD: "${{ secrets.test_pypi_password }}" run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + - name: Create Release and Upload Assets + if: > + startsWith(github.event.ref, 'refs/tags') && + steps.check_secrets.outputs.HAS_SECRET + # This uses a community action for creating and uploading to a release + uses: softprops/action-gh-release@v1 + with: + files: dist/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # The default GITHUB_TOKEN has sufficient permissions \ No newline at end of file diff --git a/.github/workflows/Build_wheels_for_cpython313_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython313_x86_u18.yml similarity index 93% rename from .github/workflows/Build_wheels_for_cpython313_x86_u16.yml rename to .github/workflows/Build_wheels_for_cpython313_x86_u18.yml index f121beff7..eb5da41f4 100644 --- a/.github/workflows/Build_wheels_for_cpython313_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython313_x86_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.13 x86 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.13 x86 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,17 +14,17 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 x86 CPython 3.13 + - name: Ubuntu 24+18 x86 CPython 3.13 runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu getpipurl: https://bootstrap.pypa.io/pip/get-pip.py pypkg: python3.13 pyengine_tag: cp313-cp313 - libc_tag: manylinux_2_14 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 @@ -66,7 +66,6 @@ jobs: echo "# deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d - false && sudo rm -fv ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/trusted.gpg.d/* && sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg' sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg' sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true' @@ -165,3 +164,14 @@ jobs: TWINE_PASSWORD: "${{ secrets.test_pypi_password }}" run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + - name: Create Release and Upload Assets + if: > + startsWith(github.event.ref, 'refs/tags') && + steps.check_secrets.outputs.HAS_SECRET + # This uses a community action for creating and uploading to a release + uses: softprops/action-gh-release@v1 + with: + files: dist/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # The default GITHUB_TOKEN has sufficient permissions \ No newline at end of file diff --git a/.github/workflows/Build_wheels_for_cpython313t_x64_u16.yml b/.github/workflows/Build_wheels_for_cpython313t_x64_u16.yml deleted file mode 100644 index 4311ccf12..000000000 --- a/.github/workflows/Build_wheels_for_cpython313t_x64_u16.yml +++ /dev/null @@ -1,168 +0,0 @@ -name: Build wheels for CPython3.13-nogil x64 on Ubuntu22 with GCC-10 All warnings - -on: [push, pull_request] - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build_wheels: - name: Build wheel - ${{ matrix.os.name }} - runs-on: ${{ matrix.os.runs-on }} - strategy: - fail-fast: false - matrix: - os: - - name: Ubuntu 24+22 amd64 CPython 3.13-nogil - runs-on: ubuntu-latest - matrix: linux - arch: amd64 - tag_arch: x86_64 - release: jammy - mirror: http://azure.archive.ubuntu.com/ubuntu - getpipurl: https://bootstrap.pypa.io/pip/get-pip.py - pypkg: python3.13-nogil - pypkgdev: python3.13-dev - pypkgexe: python3.13t - pyengine_tag: cp313-cp313t - libc_tag: manylinux_2_14 - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Update and upgrade Ubuntu 24 - if: matrix.os.matrix == 'linux' - run: | - sudo which apt - sudo apt update; - sudo apt purge -y firefox lxd snapd; - sudo apt install -y zram-config; - sudo apt list --upgradable; - sudo apt upgrade -y; - sudo apt install -f - - - name: Build source distribution with Ubuntu - if: matrix.os.matrix == 'linux' - run: | - sudo apt install -y debootstrap qemu-user; - pip install build; - python -m build --sdist --outdir dist . - - - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} - if: matrix.os.matrix == 'linux' - run: | - sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,gnupg,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log - - - name: Update and Upgrade Ubuntu ${{matrix.os.release}} - if: matrix.os.matrix == 'linux' - run: | - sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel - sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc - sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts - sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list - echo "# deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list - echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update - sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg' - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg' - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true' - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y - - - - name: Pepare dev files - if: matrix.os.matrix == 'linux' - run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev file - - - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} - if: matrix.os.matrix == 'linux' - run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkgdev}} ${{matrix.os.pypkg}} gcc pkg-config ${{matrix.os.pypkgadd}} - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkgexe}} get-pip.py || true" - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkgexe}} -m pip install -U 'setuptools<72.0'" - - - name: Pepare source and build wheel for ${{matrix.os.pypkgexe}} ${{matrix.os.arch}} - if: matrix.os.matrix == 'linux' - run: | - version=`cat version` - sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ - sudo tar -xvf dist/zstd-$version.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc -v - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && ZSTD_ASM=1 ZSTD_WARNINGS=1 _ZSTD_SMALL=1 LDFLAGS='-Wl,--as-needed -Wl,-s' ZSTD_BUILD_STRIP=1 _ZSTD_SPEED=0 _ZSTD_SPEEDMAX=0 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 ZS5D_WERRORS=1 ${{matrix.os.pypkgexe}} setup.py bdist_wheel" - - - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} - if: matrix.os.matrix == 'linux' - run: | - version=`cat version` - false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ - sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/ - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && echo LLH; ls -lh build/lib*/zstd.*.so; ldd build/lib*/zstd.*.so ; file build/lib*/zstd.*.so; bash ./glibc-check.sh build/lib*/zstd.*.so" - - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && ${{matrix.os.pypkg}} setup.py test" - - - name: Pepare wheel for upload - if: matrix.os.matrix == 'linux' - run: | - version=`cat version` - sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/dist/* ./dist - sudo ls -lh ./dist/* - sudo mv -v ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-linux_${{matrix.os.tag_arch}}.whl" ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" - - - - name: Test for secrets access - id: check_secrets - # If a third party makes a pull request - # this allows automated steps below to be skipped - # and leave a clean PR CI run - shell: bash - run: | - unset HAS_SECRET - unset HAS_SECRET_TEST - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST} - env: - SECRET: "${{ secrets.pypi_password }}" - SECRET_TEST: "${{ secrets.test_pypi_password }}" - - - name: Install twine - run: pip install 'twine<=6.0.1' - - - name: Publish distribution to PyPI - if: > - startsWith(github.event.ref, 'refs/tags') && - steps.check_secrets.outputs.HAS_SECRET - env: - # If the PR/Push has secret access - # and PYPI_PASSWORD is in GH Secrets for this repo - # and this is a tag, publish to PyPI - TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ - TWINE_USERNAME: "${{ secrets.pypi_username }}" - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: "${{ secrets.pypi_password }}" - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' - - - name: Publish distribution to Test PyPI - if: steps.check_secrets.outputs.HAS_SECRET - env: - # If the PR/Push has secret access - # and TEST_PYPI_PASSWORD is in GH Secrets for this repo - # then publish each build to test PyPI - TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_USERNAME: "${{ secrets.test_pypi_username }}" - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: "${{ secrets.test_pypi_password }}" - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' - diff --git a/.github/workflows/Build_wheels_for_cpython313t_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython313t_x64_u18.yml similarity index 90% rename from .github/workflows/Build_wheels_for_cpython313t_x86_u16.yml rename to .github/workflows/Build_wheels_for_cpython313t_x64_u18.yml index 5f11f4bda..370d9e06c 100644 --- a/.github/workflows/Build_wheels_for_cpython313t_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython313t_x64_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.13-nogil x86 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.13-nogil x64 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,20 +14,17 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 i386 CPython 3.13-nogil + - name: Ubuntu 24+18 amd64 CPython 3.13-nogil runs-on: ubuntu-latest matrix: linux - arch: i386 - tag_arch: i686 - release: xenial + arch: amd64 + tag_arch: x86_64 + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu - #version: 1.5.6.7 - # pyver: "3.7" getpipurl: https://bootstrap.pypa.io/pip/get-pip.py pypkg: python3.13-nogil pypkgdev: python3.13-dev pypkgexe: python3.13t - #pypkgadd: python3.13-distutils pyengine_tag: cp313-cp313t libc_tag: manylinux_2_14 steps: @@ -69,11 +66,9 @@ jobs: echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list - echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list - false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt + echo "# deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d - false && sudo rm -fv ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/trusted.gpg.d/* && sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg' sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg' sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true' @@ -101,11 +96,10 @@ jobs: version=`cat version` sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ sudo tar -xvf dist/zstd-$version.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ - false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc -v - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && ZSTD_ASM=1 ZSTD_WARNINGS=1 _ZSTD_SMALL=1 LDFLAGS='-Wl,--as-needed -Wl,-s' ZSTD_BUILD_STRIP=1 _ZSTD_SPEED=0 _ZSTD_SPEEDMAX=0 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkgexe}} setup.py bdist_wheel" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && ZSTD_ASM=1 ZSTD_WARNINGS=1 _ZSTD_SMALL=1 LDFLAGS='-Wl,--as-needed -Wl,-s' ZSTD_BUILD_STRIP=1 _ZSTD_SPEED=0 _ZSTD_SPEEDMAX=0 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 ZSTD_WERRORS=1 ${{matrix.os.pypkgexe}} setup.py bdist_wheel" - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' @@ -172,3 +166,14 @@ jobs: TWINE_PASSWORD: "${{ secrets.test_pypi_password }}" run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + - name: Create Release and Upload Assets + if: > + startsWith(github.event.ref, 'refs/tags') && + steps.check_secrets.outputs.HAS_SECRET + # This uses a community action for creating and uploading to a release + uses: softprops/action-gh-release@v1 + with: + files: dist/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # The default GITHUB_TOKEN has sufficient permissions \ No newline at end of file diff --git a/.github/workflows/Build_wheels_for_cpython313t_x86_u18.yml b/.github/workflows/Build_wheels_for_cpython313t_x86_u18.yml new file mode 100644 index 000000000..94080a4d2 --- /dev/null +++ b/.github/workflows/Build_wheels_for_cpython313t_x86_u18.yml @@ -0,0 +1,183 @@ +name: Build wheels for CPython3.13-nogil x86 on Ubuntu18 with GCC-7 All warnings + +on: [push, pull_request] + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }} + cancel-in-progress: true + +jobs: + build_wheels: + name: Build wheel - ${{ matrix.os.name }} + runs-on: ${{ matrix.os.runs-on }} + strategy: + fail-fast: false + matrix: + os: + - name: Ubuntu 24+18 i386 CPython 3.13-nogil + runs-on: ubuntu-latest + matrix: linux + arch: i386 + tag_arch: i686 + release: bionic + mirror: http://azure.archive.ubuntu.com/ubuntu + #version: 1.5.6.7 + # pyver: "3.7" + getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + pypkg: python3.13-nogil + pypkgdev: python3.13-dev + pypkgexe: python3.13t + #pypkgadd: python3.13-distutils + pyengine_tag: cp313-cp313t + libc_tag: manylinux_2_4 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Update and upgrade Ubuntu 24 + if: matrix.os.matrix == 'linux' + run: | + sudo which apt + sudo apt update; + sudo apt purge -y firefox lxd snapd; + sudo apt install -y zram-config; + sudo apt list --upgradable; + sudo apt upgrade -y; + sudo apt install -f + + - name: Build source distribution with Ubuntu + if: matrix.os.matrix == 'linux' + run: | + sudo apt install -y debootstrap qemu-user; + pip install build; + python -m build --sdist --outdir dist . + + - name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,gnupg,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log + + - name: Update and Upgrade Ubuntu ${{matrix.os.release}} + if: matrix.os.matrix == 'linux' + run: | + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel + sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc + sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts + sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list + echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list + echo "# deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update + sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg' + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg' + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true' + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y + + + - name: Pepare dev files + if: matrix.os.matrix == 'linux' + run: | + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev file + + - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkgdev}} ${{matrix.os.pypkg}} gcc pkg-config ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkgexe}} get-pip.py || true" + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkgexe}} -m pip install -U 'setuptools<72.0'" + + - name: Pepare source and build wheel for ${{matrix.os.pypkgexe}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + version=`cat version` + sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ + sudo tar -xvf dist/zstd-$version.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/ + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} echo GCC + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} gcc -v + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && ZSTD_ASM=1 ZSTD_WARNINGS=1 _ZSTD_SMALL=1 ZSTD_BUILD_STRIP=1 _ZSTD_SPEED=0 _ZSTD_SPEEDMAX=0 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkgexe}} setup.py bdist_wheel" + + - name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}} + if: matrix.os.matrix == 'linux' + run: | + version=`cat version` + false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/ + sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/ + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && echo LLH; ls -lh build/lib*/zstd.*.so; ldd build/lib*/zstd.*.so ; file build/lib*/zstd.*.so; bash ./glibc-check.sh build/lib*/zstd.*.so" + + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-$version/ && ${{matrix.os.pypkg}} setup.py test" + + - name: Pepare wheel for upload + if: matrix.os.matrix == 'linux' + run: | + version=`cat version` + sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-$version/dist/* ./dist + sudo ls -lh ./dist/* + sudo mv -v ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-linux_${{matrix.os.tag_arch}}.whl" ./dist/"zstd-$version-${{matrix.os.pyengine_tag}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl" + + + - name: Test for secrets access + id: check_secrets + # If a third party makes a pull request + # this allows automated steps below to be skipped + # and leave a clean PR CI run + shell: bash + run: | + unset HAS_SECRET + unset HAS_SECRET_TEST + if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi + if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi + echo ::set-output name=HAS_SECRET::${HAS_SECRET} + echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST} + env: + SECRET: "${{ secrets.pypi_password }}" + SECRET_TEST: "${{ secrets.test_pypi_password }}" + + - name: Install twine + run: pip install 'twine<=6.0.1' + + - name: Publish distribution to PyPI + if: > + startsWith(github.event.ref, 'refs/tags') && + steps.check_secrets.outputs.HAS_SECRET + env: + # If the PR/Push has secret access + # and PYPI_PASSWORD is in GH Secrets for this repo + # and this is a tag, publish to PyPI + TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ + TWINE_USERNAME: "${{ secrets.pypi_username }}" + TWINE_NON_INTERACTIVE: 1 + TWINE_PASSWORD: "${{ secrets.pypi_password }}" + run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + + - name: Publish distribution to Test PyPI + if: steps.check_secrets.outputs.HAS_SECRET + env: + # If the PR/Push has secret access + # and TEST_PYPI_PASSWORD is in GH Secrets for this repo + # then publish each build to test PyPI + TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ + TWINE_USERNAME: "${{ secrets.test_pypi_username }}" + TWINE_NON_INTERACTIVE: 1 + TWINE_PASSWORD: "${{ secrets.test_pypi_password }}" + run: twine upload --non-interactive --skip-existing --verbose 'dist/*' + + - name: Create Release and Upload Assets + if: > + startsWith(github.event.ref, 'refs/tags') && + steps.check_secrets.outputs.HAS_SECRET + # This uses a community action for creating and uploading to a release + uses: softprops/action-gh-release@v1 + with: + files: dist/*64*.tar.xz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # The default GITHUB_TOKEN has sufficient permissions \ No newline at end of file diff --git a/.github/workflows/Build_wheels_for_cpython314_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython314_x64_u18.yml similarity index 95% rename from .github/workflows/Build_wheels_for_cpython314_x86_64_u24.yml rename to .github/workflows/Build_wheels_for_cpython314_x64_u18.yml index 3a95409b2..04aa4648f 100644 --- a/.github/workflows/Build_wheels_for_cpython314_x86_64_u24.yml +++ b/.github/workflows/Build_wheels_for_cpython314_x64_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.14 x86_64 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.14 amd64 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 amd64 CPython 3.14 + - name: Ubuntu 24+18 amd64 CPython 3.14 runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" @@ -84,12 +84,13 @@ jobs: - name: Pepare dev files if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev file + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y aptitude + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y libzstd-dev file - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" diff --git a/.github/workflows/Build_wheels_for_cpython314_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython314_x86_u18.yml similarity index 95% rename from .github/workflows/Build_wheels_for_cpython314_x86_u16.yml rename to .github/workflows/Build_wheels_for_cpython314_x86_u18.yml index d9974a334..623f018f2 100644 --- a/.github/workflows/Build_wheels_for_cpython314_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython314_x86_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.14 x86 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.14 x86 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,17 +14,17 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 x86 CPython 3.14 + - name: Ubuntu 24+18 x86 CPython 3.14 runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu getpipurl: https://bootstrap.pypa.io/pip/get-pip.py pypkg: python3.14 pyengine_tag: cp314-cp314 - libc_tag: manylinux_2_14 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 @@ -81,12 +81,13 @@ jobs: - name: Pepare dev files if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev file + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y aptitude + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y libzstd-dev file - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true" sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'" diff --git a/.github/workflows/Build_wheels_for_cpython314t_x64_u16.yml b/.github/workflows/Build_wheels_for_cpython314t_x64_u18.yml similarity index 95% rename from .github/workflows/Build_wheels_for_cpython314t_x64_u16.yml rename to .github/workflows/Build_wheels_for_cpython314t_x64_u18.yml index f13e835f9..ea2d793ce 100644 --- a/.github/workflows/Build_wheels_for_cpython314t_x64_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython314t_x64_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.14-nogil x64 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.14-nogil x64 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 amd64 CPython 3.14-nogil + - name: Ubuntu 24+18 amd64 CPython 3.14-nogil runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" @@ -86,12 +86,13 @@ jobs: - name: Pepare dev files if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev file + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y aptitude + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y libzstd-dev file - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkgdev}} ${{matrix.os.pypkg}} gcc pkg-config ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y ${{matrix.os.pypkgdev}} ${{matrix.os.pypkg}} gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkgexe}} get-pip.py || true" sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkgexe}} -m pip install -U 'setuptools<72.0'" diff --git a/.github/workflows/Build_wheels_for_cpython314t_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython314t_x86_u18.yml similarity index 95% rename from .github/workflows/Build_wheels_for_cpython314t_x86_u16.yml rename to .github/workflows/Build_wheels_for_cpython314t_x86_u18.yml index 32e6e0f92..16b6deee7 100644 --- a/.github/workflows/Build_wheels_for_cpython314t_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython314t_x86_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.14-nogil x86 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.14-nogil x86 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 i386 CPython 3.14-nogil + - name: Ubuntu 24+18 i386 CPython 3.14-nogil runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" @@ -29,7 +29,7 @@ jobs: pypkgexe: python3.14t #pypkgadd: python3.13-distutils pyengine_tag: cp314-cp314t - libc_tag: manylinux_2_14 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 @@ -86,12 +86,13 @@ jobs: - name: Pepare dev files if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev file + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y aptitude + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y libzstd-dev file - name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}} if: matrix.os.matrix == 'linux' run: | - sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkgdev}} ${{matrix.os.pypkg}} gcc pkg-config ${{matrix.os.pypkgadd}} + sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/aptitude install -y ${{matrix.os.pypkgdev}} ${{matrix.os.pypkg}} gcc pkg-config ${{matrix.os.pypkgadd}} sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkgexe}} get-pip.py || true" sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkgexe}} -m pip install -U 'setuptools<72.0'" diff --git a/.github/workflows/Build_wheels_for_cpython315_x86_64_u16.yml b/.github/workflows/Build_wheels_for_cpython315_x86_64_u18.yml similarity index 98% rename from .github/workflows/Build_wheels_for_cpython315_x86_64_u16.yml rename to .github/workflows/Build_wheels_for_cpython315_x86_64_u18.yml index 975c02988..ed51eb085 100644 --- a/.github/workflows/Build_wheels_for_cpython315_x86_64_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython315_x86_64_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.15 x86_64 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.15 x86_64 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 amd64 CPython 3.15 + - name: Ubuntu 24+18 amd64 CPython 3.15 runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" diff --git a/.github/workflows/Build_wheels_for_cpython315_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython315_x86_u18.yml similarity index 98% rename from .github/workflows/Build_wheels_for_cpython315_x86_u16.yml rename to .github/workflows/Build_wheels_for_cpython315_x86_u18.yml index 4d96628b2..8aacbf40f 100644 --- a/.github/workflows/Build_wheels_for_cpython315_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython315_x86_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.15 x86 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.15 x86 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 i686 CPython 3.15 + - name: Ubuntu 24+18 i686 CPython 3.15 runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" @@ -27,7 +27,7 @@ jobs: pypkg: python3.15 #pypkgadd: python3.13-distutils pyengine_tag: cp315-cp315 - libc_tag: manylinux_2_14 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/Build_wheels_for_cpython315t_x64_u16.yml b/.github/workflows/Build_wheels_for_cpython315t_x64_u18.yml similarity index 98% rename from .github/workflows/Build_wheels_for_cpython315t_x64_u16.yml rename to .github/workflows/Build_wheels_for_cpython315t_x64_u18.yml index 931574582..8d1c640cb 100644 --- a/.github/workflows/Build_wheels_for_cpython315t_x64_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython315t_x64_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.15-nogil x64 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.15-nogil x64 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 amd64 CPython 3.15-nogil + - name: Ubuntu 24+18 amd64 CPython 3.15-nogil runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: xenial + release: bioic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" diff --git a/.github/workflows/Build_wheels_for_cpython315t_x86_u16.yml b/.github/workflows/Build_wheels_for_cpython315t_x86_u18.yml similarity index 97% rename from .github/workflows/Build_wheels_for_cpython315t_x86_u16.yml rename to .github/workflows/Build_wheels_for_cpython315t_x86_u18.yml index e7e1bca9b..ae9eb6f0f 100644 --- a/.github/workflows/Build_wheels_for_cpython315t_x86_u16.yml +++ b/.github/workflows/Build_wheels_for_cpython315t_x86_u18.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.15-nogil x86 on Ubuntu16 with GCC-5 All warnings +name: Build wheels for CPython3.15-nogil x86 on Ubuntu18 with GCC-7 All warnings on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 i386 CPython 3.15-nogil + - name: Ubuntu 24+18 i386 CPython 3.15-nogil runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" @@ -29,7 +29,7 @@ jobs: pypkgexe: python3.15t #pypkgadd: python3.13-distutils pyengine_tag: cp315-cp315t - libc_tag: manylinux_2_14 + libc_tag: manylinux_2_4 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/Build_wheels_for_cpython34_x86.yml b/.github/workflows/Build_wheels_for_cpython34_x86.yml index ba01e788a..c80a0509a 100644 --- a/.github/workflows/Build_wheels_for_cpython34_x86.yml +++ b/.github/workflows/Build_wheels_for_cpython34_x86.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.4 x86 on Ubuntu16 +name: Build wheels for CPython3.4 x86 on Ubuntu18 on: [push, pull_request] @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 i386 CPython 3.4 + - name: Ubuntu 24+18 i386 CPython 3.4 runs-on: ubuntu-latest matrix: linux arch: i386 tag_arch: i686 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 #pyver: "3.4" diff --git a/.github/workflows/Build_wheels_for_cpython34_x86_64.yml b/.github/workflows/Build_wheels_for_cpython34_x86_64.yml index 0946db31c..e2b5b851d 100644 --- a/.github/workflows/Build_wheels_for_cpython34_x86_64.yml +++ b/.github/workflows/Build_wheels_for_cpython34_x86_64.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.4 x86_64 on Ubuntu16 +name: Build wheels for CPython3.4 x86_64 on Ubuntu18 on: [push, pull_request] @@ -14,19 +14,19 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 amd64 CPython 3.4 + - name: Ubuntu 24+18 amd64 CPython 3.4 runs-on: ubuntu-latest matrix: linux arch: amd64 tag_arch: x86_64 - release: xenial + release: bionic mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 #pyver: "3.4" getpipurl: https://bootstrap.pypa.io/pip/3.4/get-pip.py pypkg: python3.4 pyengine_tag: cp34-cp34m - libc_tag: manylinux_2_4 + libc_tag: manylinux_2_14 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/Build_wheels_for_cpython35_x86_64_u20.yml b/.github/workflows/Build_wheels_for_cpython35_x64_u16.yml similarity index 99% rename from .github/workflows/Build_wheels_for_cpython35_x86_64_u20.yml rename to .github/workflows/Build_wheels_for_cpython35_x64_u16.yml index 2e6ab6f63..1ae2779de 100644 --- a/.github/workflows/Build_wheels_for_cpython35_x86_64_u20.yml +++ b/.github/workflows/Build_wheels_for_cpython35_x64_u16.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.5 x86_64 on Ubuntu16 with GCC-5 All warnings errors +name: Build wheels for CPython3.5 x64 on Ubuntu16 with GCC-5 All warnings errors on: [push, pull_request] diff --git a/.github/workflows/Build_wheels_for_cpython36_x86_64_u20.yml b/.github/workflows/Build_wheels_for_cpython36_x64_u16.yml similarity index 99% rename from .github/workflows/Build_wheels_for_cpython36_x86_64_u20.yml rename to .github/workflows/Build_wheels_for_cpython36_x64_u16.yml index a4d3967f4..8d385ee07 100644 --- a/.github/workflows/Build_wheels_for_cpython36_x86_64_u20.yml +++ b/.github/workflows/Build_wheels_for_cpython36_x64_u16.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.6 x86_64 on Ubuntu16 with All warnings errors +name: Build wheels for CPython3.6 x64 on Ubuntu16 with All warnings errors on: [push, pull_request] diff --git a/.github/workflows/Build_wheels_for_cpython37_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython37_x64_u16.yml similarity index 100% rename from .github/workflows/Build_wheels_for_cpython37_x86_64_u24.yml rename to .github/workflows/Build_wheels_for_cpython37_x64_u16.yml diff --git a/.github/workflows/Build_wheels_for_cpython38_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython38_x64_u16.yml similarity index 100% rename from .github/workflows/Build_wheels_for_cpython38_x86_64_u24.yml rename to .github/workflows/Build_wheels_for_cpython38_x64_u16.yml diff --git a/.github/workflows/Build_wheels_for_cpython39_x86_64_u24.yml b/.github/workflows/Build_wheels_for_cpython39_x64_u16.yml similarity index 98% rename from .github/workflows/Build_wheels_for_cpython39_x86_64_u24.yml rename to .github/workflows/Build_wheels_for_cpython39_x64_u16.yml index 7be8b8df3..ee1752627 100644 --- a/.github/workflows/Build_wheels_for_cpython39_x86_64_u24.yml +++ b/.github/workflows/Build_wheels_for_cpython39_x64_u16.yml @@ -1,4 +1,4 @@ -name: Build wheels for CPython3.9 x86_64 on Ubuntu16 +name: Build wheels for CPython3.9 x64 on Ubuntu16 on: [push, pull_request] @@ -23,7 +23,7 @@ jobs: mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 # pyver: "3.7" - getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + getpipurl: https://bootstrap.pypa.io/pip/3.9/get-pip.py pypkg: python3.9 pypkgadd: python3.9-distutils pyengine_tag: cp39-cp39 diff --git a/.github/workflows/Build_wheels_for_cpython39_x86.yml b/.github/workflows/Build_wheels_for_cpython39_x86.yml index f2ae642cc..bbe1f45ba 100644 --- a/.github/workflows/Build_wheels_for_cpython39_x86.yml +++ b/.github/workflows/Build_wheels_for_cpython39_x86.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: - - name: Ubuntu 24+16 i386 CPython 3.9 + - name: Ubuntu 24+16 i686 CPython 3.9 runs-on: ubuntu-latest matrix: linux arch: i386 @@ -23,7 +23,7 @@ jobs: mirror: http://azure.archive.ubuntu.com/ubuntu #version: 1.5.6.7 #pyver: "3.9" - getpipurl: https://bootstrap.pypa.io/pip/get-pip.py + getpipurl: https://bootstrap.pypa.io/pip/3.9/get-pip.py pypkg: python3.9 pypkgadd: python3.9-distutils pyengine_tag: cp39-cp39 diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index df2e15184..c6b30a8c7 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -188,6 +188,8 @@ jobs: matrix: windows cibw: build: cp27-* + build: cp36-* + build: cp38-* - os: matrix: macos cibw: @@ -298,7 +300,7 @@ jobs: CIBW_BUILD: ${{ matrix.cibw.build }} CIBW_BUILD_VERBOSITY: 2 # Skip 32-bit builds // NO - # CIBW_SKIP: '*-win32 *_i686' + CIBW_SKIP: 'cp36-win* cp38-win*' CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw.manylinux }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw.manylinux }} CIBW_MUSLLINUX_I686_IMAGE: ${{ matrix.cibw.musllinux }} @@ -330,7 +332,7 @@ jobs: CIBW_BUILD: ${{ matrix.cibw.build }} CIBW_BUILD_VERBOSITY: 2 # Skip 32-bit builds // NO - # CIBW_SKIP: '*-win32 *_i686' + CIBW_SKIP: 'cp36-win* cp38-win*' CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw.manylinux }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw.manylinux }} CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.cibw.manylinux }} @@ -363,7 +365,7 @@ jobs: CIBW_BUILD: ${{ matrix.cibw.build }} CIBW_BUILD_VERBOSITY: 2 # Skip 32-bit builds // NO - # CIBW_SKIP: '*-win32 *_i686' + CIBW_SKIP: 'cp36-win* cp38-win*' CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw.manylinux }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw.manylinux }} CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.cibw.manylinux }} diff --git a/simd-check b/simd-check new file mode 100755 index 000000000..a46fe89a1 --- /dev/null +++ b/simd-check @@ -0,0 +1,73 @@ +#!/bin/bash + +tmpf=`tempfile` +echo tmpf=$tmpf + +echo "File:$1" +echo " dump ASM instructions..." +objdump -d $1>$tmpf + +echo -en "count SSE lines:" +# Source - https://stackoverflow.com/a/50056059 +# Posted by Andriy Makukha, modified by community. See post 'Timeline' for change history +# Retrieved 2026-03-31, License - CC BY-SA 4.0 + +awk '/[ \t](addps|andnps|andps|cmpps|cvtpi2ps|cvtps2pi|cvttps2pi|divps|maxps|minps|movaps|movhlps|movhps|movlhps|movlps|movmskps|movntps|movntq|movups|mulps|orps|pavgb|pavgw|pextrw|pinsrw|pmaxsw|pmaxub|pminsw|pminub|pmovmskb|pmulhuw|psadbw|pshufw|rcpps|rsqrtps|shufps|sqrtps|subps|unpckhps|unpcklps|xorps)[ \t]/' $tmpf | wc -l + +echo -en "count SSE2 lines:" + +# Source - https://stackoverflow.com/a/50056059 +# Posted by Andriy Makukha, modified by community. See post 'Timeline' for change history +# Retrieved 2026-03-31, License - CC BY-SA 4.0 + +awk '/[ \t](addpd|addsd|andnpd|andpd|cmppd|comisd|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtps2dq|cvtps2pd|cvtsd2si|cvtsd2ss|cvtsi2sd|cvtss2sd|cvttpd2dq|cvttpd2pi|cvtps2dq|cvttsd2si|divpd|divsd|maxpd|maxsd|minpd|minsd|movapd|movhpd|movlpd|movmskpd|movupd|mulpd|mulsd|orpd|shufpd|sqrtpd|sqrtsd|subpd|subsd|ucomisd|unpckhpd|unpcklpd|xorpd|movdq2q|movdqa|movdqu|movq2dq|paddq|pmuludq|pshufhw|pshuflw|pshufd|pslldq|psrldq|punpckhqdq|punpcklqdq)[ \t]/' $tmpf | wc -l + +echo -en "count SSE3 lines:" + +# Source - https://stackoverflow.com/a/50056059 +# Posted by Andriy Makukha, modified by community. See post 'Timeline' for change history +# Retrieved 2026-03-31, License - CC BY-SA 4.0 + +awk '/[ \t](addsubpd|addsubps|haddpd|haddps|hsubpd|hsubps|movddup|movshdup|movsldup|lddqu|fisttp)[ \t]/' $tmpf | wc -l + +echo -en "count SSSE3 lines:" + +# Source - https://stackoverflow.com/a/50056059 +# Posted by Andriy Makukha, modified by community. See post 'Timeline' for change history +# Retrieved 2026-03-31, License - CC BY-SA 4.0 + +awk '/[ \t](psignw|psignd|psignb|pshufb|pmulhrsw|pmaddubsw|phsubw|phsubsw|phsubd|phaddw|phaddsw|phaddd|palignr|pabsw|pabsd|pabsb)[ \t]/' $tmpf | wc -l + +echo -en "count SSE4 lines:" + +# Source - https://stackoverflow.com/a/50056059 +# Posted by Andriy Makukha, modified by community. See post 'Timeline' for change history +# Retrieved 2026-03-31, License - CC BY-SA 4.0 + +awk '/[ \t](mpsadbw|phminposuw|pmulld|pmuldq|dpps|dppd|blendps|blendpd|blendvps|blendvpd|pblendvb|pblenddw|pminsb|pmaxsb|pminuw|pmaxuw|pminud|pmaxud|pminsd|pmaxsd|roundps|roundss|roundpd|roundsd|insertps|pinsrb|pinsrd|pinsrq|extractps|pextrb|pextrd|pextrw|pextrq|pmovsxbw|pmovzxbw|pmovsxbd|pmovzxbd|pmovsxbq|pmovzxbq|pmovsxwd|pmovzxwd|pmovsxwq|pmovzxwq|pmovsxdq|pmovzxdq|ptest|pcmpeqq|pcmpgtq|packusdw|pcmpestri|pcmpestrm|pcmpistri|pcmpistrm|crc32|popcnt|movntdqa|extrq|insertq|movntsd|movntss|lzcnt)[ \t]/' $tmpf | wc -l + +echo -en "count AVX lines:" + +# Source - https://stackoverflow.com/a/50056059 +# Posted by Andriy Makukha, modified by community. See post 'Timeline' for change history +# Retrieved 2026-03-31, License - CC BY-SA 4.0 + +awk '/[ \t](vmovapd|vmulpd|vaddpd|vsubpd|vfmadd213pd|vfmadd231pd|vfmadd132pd|vmulsd|vaddsd|vmosd|vsubsd|vbroadcastss|vbroadcastsd|vblendpd|vshufpd|vroundpd|vroundsd|vxorpd|vfnmadd231pd|vfnmadd213pd|vfnmadd132pd|vandpd|vmaxpd|vmovmskpd|vcmppd|vpaddd|vbroadcastf128|vinsertf128|vextractf128|vfmsub231pd|vfmsub132pd|vfmsub213pd|vmaskmovps|vmaskmovpd|vpermilps|vpermilpd|vperm2f128|vzeroall|vzeroupper|vpbroadcastb|vpbroadcastw|vpbroadcastd|vpbroadcastq|vbroadcasti128|vinserti128|vextracti128|vpminud|vpmuludq|vgatherdpd|vgatherqpd|vgatherdps|vgatherqps|vpgatherdd|vpgatherdq|vpgatherqd|vpgatherqq|vpmaskmovd|vpmaskmovq|vpermps|vpermd|vpermpd|vpermq|vperm2i128|vpblendd|vpsllvd|vpsllvq|vpsrlvd|vpsrlvq|vpsravd|vblendmpd|vblendmps|vpblendmd|vpblendmq|vpblendmb|vpblendmw|vpcmpd|vpcmpud|vpcmpq|vpcmpuq|vpcmpb|vpcmpub|vpcmpw|vpcmpuw|vptestmd|vptestmq|vptestnmd|vptestnmq|vptestmb|vptestmw|vptestnmb|vptestnmw|vcompresspd|vcompressps|vpcompressd|vpcompressq|vexpandpd|vexpandps|vpexpandd|vpexpandq|vpermb|vpermw|vpermt2b|vpermt2w|vpermi2pd|vpermi2ps|vpermi2d|vpermi2q|vpermi2b|vpermi2w|vpermt2ps|vpermt2pd|vpermt2d|vpermt2q|vshuff32x4|vshuff64x2|vshuffi32x4|vshuffi64x2|vpmultishiftqb|vpternlogd|vpternlogq|vpmovqd|vpmovsqd|vpmovusqd|vpmovqw|vpmovsqw|vpmovusqw|vpmovqb|vpmovsqb|vpmovusqb|vpmovdw|vpmovsdw|vpmovusdw|vpmovdb|vpmovsdb|vpmovusdb|vpmovwb|vpmovswb|vpmovuswb|vcvtps2udq|vcvtpd2udq|vcvttps2udq|vcvttpd2udq|vcvtss2usi|vcvtsd2usi|vcvttss2usi|vcvttsd2usi|vcvtps2qq|vcvtpd2qq|vcvtps2uqq|vcvtpd2uqq|vcvttps2qq|vcvttpd2qq|vcvttps2uqq|vcvttpd2uqq|vcvtudq2ps|vcvtudq2pd|vcvtusi2ps|vcvtusi2pd|vcvtusi2sd|vcvtusi2ss|vcvtuqq2ps|vcvtuqq2pd|vcvtqq2pd|vcvtqq2ps|vgetexppd|vgetexpps|vgetexpsd|vgetexpss|vgetmantpd|vgetmantps|vgetmantsd|vgetmantss|vfixupimmpd|vfixupimmps|vfixupimmsd|vfixupimmss|vrcp14pd|vrcp14ps|vrcp14sd|vrcp14ss|vrndscaleps|vrndscalepd|vrndscaless|vrndscalesd|vrsqrt14pd|vrsqrt14ps|vrsqrt14sd|vrsqrt14ss|vscalefps|vscalefpd|vscalefss|vscalefsd|valignd|valignq|vdbpsadbw|vpabsq|vpmaxsq|vpmaxuq|vpminsq|vpminuq|vprold|vprolvd|vprolq|vprolvq|vprord|vprorvd|vprorq|vprorvq|vpscatterdd|vpscatterdq|vpscatterqd|vpscatterqq|vscatterdps|vscatterdpd|vscatterqps|vscatterqpd|vpconflictd|vpconflictq|vplzcntd|vplzcntq|vpbroadcastmb2q|vpbroadcastmw2d|vexp2pd|vexp2ps|vrcp28pd|vrcp28ps|vrcp28sd|vrcp28ss|vrsqrt28pd|vrsqrt28ps|vrsqrt28sd|vrsqrt28ss|vgatherpf0dps|vgatherpf0qps|vgatherpf0dpd|vgatherpf0qpd|vgatherpf1dps|vgatherpf1qps|vgatherpf1dpd|vgatherpf1qpd|vscatterpf0dps|vscatterpf0qps|vscatterpf0dpd|vscatterpf0qpd|vscatterpf1dps|vscatterpf1qps|vscatterpf1dpd|vscatterpf1qpd|vfpclassps|vfpclasspd|vfpclassss|vfpclasssd|vrangeps|vrangepd|vrangess|vrangesd|vreduceps|vreducepd|vreducess|vreducesd|vpmovm2d|vpmovm2q|vpmovm2b|vpmovm2w|vpmovd2m|vpmovq2m|vpmovb2m|vpmovw2m|vpmullq|vpmadd52luq|vpmadd52huq|v4fmaddps|v4fmaddss|v4fnmaddps|v4fnmaddss|vp4dpwssd|vp4dpwssds|vpdpbusd|vpdpbusds|vpdpwssd|vpdpwssds|vpcompressb|vpcompressw|vpexpandb|vpexpandw|vpshld|vpshldv|vpshrd|vpshrdv|vpopcntd|vpopcntq|vpopcntb|vpopcntw|vpshufbitqmb|gf2p8affineinvqb|gf2p8affineqb|gf2p8mulb|vpclmulqdq|vaesdec|vaesdeclast|vaesenc|vaesenclast)[ \t]/' $tmpf | wc -l + +echo -en "count AVX2 lines:" + +grep -c ymm $tmpf + +echo -en "count AVX512 lines:" + +grep -c zmm $tmpf + +echo -en "count BMI lines:" + +grep -cE "tzcnt|lzcnt|andn|bextr" $tmpf + +echo -en "count BMI2 lines:" + +grep -cE "bzhi|pdep|pext|sarx|shlx|shrx" $tmpf + +rm -f $tmpf \ No newline at end of file diff --git a/simd-check-cpuinfo.py b/simd-check-cpuinfo.py new file mode 100755 index 000000000..5a675d921 --- /dev/null +++ b/simd-check-cpuinfo.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python + +import os +import sys + +cpuinfofp = "/proc/cpuinfo" + +f = open(cpuinfofp,"r") +lines = f.readlines() +f.close() + +flagsln = "" + +for line in lines: + if line.startswith("flags\t\t:"): + flagsln = line + break + +if not flagsln: + print("line with flags not found. lines:") + print(lines) + sys.exit(1) + +flags = flagsln.split(':')[1].strip().split() +#print("found flags:") +#print(flags) + +sys.stdout.write("SSE: ") +if 'sse' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("SSE2: ") +if 'sse2' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("SSE3: ") +if 'sse3' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("sSSE3: ") +if 'ssse3' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("SSE4.1: ") +if 'sse4_1' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("SSE4.2: ") +if 'sse4_2' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("AVX: ") +if 'avx' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("AVX2: ") +if 'avx2' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("AVX512f: ") +if 'avx512f' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("AVX512vl: ") +if 'avx512vl' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("AVX512dq: ") +if 'avx512dq' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("AVX512bw: ") +if 'avx512bw' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("FMA: ") +if 'fma' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("F16C: ") +if 'f16c' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("BMI1: ") +if 'bmi1' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") + +sys.stdout.write("BMI2: ") +if 'bmi2' in flags: + sys.stdout.write("yes\n") +else: + sys.stdout.write("no\n") diff --git a/src/util.c b/src/util.c index 2e2de2d7c..e0a62b7dd 100644 --- a/src/util.c +++ b/src/util.c @@ -40,7 +40,11 @@ typedef BOOL(WINAPI* LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD); int UTIL_countAvailableCores(void) { time_t currTime = time(NULL); - if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) numLogicalCores = 0; + if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) { + printdn("Cache reach TTL. Drop numLogicalCores.", numLogicalCores); + numLogicalCores = 0; + } + if (numLogicalCores != 0) return numLogicalCores; { LPFN_GLPI glpi; @@ -120,7 +124,11 @@ int UTIL_countAvailableCores(void) int UTIL_countAvailableCores(void) { time_t currTime = time(NULL); - if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) numLogicalCores = 0; + if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) { + printdn("Cache reach TTL. Drop numLogicalCores.", numLogicalCores); + numLogicalCores = 0; + } + if (numLogicalCores != 0) return numLogicalCores; { size_t size = sizeof(int32_t); @@ -147,7 +155,10 @@ int UTIL_countAvailableCores(void) int UTIL_countAvailableCores_posix_sysconf(void) { time_t currTime = time(NULL); - if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) numLogicalCores = 0; + if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) { + printdn("Cache reach TTL. Drop numLogicalCores.", numLogicalCores); + numLogicalCores = 0; + } if (numLogicalCores != 0) { printdn("Stored static numLogicalCores: %d\n", numLogicalCores); @@ -177,7 +188,10 @@ int UTIL_countAvailableCores(void) { int UTIL_countAvailableCores_parse_cpuinfo(void) { time_t currTime = time(NULL); - if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) numLogicalCores = 0; + if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) { + printdn("Cache reach TTL. Drop numLogicalCores.", numLogicalCores); + numLogicalCores = 0; + } if (numLogicalCores != 0) { printdn("Stored static numLogicalCores: %d\n", numLogicalCores); @@ -269,7 +283,10 @@ int UTIL_countAvailableCores_parse_cpuinfo(void) int UTIL_countAvailableCores(void) { time_t currTime = time(NULL); - if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) numLogicalCores = 0; + if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) { + printdn("Cache reach TTL. Drop numLogicalCores.", numLogicalCores); + numLogicalCores = 0; + } if (numLogicalCores != 0) return numLogicalCores; @@ -302,7 +319,10 @@ int UTIL_countAvailableCores(void) int UTIL_countAvailableCores(void) { time_t currTime = time(NULL); - if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) numLogicalCores = 0; + if (lastTimeCached && currTime-lastTimeCached>util_cpuCoresCacheTTL) { + printdn("Cache reach TTL. Drop numLogicalCores.", numLogicalCores); + numLogicalCores = 0; + } if (numLogicalCores != 0) return numLogicalCores; diff --git a/src/util.h b/src/util.h index fbb635e28..8f5e773ca 100644 --- a/src/util.h +++ b/src/util.h @@ -67,11 +67,11 @@ extern "C" { #endif #if defined(_WIN32) || defined(WIN32) - static int numLogicalCores = 1; + static int numLogicalCores = 0; static time_t lastTimeCached = 0; static int util_cpuCoresCacheTTL = 60; #else -__attribute__((unused)) static int numLogicalCores = 1; +__attribute__((unused)) static int numLogicalCores = 0; __attribute__((unused)) static time_t lastTimeCached = 0; __attribute__((unused)) static int util_cpuCoresCacheTTL = 60; #endif