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

Wrapper for shell binaries does not handle signals #12164

Closed
Chi-teck opened this issue Oct 18, 2024 · 3 comments · Fixed by #12176
Closed

Wrapper for shell binaries does not handle signals #12164

Chi-teck opened this issue Oct 18, 2024 · 3 comments · Fixed by #12176
Labels
Milestone

Comments

@Chi-teck
Copy link

Currently the shell wrapper starts a sub-process for the original binary. The can mess POSIX signal handling.
Can it use source or exec instead?

Also wonder if there is a way to install package binaries without wrappers.

Ref:
drush-ops/drush#6137

@Seldaek
Copy link
Member

Seldaek commented Oct 19, 2024

The binary proxies in vendor/bin/.. are not wrapper processes, they are just php scripts including the original file, so that should not cause any problems in terms of signal handling.

I assume the problem you see is when using composer scripts to run a binary via a script handler?

@Seldaek
Copy link
Member

Seldaek commented Oct 19, 2024

Sorry I had a look at the drush issue, and I have more context now, so my question there would be.. why isn't it the bin/drush not just a php script? Because I'd think if you use ./vendor/bin/drush.php example it works as well, and it's just the bash proxies that are causing trouble.

But anyway we probably should fix it if it's borked, I'll need to investigate this some more and try to repro it though.

@Seldaek Seldaek added the Bug label Oct 19, 2024
@Seldaek Seldaek added this to the 2.8 milestone Oct 19, 2024
@webflo
Copy link
Contributor

webflo commented Oct 19, 2024

@Seldaek drush ships a shell-script (https://github.com/drush-ops/drush/blob/13.x/drush) as primary entrypoint. Its only task is to disable xdebug (export XDEBUG_MODE=off). It is a lightweight alternative to https://github.com/composer/xdebug-handler. It calls drush.php afterwards.

Afaik its not possible to do it in php, because the env var needs to be present before the php-process is started.

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

Successfully merging a pull request may close this issue.

3 participants