Skip to content

[1.15] Fix sh not returning results#689

Open
xushulang wants to merge 1 commit intochrome-php:1.13from
xushulang:fix/guess-chrome-binary-path
Open

[1.15] Fix sh not returning results#689
xushulang wants to merge 1 commit intochrome-php:1.13from
xushulang:fix/guess-chrome-binary-path

Conversation

@xushulang
Copy link
Copy Markdown

Some Linux distributions use dash as the default sh, but in "dash", "command -v" only supports a single argument.

@GrahamCampbell
Copy link
Copy Markdown
Member

Thanks for reporting this. Are you able to replicate this not working, with a test?

@GrahamCampbell
Copy link
Copy Markdown
Member

Are there any downsides to making this change?

@GrahamCampbell GrahamCampbell changed the title Fix sh not returning results [1.15] Fix sh not returning results May 26, 2025
@xushulang
Copy link
Copy Markdown
Author

xushulang commented May 29, 2025

Thanks for reporting this. Are you able to replicate this not working, with a test?

tested already

docker, php:8.4-fpm
image

@xushulang
Copy link
Copy Markdown
Author

Are there any downsides to making this change?

no

@divinity76
Copy link
Copy Markdown
Contributor

divinity76 commented Aug 11, 2025

#614 would've portably fixed it fwiw, scanning manually instead of using the shell

@stale
Copy link
Copy Markdown

stale Bot commented Dec 11, 2025

This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Dec 11, 2025
@stale stale Bot closed this Feb 4, 2026
@aprat84
Copy link
Copy Markdown

aprat84 commented Apr 20, 2026

Hi!

How was this not implemented? It's still an issue in Alpine Linux, which uses Busybox Ash shell.

Should we propose a new PR? @GrahamCampbell

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Chrome binary auto-discovery on Linux distributions where /bin/sh is dash, by avoiding command -v invocation with multiple arguments (unsupported by dash) and instead checking candidates one-by-one.

Changes:

  • Update Linux Chrome binary detection to use command -v <candidate> || command -v <candidate> ... chaining.
  • Preserve existing behavior by still returning the first discovered binary path (or defaulting to chrome).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants