-
Notifications
You must be signed in to change notification settings - Fork 660
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
Phar file cannot be renamed #595
Comments
Only affects files without extension. For example, |
Might be related: https://bugs.php.net/bug.php?id=76061 |
Line 10 points to: require 'phar://' . __FILE__ . '/psalm'; Composer's stub (which does not seem to suffer from this problem) looks a bit different: Phar::mapPhar('composer.phar');
require 'phar://composer.phar/bin/composer'; |
That code comes from https://github.com/humbug/box/blob/master/src/StubGenerator.php I think |
I've fixed the generation step and updated the Phar attached to the release. The repro code you pasted above now works. Thanks for ticketing! |
Thank you for your quick reaction! 🍺 |
I'm getting another issue while running
|
@muglug the usual workaround for those kind of scoping errors are patchers. You can find some examples in PHP-Scoper and Box themselves. I couldn't find anything about the build step you're using, but I highly recommend you to add an e2e tests, i.e. a test where you use the psalm bin first and then the PHAR (isolated or not). In my experience it's very easy to have PHAR related issues especially if
Edit: actually that's weird as I don't see the PHP-Scoper compactor registered in the config, is the config used to build the uploaded PHAR different? |
@jakzal thanks, I've fixed and updated the release's Phar @theofidry everything is generated in bin/build-phar.sh. There are a number of scopers that exist in scoper.inc.php, including the one I just added to fix the const issue. That build tool allows for some testing – I should be able to run a reduced version of Psalm checks on the scoped folder.
Yeah, I ran into a bug when using |
Oh I see. Once you add an e2e test I can have a look at what the issue was with the
Completely fair. Also just in case you missed it, if you do |
@theofidry I've added Psalm checks in 83811e6 There are a couple of issues introduced because the scoper removes a closure docblock (though it's easy to suppress those issues for that file in the custom Psalm config I created. |
And thanks for the awesome tool. Really really amazing. |
Sounds like a legit bug to me, PHP-Scoper shouldn't remove any doc block. So whilst you can work around it with patchers I do recommend to open an issue for it :)
Glad you enjoy. If there's anything don't hesitate to open an issue for it. Both PHP-Scoper and Box are quite young so I do expect some issues :) |
@muglug thanks for working on this! The original issue seems to be back though :( |
Sorry – I patched the phar from the |
I actually think this is a legit bug on Box. Sure configuring an alias solves the issue, but you shouldn't have to IMO. So here's a fix: box-project/box#92 |
Works now 👍 cheers! |
Psalm stops working after renaming the downloaded
psalm.phar
topsalm
. Steps to reproduce below.environment: php 7.2, os x
The text was updated successfully, but these errors were encountered: