Skip to content

Add support for passing extra flags to Python's configure via env vars #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions bench_runner/templates/_benchmark.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
if: ${{ steps.should_run.outputs.should_run != 'false' }}
run: |
cd cpython
./configure --enable-option-checking=fatal ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }}
./configure --enable-option-checking=fatal ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }} ${PYTHON_CONFIGURE_FLAGS:-}
make ${{ runner.arch == 'ARM64' && '-j' || '-j4' }}
./python -VV
- name: Install pyperformance
Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:
if: ${{ steps.should_run.outputs.should_run != 'false' }}
run: |
cd cpython
./configure --enable-option-checking=fatal ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }}
./configure --enable-option-checking=fatal ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }} ${PYTHON_CONFIGURE_FLAGS:-}
make -j4
./python.exe -VV
# On macos ARM64, actions/setup-python isn't available, so we rely on a
Expand Down
26 changes: 25 additions & 1 deletion bench_runner/templates/bench_runner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,24 @@ notification_issue = 182
# socket.gethostname()).
# available: True if the machine is available (we need to keep the
# metadata around for old machines for the generated results). (Default: True)

# include_in_all: Whether to include the runner when choosing to run a
# benchmark on all runners.
# env: a table of extra environment variables to pass to the runs.
#
# A few notable environment variables for runners:
# CC, CXX: used by Python's configure to determine the compiler to use.
# LLVM_AR, LLVM_PROFDATA: used for PGO optimization passes with clang, when
# using a version of clang that isn't the default. These must be full
# paths for configure to handle them correctly.
# LLVM_BOLT, MERGE_FDATA: like AR/PROFDATA, but for BOLT.
# LLVM_BOLT may need to point to, e.g., /usr/lib/llvm-19/bin/llvm-bolt
# rather than /usr/bin/llvm-bolt-19 (see
# https://github.com/python/cpython/issues/127047).
# PYTHON_CONFIGURE_FLAGS: extra flags to pass to Python's configure. These
# can override all earlier flags, which by default include
# --enable-optimizations and --with-lto=full.
# BUILD_DEST: (windows only) where to make build.bat install. This is
# required for the Windows build to succeed.
[[runners]]

[runners.linux]
Expand All @@ -33,6 +50,13 @@ arch = "x86_64"
hostname = "pyperf"
available = true

[runners.windows]
os = "windows"
arch = "x86_64"
hostname = "winperf"
available = true
env.BUILD_DEST = "PCbuild/amd64"

[plot]
bases = ["3.11.0"]
versions = [[3, 12]]
Expand Down