Skip to content
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

App doesn't work outside Docker if plugin is installed inside it and vice versa #5

Closed
grongor opened this issue May 23, 2019 · 14 comments

Comments

@grongor
Copy link

grongor commented May 23, 2019

During plugin installation, there are some absolute paths being stored inside configuration/autoloader. This causes errors if you install a plugin inside Docker but then later want to use your app outside Docker.

Or if you rename the project folder, or your home folder, whatever. I think you shouldn't be using absolute paths at all - they all should be relative to the project root.

@ondrejmirtes
Copy link
Member

I think that things like Docker and global installation are exactly the argument why you want to use absolute paths. It's hard to determine what actually project root is.

@lookyman
Copy link
Collaborator

We could maybe use currentWorkingDirectory and call it a day..

@ondrejmirtes
Copy link
Member

ondrejmirtes commented May 24, 2019 via email

@ondrejmirtes
Copy link
Member

ondrejmirtes commented May 24, 2019 via email

@lookyman
Copy link
Collaborator

Yea, I agree with you, that was just a suggestion what could be done if we decided to do something..

@lookyman
Copy link
Collaborator

Also, this whole thing is optional and pretty experimental still. If it starts to cause problems, just don't use it. No functionality is lost, just convenience.

@ondrejmirtes
Copy link
Member

ondrejmirtes commented May 24, 2019 via email

@grongor
Copy link
Author

grongor commented May 24, 2019

Another example where this fails is a deploy process.

You build an app on the build machine and then deploy code to a completely different machine, where the path to the application is probably different than on the build machine. And now your application is broken.

I strongly disagree that tools should persist absolute paths during build time (if the paths are relative to the project).

@ondrejmirtes
Copy link
Member

ondrejmirtes commented May 24, 2019 via email

@grongor
Copy link
Author

grongor commented May 24, 2019

Yeah, I didn't think this one through ... we don't do that 😂

Anyway, do as you think is best...I just won't be able to use this feature if you use absolute paths :(

@ondrejmirtes
Copy link
Member

This causes errors if you install a plugin inside Docker but then later want to use your app outside Docker.

This is just a weird use case. Your build environment should match the runtime environment. You'd have the same problems for example with compiling a DI container that bakes in absolute paths - I think Nette does it. You should both install and run PHPStan in Docker or outside Docker.

@ovidals
Copy link

ovidals commented May 13, 2020

I have the same problem. I use captain-hook to execute phpstan and It is fired on git precommit hook from my host, that does not have access to the path it was concatenated during the vendor installation inside docker.

@ondrejmirtes
Copy link
Member

This is solved as of extension-installer 1.1.0 and phpstan/phpstan 0.12.62. #17 (comment)

@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants