From ccd4017fa09ef487104305792aae22661ee3190f Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Mon, 3 Jul 2023 12:12:02 +0100 Subject: [PATCH] move windows x86_64 builds to PGO --- .github/workflows/ci.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e08f6b10d..c4a01d2d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -360,11 +360,13 @@ jobs: container: messense/manylinux_2_24-cross:s390x interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 exclude: - # Optimized PGO builds for manylinux follow a different matrix, maybe in future - # maturin-action can support this automatically + # Optimized PGO builds for x86_64 manylinux and windows follow a different matrix, + # maybe in future maturin-action can support this automatically - os: ubuntu target: x86_64 manylinux: auto + - os: windows + target: x86_64 # Windows on arm64 only supports Python 3.11+ - os: windows target: aarch64 @@ -410,11 +412,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu] - platform: [linux] + os: [ubuntu, windows] target: [x86_64] manylinux: [auto] - interpreter: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7", "pypy3.8", "pypy3.9"] + interpreter: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.7", "pypy3.8", "pypy3.9"] + include: + - os: ubuntu + platform: linux + - os: windows + ls: dir runs-on: ${{ matrix.os }}-latest steps: @@ -450,13 +456,20 @@ jobs: rust-toolchain: stable docker-options: -e CI + - name: detect rust host + run: echo RUST_HOST=$(rustc -Vv | grep host | cut -d ' ' -f 2) >> "$GITHUB_ENV" + shell: bash + - name: generate pgo data run: | pip install -U pip pip install -r tests/requirements.txt pip install pydantic-core --no-index --no-deps --find-links pgo-wheel --force-reinstall pytest tests/benchmarks - rustup run stable bash -c '$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata' + rustup run stable bash -c 'echo LLVM_PROFDATA=$RUSTUP_HOME/toolchains/$RUSTUP_TOOLCHAIN/lib/rustlib/${{ env.RUST_HOST }}/bin/llvm-profdata >> "$GITHUB_ENV"' + + - name: merge pgo data + run: ${{ env.LLVM_PROFDATA }} merge -o ${{ github.workspace }}/merged.profdata ${{ github.workspace }}/profdata - name: build pgo-optimized wheel uses: PyO3/maturin-action@v1