Skip to content

[mypyc] Cache built librt in tests#20626

Merged
JukkaL merged 7 commits intomasterfrom
librt-cache-build
Jan 21, 2026
Merged

[mypyc] Cache built librt in tests#20626
JukkaL merged 7 commits intomasterfrom
librt-cache-build

Conversation

@JukkaL
Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL commented Jan 21, 2026

Store built librt under build/librt-cache, so that it can be reused to speed up mypyc tests when there are no changes under mypyc/lib-rt. Also invalidate the cache if the build environment changes.

This also ensures that each test run only compiles librt at most twice (with and without experimental features), instead of once per test case that requires librt.

Use filelock to support parallel tests.

Building librt can take 6+ seconds, so the savings can be quite significant. We are also planning to add several additional librt submodules, which will further slow down the build, and this will result in a larger number of tests that require librt. The main benefit is that adding more tests or submodules doesn't significantly slow down tests.

@JukkaL JukkaL merged commit 6da2283 into master Jan 21, 2026
16 checks passed
@JukkaL JukkaL deleted the librt-cache-build branch January 21, 2026 15:29
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.

2 participants