Repository navigation
Bugfix: Autoloaders require source, not the file - #357
Merged
michielgerritsen merged 2 commits intoSep 14, 2026
Merged
michielgerritsen merged 2 commits into
michielgerritsen merged 2 commits into
Conversation
This was referenced Sep 1, 2026
|
Interesting, I just ran into the same issue today, and there's already a PR for it from yesterday. I hope we can get this resolved and released soon. Would love to help wherever I can 😊 |
michielgerritsen
force-pushed
the
bugfix/autoloader-requires-generated-file-not-source
branch
from
September 2, 2026 09:32
2417c71 to
7e34707
Compare
|
Any updates on when this fix will be merged? |
Contributor
Author
|
@JosephLeedy It got just released as 0.44.0 |
michielgerritsen
deleted the
bugfix/autoloader-requires-generated-file-not-source
branch
September 14, 2026 18:05
Thanks, @michielgerritsen! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On PHPStan 2.2.10 with PHP 8.3+, every generated Factory, Proxy, Extension and ExtensionInterface class fails with Internal error: Failed opening required '<?php ...'. FileCacheStorage saved the generated source but returned a file path from load(), which a CacheStorage must not do, so once PHPStan started to serve cache entries from its shared memory arena, Cache::load() returned the source and the autoloaders required that in place of the file. GeneratedFileCache replaces it: putFile() returns the path it wrote, and the autoloaders no longer touch PHPStan\Cache\Cache.
bin/ci_autoloader_smoke guards it with a real analysis over a generated fixture (cold cache, parallel) that fails on any internal error. It probes the arena first, and with REQUIRE_TURBO=1 it refuses to pass when the arena is unusable. The guard fails on master and passes here.
Fixes #356