Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,21 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.platform.arch }}
- name: "Install LLVM profiling tools"
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
run: rustup component add llvm-tools-preview
- name: "Train PGO Ruff"
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
shell: bash
run: |
export RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }-C target-feature=+crt-static"

python scripts/build_ruff_pgo.py \
--target "${{ matrix.platform.target }}" \
--target-dir "${{ github.workspace }}/target/ruff-pgo" \
--train-only

echo "RUSTFLAGS=${RUSTFLAGS:+${RUSTFLAGS} }-Cprofile-use=${{ github.workspace }}/target/ruff-pgo/ruff.profdata" >> "$GITHUB_ENV"
- name: "Prep README.md"
run: python scripts/transform_readme.py --target pypi
- name: "Build wheels"
Expand All @@ -210,6 +225,18 @@ jobs:
env:
# aarch64 build fails, see https://github.com/PyO3/maturin/issues/2110
XWIN_VERSION: 16
- name: "Verify static Windows runtime"
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
shell: bash
run: |
LLVM_READOBJ="$(rustc --print sysroot)/lib/rustlib/${{ matrix.platform.target }}/bin/llvm-readobj.exe"
IMPORTS_FILE="$RUNNER_TEMP/ruff-coff-imports.txt"
"$LLVM_READOBJ" --coff-imports "target/${{ matrix.platform.target }}/release/ruff.exe" > "$IMPORTS_FILE"

if grep -Eiq 'vcruntime[[:digit:]_]*\.dll|api-ms-win-crt-' "$IMPORTS_FILE"; then
echo "Ruff must not dynamically link the Visual C++ runtime" >&2
exit 1
fi
- name: "Test wheel"
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
Expand Down
Loading