Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/LocalBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ private function server_home() {
}

private function platform_url(){
if (PHP_OS == "Darwin")
if (PHP_OS == "Darwin") {
if (in_array(php_uname('m'), array('arm64', 'aarch64')))
return 'https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal-darwin-arm64';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This URL has no object behind it and no publisher, so releasing this turns a working download into a hard 404 on Apple Silicon.

You've documented it in the PR body, but it's worth separating this binding from the others: nodejs/python/ruby/java/csharp resolve their source URL from Rails / bstack-local-prod, so they only degrade once Rosetta is gone. php and perl hardcode the legacy s3.amazonaws.com/browserStack/browserstack-local/ host, so they break immediately on release — an arm64 Mac that works today via the Rosetta x64 binary starts failing at download.

And the failure is sticky. download_binary() never checks the curl result, so S3's 404 body gets written to ~/.browserstack/BrowserStackLocal and chmod 0755'd. binary_path() then short-circuits on file_exists($binary_path) on every subsequent run, so the user stays broken until they delete the file by hand — no amount of retrying recovers it.

Fix — either:

  1. Gate the release on BrowserStackLocal-darwin-arm64 being published to that bucket, and added to whatever publishes the other legacy objects; or
  2. Fall back to the x64 URL when the arm64 download fails, so the regression can't fire even if the release ordering slips.

Given the sticky-file behaviour, option 2 looks worth doing regardless of ordering.

return 'https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal-darwin-x64';
}
else if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
return 'https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal.exe';
if ((strtoupper(PHP_OS)) == "LINUX") {
Expand Down
Loading