Skip to content

[mypyc] Add test for incremental builtin_base class construction across groups#21524

Open
georgesittas wants to merge 2 commits into
python:masterfrom
VaggelisD:fix-load-type-map-builtin-base
Open

[mypyc] Add test for incremental builtin_base class construction across groups#21524
georgesittas wants to merge 2 commits into
python:masterfrom
VaggelisD:fix-load-type-map-builtin-base

Conversation

@georgesittas
Copy link
Copy Markdown
Contributor

@georgesittas georgesittas commented May 20, 2026

The fix for this was included in #21369, but no dedicated test was added.

This adds testIncrementalBuiltinBaseClassConstruction to run-multimodule.test: three modules compiled with separate=True, where step 2 changes a helper module's signature to force the caller to be recompiled while the exception module is only loaded from cache.

@p-sawicki
Copy link
Copy Markdown
Collaborator

can i get instructions how to reproduce the original issue? i checked out the parent of the merge commit of #21369 and cherry-picked this test but pytest mypyc/test/test_run.py::TestRunSeparate::run-multimodule.test::testIncrementalBuiltinBaseClassConstruction_separate passed. i've also patched fudge_dir_mtimes in case it forced recompilation without it but it still passed.

@georgesittas
Copy link
Copy Markdown
Contributor Author

Ah, it seems like the test framework only treats files matching other*.py as additional compiled sources (source, comment), anything else is written to disk as plain Python, not added to the build.

I missed this and named the helper files myerrors.py and myutil.py, so MyError would not be in a compiled group. Which is why the bug, which needs cross-group emit, is not triggered.

Sorry for the confusion. Feel free to give it another shot; I also verified that the test fails in the parent commit and should pass in this PR.

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