-
Notifications
You must be signed in to change notification settings - Fork 155
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
[BUGFIX] Keep PhpStorm from indexing the tool PHARs #968
Conversation
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 will break the development environment on Windows, which depends on file extensions to know what program to use to run an executable.
I can't immediately think of a workaround or alternative solution...
I'll checkout the branch and look into it later. I know that PHIVE also generates batch files for Windows - maybe Windows will prefer those to the file without an extension... |
Yes, Windows will run a batch file if one exists with a The same content will do for all of them: @echo off
php "%~dpn0" %* It does not matter if the line endings are Windows or UNIX, or if the last line has one. There'll need to be one for each tool without a file extension, i.e. The exact content generated by PHIVE is tool-specific, e.g. for Psalm @echo off
php "%~dp0psalm" %*
Without such batch files, the tools without a file extension do indeed fail to run: > "./tools/phpmd" src text config/phpmd.xml
'".\tools\phpmd"' is not recognized as an internal or external command,
operable program or batch file.
Script "./tools/phpmd" src text config/phpmd.xml handling the ci:php:md event returned with error code 1 |
@JakeQZ Does work in Windows for you if we changed every tool-related Composer command to use the
|
That would indeed work :) While here, I wonder if were are using PHIVE in the right/recommended way. I.e. should we be storing the Feedback from phar-io/phive#296 suggests we have an "interesting use case". However feedback from phar-io/phive#295 indicates PHIVE currently does not support installing a version necessarily compatible with the calling environment. Possibly a separate issue to come back to when it becomes more clear what the 'best practice' is... |
Let's see what the rest of the PHP developer crowd thinks. :-) I have created a Twitter poll for this: https://twitter.com/oliklee/status/1380082284200595457 |
PHPUnit is the only tool for which we would like PhpStorm to index the PHAR (so that it knows the PHPUnit classes exist). For all other tools, indexing the PHARs would only slow PhpStorm down (and possibly create warnings about classing existing multiple times).
bce9045
to
211a38f
Compare
This allows running the PHARs without the `.phar` suffix even on Windows.
"ci:tests:sof": "@php \"./tools/phpunit.phar\" --stop-on-failure", | ||
"ci:tests:unit": "@php \"./tools/phpunit.phar\"", | ||
"composer:normalize": "@php \"./tools/composer-normalize\"", | ||
"phive:update:phpunit": "echo y | \"./tools/phive\" --no-progress update phpunit", |
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 is only needed for the CI build server, so it's OK.
PHPUnit is the only tool for which we would like PhpStorm to index
the PHAR (so that it knows the PHPUnit classes exist). For all other
tools, indexing the PHARs would only slow PhpStorm down (and possibly
create warnings about classing existing multiple times).