From b3090baf49ad5b875a269880944434f869798f78 Mon Sep 17 00:00:00 2001 From: msclock <43399351+msclock@users.noreply.github.com> Date: Sat, 30 Nov 2024 13:21:50 +0800 Subject: [PATCH] ci: setup vcpkg env properly Signed-off-by: msclock <43399351+msclock@users.noreply.github.com> --- .github/workflows/cd.yml | 12 ------------ pyproject.toml | 18 +++++++++++------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6e45dda..c4e0e48 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -72,18 +72,6 @@ jobs: uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 if: runner.os == 'Linux' && contains(matrix.use_qemu, matrix.arch) - - name: Check architecture and set environment variable - if: runner.os == 'Linux' - run: | - echo "Checking architecture..." - if [[ ${{ matrix.arch }} == "aarch64" || - ${{ matrix.arch }} == "ppc64le" || - ${{ matrix.arch }} == "s390x" || - ${{ matrix.arch }} == *"arm"* ]]; then - echo "Set VCPKG_FORCE_SYSTEM_BINARIES=1" - echo "CIBW_ENVIRONMENT=VCPKG_FORCE_SYSTEM_BINARIES=1" >> $GITHUB_ENV - fi - - name: Build wheels uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 env: diff --git a/pyproject.toml b/pyproject.toml index e0ce3ac..92b5613 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,9 +7,7 @@ name = "cppcheck" description = "Package cppcheck as a python wheel." readme = "README.md" license = { text = "Apache-2.0" } -authors = [ - { email = "msclock@126.com", name = "msclock" }, -] +authors = [{ email = "msclock@126.com", name = "msclock" }] requires-python = ">=3.7" classifiers = [ "Intended Audience :: Science/Research", @@ -66,10 +64,10 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" sdist.include = ["src/cppcheck/_version.py"] cmake.args = [ "-DBUILD_TESTING=OFF", - "-DCMAKE_BUILD_TYPE=ReWithDebInfo", # Required RelWithDebInfo or Release + "-DCMAKE_BUILD_TYPE=ReWithDebInfo", # Required RelWithDebInfo or Release "-DCMAKE_TOOLCHAIN_FILE=cmake/vcpkg/vcpkg.toolchain.cmake", "-DVCPKG_OVERLAY_TRIPLETS=cmake/vcpkg/triplets", - "-DVCPKG_OVERLAY_PORTS=cmake/vcpkg/ports" + "-DVCPKG_OVERLAY_PORTS=cmake/vcpkg/ports", ] [tool.setuptools_scm] @@ -82,13 +80,19 @@ test-extras = ["test"] test-skip = ["*-win_arm64", "*-macosx_universal2:arm64"] [tool.cibuildwheel.linux] -before-build =[ +before-build = [ 'yum install zip -y || apk add zip || true', 'apt update && apt install zip pkg-config -y || true', 'pip install cmake ninja', - 'cmake --version', 'git --version', 'ninja --version', + 'cmake --version', + 'git --version', + 'ninja --version', ] +[[tool.cibuildwheel.overrides]] +select = "*linux_{aarch64,armv7l,ppc64le,s390x}" +environment = { VCPKG_FORCE_SYSTEM_BINARIES = "1" } + [tool.pytest.ini_options] minversion = "6.0" addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]