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

Report when puli is found but not executable #177

Open
sagikazarmark opened this issue Jan 15, 2016 · 6 comments
Open

Report when puli is found but not executable #177

sagikazarmark opened this issue Jan 15, 2016 · 6 comments

Comments

@sagikazarmark
Copy link

I spent half an hour with investigating why builds are failing when the executable was definitely there.

If it is not executable, the composer plugin silently fails.

Also, I don't understand why checking executable bit is necessary in the first place, because as I can see, it is executed with the php interpreter anyway.

@sagikazarmark
Copy link
Author

This issue is again consuming my time. We discussed somewhere that if the puli build fails it does not necessarily mean that the build should fail as well. However, in case of Symfony, it fails during building the container, so in fact puli is a requirement to succeed. But right now there is now way to debug the puli process in the CI in any way, since there is no feedback at all about failures (correct me if I am wrong).

@webmozart
Copy link
Member

@sagikazarmark Thanks for reporting this issue. Can you give any hints on how we could improve this situation?

@sagikazarmark
Copy link
Author

I've looked into the code and I found this: https://github.com/puli/composer-plugin/blob/master/src/PuliRunner.php#L72

Reading out loudly: if the script declares the executor or starts with PHP open tag than prepend the PHP executable, otherwise just prepare the command.

When the script is identified as PHP script it is passed as a parameter to PHP where we don't require executable permission. In the other case, the script needs to be executable.

I propose adding an extra check there whether the script is executable or not and raise a warning when not.

@webmozart
Copy link
Member

@sagikazarmark ok, can you provide a PR? You should however keep in mind that .bat-files on Windows do not need to be executable AFAIK (see the code in find()). Please verify this though.

@webmozart
Copy link
Member

PS: I hate this part of the code

@sagikazarmark
Copy link
Author

I will try to provide a platform-independent PR, although I think that it should be the responsibility of the process library.

Another solution could be to examine the result of running the command: if it is permission denied then handle the case instead of pre-checking it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants