-
-
Notifications
You must be signed in to change notification settings - Fork 688
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
Another attempt to add Compiler + upgrade to PHPStan 0.12 #2373
Conversation
FuckupsSymfony not phar friend for
|
~~Fuckup post is comming :D ~~ Done: How to Box Symfony App to PHAR without Killing Yourself |
709e2d5
to
c0d4598
Compare
8441a32
to
3b917e6
Compare
Hey @TomasVotruba ! Just discovered this PR, awesome work! :D Is it already testable somehow ? I've Now when I
We use PHPStan (0.11, not updated to 0.12 yet) inside a Docker container (because of PHP 7.2 clash), and we load extensions with "internal" paths (in the container) like so :
I guess that's the culprit ? I can't use PHPStan 0.12 as a phar, because installation requires |
Check Travis job, there is steps to test it. |
I'm not really sure what you mean I'm supposed to look at inside |
@gnutix check these lines: https://github.com/rectorphp/rector/pull/2373/files#diff-354f30a63fb0907d4ad57269548329e3R39-R49 To sum them up, the phar is being built automatically and the result is in the https://github.com/rectorphp/rector-prefixed repo. However, there are still issues with the final phar as Tomas noted. |
Thanks @escopecz. I've downloaded the .phar from |
That's odd. I'm getting |
@gnutix These lines are used to build phar: Any help with fixing/testing is appreciated |
278ca13
to
5463ca8
Compare
0ebcd9e
to
55d8de0
Compare
47c9eb3
to
9075363
Compare
bc8319a
to
ac00919
Compare
ac00919
to
e4e73b3
Compare
Still not 100 % stable, but good enought to 🚢 it and test it in the wild. Thank you all for feedback and testing so far, much appreciated |
This may be a stupid question... but where can I find the off-the-shelf There is no hint in the README, neither here nor over at https://github.com/rectorphp/rector-prefixed, they don't even contain Since the |
Ah, the answer lies in e7f1963... @TomasVotruba do you recall why you stopped building the .phar version? IMO, having a .phar is the most simple and elegant solution for using a tool like Rector, since you have no interference with your project's dependencies, just grab a file and you're done. |
That's a valid question 👍 Here is the release Rector 0.9 info about moving from PHAR to scoped code: It's important stepping stone to downgradable releases, that are easy to use and debug. That way it will be possible to do something like this: # php 5.6
composer require symfony/console # 2.8 is installed
composer require rector/rector # 0.9 on PHP 5.6 is installed The oldest PHP version code-bases are the biggest hell to upgrade, so our main goal is to help them out |
Debugging phar-specific issues (guess you ment that?) for sure isn’t fun. Symfony (Console?) cannot be packed into a phar – I’ll take your word for it. I guess it boils down to the same questions as in #5593: Is there a requirement that the (major?) version of PHP that runs Rector must match the version of PHP currently required by the project? Is this by design/unavoidable, or just a current bug? Can/does/should Rector treat project code as „data“ only, or does it have to parse/load/interpret it at the runtime interpreter/language level? I am so persistent on these particular questions because it seems to me that has great impact on how much sense it makes to invest into Docker images: In a container, at best we can keep Rector and all its dependencies fully isolated from the project (after all, that’s what it is all about). The PHP version, available extensions etc. when running Rector will almost never be in line with what the project itself uses at runtime. That‘s all not an issue if the container runs something that will happily parse PHP 5 up to PHP 8 code as input. But if the version of Rector (and at least also PHPStan, even in the „scoped“ variant) must match project dependencies, it‘s going to be hard to make that work with Docker images... 👨🏻💻 Am I making sense? |
Symfony can be packed into phar, but it's a road to hell: https://tomasvotruba.com/blog/2019/12/02/how-to-box-symfony-app-to-phar-without-killing-yourself/ + Also, As for project vs Rector dependencies, they can differ: https://getrector.org/blog/2020/01/20/how-to-install-rector-despite-composer-conflicts |
Sorry, I don't understand it... You removed the PHAR:
... suggesting to use the scoped version and to install it using Composer, so that Composer can find versions compatible with the project's other requirements? And then, when I asked why/how/which dependencies and/or language versions need to be in sync between the project and Rector, you answer
... pointing me to a blog post that, at the bottom, announces the |
Yes. Use the rector-scoped The second post is about phar, but that's because it's older. Take it as synonymum for rector-scoped |
The third point in the blog: it should start with the fact that you are committing the |
Hi, thanks for your suggestion. Could you edit the post content so it makes more sense? |
rectorphp/rector-src@03da987 Try fix stub ReflectionUnionType not found in CI php 7.2 (#2373)
Inspiration