-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Debug] Replaced logic for detecting filesystem case sensitivity #18130
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
When I cloned the master branch onto a Virtualbox Vagrant OSX El Capitan host, Ubuntu Wily guest, the `Symfony\Component\Debug\Tests\DebugClassLoaderTest::testFileCaseMismatch` failed because 'Failed asserting that exception of type "\RuntimeException" is thrown'. @wouterj confirmed he got the same problem, and it's because Virtualbox shared folders aren't case sensitive, even when the guest is using a case sensitive filesystem. So I've replaced the logic that looked at the name of the operating system. I ran the tests in the following environments: * Virtualbox/Vagrant - OSX Host, Ubuntu guest * Virtualbox/Vagrant - OSX Host, Windows guest * OSX native * Ubuntu native NB - I _didn't_ run it on native Windows (because I don't have easy access to one).
When I cloned the master branch onto a Virtualbox Vagrant OSX El Capitan host, Ubuntu Wily guest, the `Symfony\Component\Debug\Tests\DebugClassLoaderTest::testFileCaseMismatch` failed because 'Failed asserting that exception of type "\RuntimeException" is thrown'. @wouterj confirmed he got the same problem, and it's because Virtualbox shared folders aren't case sensitive, even when the guest is using a case sensitive filesystem. So I've replaced the logic that looked at the name of the operating system. I ran the tests in the following environments: * Virtualbox/Vagrant - OSX Host, Ubuntu guest * Virtualbox/Vagrant - OSX Host, Windows guest * OSX native * Ubuntu native NB - I _didn't_ run it on native Windows (because I don't have easy access to one).
When I cloned the master branch onto a Virtualbox Vagrant OSX El Capitan host, Ubuntu Wily guest, the `Symfony\Component\Debug\Tests\DebugClassLoaderTest::testFileCaseMismatch` failed because 'Failed asserting that exception of type "\RuntimeException" is thrown'. @wouterj confirmed he got the same problem, and it's because Virtualbox shared folders aren't case sensitive, even when the guest is using a case sensitive filesystem. So I've replaced the logic that looked at the name of the operating system. I ran the tests in the following environments: * Virtualbox/Vagrant - OSX Host, Ubuntu guest * Virtualbox/Vagrant - OSX Host, Windows guest * OSX native * Ubuntu native NB - I _didn't_ run it on native Windows (because I don't have easy access to one).
@blowski thanks for this contribution! I'm afraid that there is a problem with your code: you use the short array syntax. This is obviously right for modern PHP code, but we decided to not use it on Symfony. The reason is that our existing code uses the old array syntax and updating it would require a lot of work. If we don't update the old code but use the new syntax in the new code, the result will be a mess. so let's use the old syntax everywhere. Thanks! |
@javiereguiluz I'm blaming that one on PHPStorm. Third time lucky! |
if(!file_exists(strtolower(__FILE__))) { | ||
// filesystem is case sensitive | ||
self::$caseCheck = 0; | ||
} elseif(realpath(strtolower(__FILE__)) === realpath(__FILE__)) { |
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.
No need for the second realpath, __FILE__
already has it
👍 with one minor comment |
Thank you @blowski. |
…tivity (Dan Blows) This PR was squashed before being merged into the 2.7 branch (closes #18130). Discussion ---------- [Debug] Replaced logic for detecting filesystem case sensitivity | Q | A | ------------- | --- | Branch | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none When I cloned the master branch onto a Virtualbox Vagrant OSX El Capitan host, Ubuntu Wily guest, the `Symfony\Component\Debug\Tests\DebugClassLoaderTest::testFileCaseMismatch` failed because 'Failed asserting that exception of type "\RuntimeException" is thrown'. @wouterj confirmed he got the same problem, and it's because Virtualbox shared folders aren't case sensitive, even when the guest is using a case sensitive filesystem. So I've replaced the logic that looked at the name of the operating system. I ran the tests in the following environments: * Virtualbox/Vagrant - OSX Host, Ubuntu guest * Virtualbox/Vagrant - OSX Host, Windows guest * OSX native * Ubuntu native NB - I _didn't_ run it on native Windows (because I don't have easy access to one). Commits ------- 2e81b0a [Debug] Replaced logic for detecting filesystem case sensitivity
Congratz @blowski with your first contribution to Symfony! |
Congrats @blowski! This was definitely not a simple change for being the first contribution! Thanks. |
I think this resolution has created a problem in Windows, see |
if(!file_exists(strtolower(__FILE__))) { | ||
// filesystem is case sensitive | ||
self::$caseCheck = 0; | ||
} elseif(realpath(strtolower(__FILE__)) === __FILE__) { |
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.
this logic would also break when the Debug component is installed inside a phar
When I cloned the master branch onto a Virtualbox Vagrant OSX El Capitan host, Ubuntu Wily guest, the
Symfony\Component\Debug\Tests\DebugClassLoaderTest::testFileCaseMismatch
failed because 'Failed asserting that exception of type "\RuntimeException" is thrown'.@wouterj confirmed he got the same problem, and it's because Virtualbox shared folders aren't case sensitive, even when the guest is using a case sensitive filesystem. So I've replaced the logic that looked at the name of the operating system.
I ran the tests in the following environments:
NB - I didn't run it on native Windows (because I don't have easy access to one).