Skip to content

build: compile only the Python module and the sqlquack binary for the Python tests - #172

Merged
kvlonge merged 1 commit into
mainfrom
ci/python-module-build
Nov 11, 2026
Merged

kvlonge merged 1 commit into
mainfrom
ci/python-module-build

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Why

make python-api ran 22 tests that take about 1.5 s, but python-module depended on gate-build, which compiles every workspace crate, tool and test target, polyglot-sql included. A cold run took minutes and needed several GB of memory, enough to fail on small machines.

Changes

  • New python-build target: builds only sqlquack-python's library and the sqlquack binary, with the gate profile and the gate features, into the same target directory.
  • python-module (and so python-api and verify-recorded) uses $(PYTHON_MODULE_BUILD), which defaults to python-build.
  • CI's checks job sets PYTHON_MODULE_BUILD=gate-build: check-merge has already built the whole gate there, so its Python tests and replay keep using that one build.

Verification

Same 8-core orb, fresh target directory each time, one run each (/usr/bin/time):

make python-api main this PR
cold wall 444 s 134 s
cold user CPU 3,107 s 733 s
cold peak RSS 4.8 GB 2.4 GB
target size 3.1 GB 1.3 GB
warm wall 3.5 s 2.3 s

22 passed in every run. After a full gate-build, the first narrow build recompiles the 7 workspace crates whose features the rest of the workspace widens (about 75 s); later switches between the two builds take under a second.

  • make check-ci passed, with python-api on the narrow build.
  • make verify-recorded on the narrow binary: 12,236 cases, 0 failed, 0 unproven, the same counts as main.

… Python tests

python-module depended on gate-build, so make python-api compiled every
workspace crate, tool and test target, polyglot-sql included, before
running tests that take about a second and a half. A new python-build
target builds only sqlquack-python's library and the sqlquack binary, in
the gate profile with the gate features; python-module, and so
python-api and verify-recorded, use it by default.

CI's checks job sets PYTHON_MODULE_BUILD=gate-build, because check-merge
has already built the whole gate there and its Python tests and replay
should use that one build.

Measured on one 8-core orb, fresh target directory each time, one run:
make python-api cold went from 444 s wall (3,107 s user CPU, 4.8 GB peak
RSS, 3.1 GB target) to 134 s wall (733 s user CPU, 2.4 GB peak RSS,
1.3 GB target). Warm went from 3.5 s to 2.3 s.
@kvlonge
kvlonge force-pushed the ci/python-module-build branch from 85be27f to 3f853df Compare November 11, 2026 12:54
@kvlonge
kvlonge enabled auto-merge November 11, 2026 12:54
@kvlonge
kvlonge added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 11, 2026
@kvlonge
kvlonge added this pull request to the merge queue Nov 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 11, 2026
@kvlonge
kvlonge added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 4011793 Nov 11, 2026
8 checks passed
@kvlonge
kvlonge deleted the ci/python-module-build branch November 11, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant