Skip to content

Commit 33fe7b4

Browse files
authored
Merge pull request #389 from Yhg1s/extra_configure_flags
Add support for passing extra flags to Python's configure via env vars
2 parents ee25fac + 02eaebf commit 33fe7b4

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

Diff for: bench_runner/templates/_benchmark.src.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
if: ${{ steps.should_run.outputs.should_run != 'false' }}
212212
run: |
213213
cd cpython
214-
./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' || '' }}
214+
./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:-}
215215
make ${{ runner.arch == 'ARM64' && '-j' || '-j4' }}
216216
./python -VV
217217
- name: Install pyperformance
@@ -321,7 +321,7 @@ jobs:
321321
if: ${{ steps.should_run.outputs.should_run != 'false' }}
322322
run: |
323323
cd cpython
324-
./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' || '' }}
324+
./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:-}
325325
make -j4
326326
./python.exe -VV
327327
# On macos ARM64, actions/setup-python isn't available, so we rely on a

Diff for: bench_runner/templates/bench_runner.toml

+25-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,24 @@ notification_issue = 182
2424
# socket.gethostname()).
2525
# available: True if the machine is available (we need to keep the
2626
# metadata around for old machines for the generated results). (Default: True)
27-
27+
# include_in_all: Whether to include the runner when choosing to run a
28+
# benchmark on all runners.
29+
# env: a table of extra environment variables to pass to the runs.
30+
#
31+
# A few notable environment variables for runners:
32+
# CC, CXX: used by Python's configure to determine the compiler to use.
33+
# LLVM_AR, LLVM_PROFDATA: used for PGO optimization passes with clang, when
34+
# using a version of clang that isn't the default. These must be full
35+
# paths for configure to handle them correctly.
36+
# LLVM_BOLT, MERGE_FDATA: like AR/PROFDATA, but for BOLT.
37+
# LLVM_BOLT may need to point to, e.g., /usr/lib/llvm-19/bin/llvm-bolt
38+
# rather than /usr/bin/llvm-bolt-19 (see
39+
# https://github.com/python/cpython/issues/127047).
40+
# PYTHON_CONFIGURE_FLAGS: extra flags to pass to Python's configure. These
41+
# can override all earlier flags, which by default include
42+
# --enable-optimizations and --with-lto=full.
43+
# BUILD_DEST: (windows only) where to make build.bat install. This is
44+
# required for the Windows build to succeed.
2845
[[runners]]
2946

3047
[runners.linux]
@@ -33,6 +50,13 @@ arch = "x86_64"
3350
hostname = "pyperf"
3451
available = true
3552

53+
[runners.windows]
54+
os = "windows"
55+
arch = "x86_64"
56+
hostname = "winperf"
57+
available = true
58+
env.BUILD_DEST = "PCbuild/amd64"
59+
3660
[plot]
3761
bases = ["3.11.0"]
3862
versions = [[3, 12]]

0 commit comments

Comments
 (0)