Skip to content

Add support for Apple M1 architecture (chromedriver)#193

Merged
kapoorlakshya merged 2 commits into
titusfortner:masterfrom
MichaelHoste:master
Jan 12, 2021
Merged

Add support for Apple M1 architecture (chromedriver)#193
kapoorlakshya merged 2 commits into
titusfortner:masterfrom
MichaelHoste:master

Conversation

@MichaelHoste
Copy link
Copy Markdown
Contributor

@MichaelHoste MichaelHoste commented Jan 7, 2021

Fixes #191

I hope it's the correct approach.

It's still compatible with Chromedriver versions lower than 87.0.4280.88 but it will then fallback to the Intel version of Chrome.

@MichaelHoste MichaelHoste changed the title Add support for Apple M1 architecture (chromedriver). Fixes #191 Add support for Apple M1 architecture (chromedriver). Jan 7, 2021
@MichaelHoste MichaelHoste changed the title Add support for Apple M1 architecture (chromedriver). Add support for Apple M1 architecture (chromedriver) Jan 7, 2021
Copy link
Copy Markdown
Collaborator

@kapoorlakshya kapoorlakshya left a comment

Choose a reason for hiding this comment

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

@MichaelHoste Thank you very much for the PR! Left two comments, but the overall approach looks good to me.

Comment thread lib/webdrivers/chromedriver.rb
Comment thread lib/webdrivers/chromedriver.rb Outdated
end

file_name = System.platform == 'win' || System.wsl? ? 'win32' : "#{System.platform}64"
archi = apple_m1_cpu? && apple_m1_compatible?(version) ? '_m1' : ''
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.

Can we please rename archi to apple_arch or mac_arch since it's specific to macOS/apple? Another option is to pull out the filename logic into a separate method to keep the complexity low.

@MichaelHoste
Copy link
Copy Markdown
Contributor Author

I did what you suggested, it made sense!

I first tried to create a separate method for the storage file name, but since we need to pass version with it, it was becoming too verbose and confusing for something that was already quite easy to read and understand. I'm not sure it was better.

@kapoorlakshya
Copy link
Copy Markdown
Collaborator

@MichaelHoste Thank you for making the changes. Looks good!

@kapoorlakshya kapoorlakshya merged commit 591cb8f into titusfortner:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google Chrome on Apple M1 architecture

2 participants