-
Couldn't load subscription status.
- Fork 544
Fix inconsistent analysis on case-insensitive filesystems #3988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0bfa507 to
23a7403
Compare
This pull request has been marked as ready for review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on macOS we need a GNU compatible patch command, as the apple-shipped patch command cannot apply our patch files:
Error: Cannot apply patch 0 (patches/cloudflare-ca.patch)!
In Patches.php line 331:
Cannot apply patch 0 (patches/cloudflare-ca.patch)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual fix is here, everything else are adjustments to make sure this new logic is used all over the place
72d0d20 to
d283dbe
Compare
Update e2e-tests.yml Update e2e-tests.yml Update e2e-tests.yml Update e2e-tests.yml Update e2e-tests.yml Update e2e-tests.yml Update e2e-tests.yml fix PathRoutingParser extract and re-use AnalysedFilesResolver use AnalysedFilesResolver more use AnalysedFilesResolver more simplify test also on windows added failling ubuntu test added feature detect simplify detect more assertions simplify Update AnalysedFilesResolver.php
4716b6d to
10c222a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it. Why do you expect different outcomes on Linux vs. the rest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because linux does not have a case-insensitive filesystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you have a project that deliberately works only on case-insensitive filesystems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test mimics what php-src will do at runtime.
it will happily accept a different-cased path on windows/macos but doesn't on linux (acutally depending on the filesystem case-sensitivy not the OS itself).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like if the e2e test mimiced how your project actually worked. This just looks like PHPStan fixes macOS but breaks Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, lets look into #4003 which mimics our project setup more closely
Uh oh!
There was an error while loading. Please reload this page.
closes phpstan/phpstan#12972
since on macos filesystem paths are case-insensitive before this PR we ran into the following error:
-> PHPStan is using the simple-parser instead of the rich-parser as it does not handle the analyzed path case-insentive as macOS would do (same for windows)
see