-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[🚀 Feature]: Selenium Manager support mac_arm64 drivers #11517
Comments
Independently of the cross-compilation, Selenium Manager always has supported ARM architectures for driver download. See, for instance, the following debug traces (executed in a macOS M1):
As you can see, the downloaded artifacts are |
So we just need to compile selenium manager locally and add it to repo, and then update bindings to check for architecture and use it. |
ooc, how many of these does Selenium Manager support right now? #11357 |
Since we build the Selenium Manager using the GitHub Actions virtual environments (see workflow), we support the following:
|
I mean, how many driver downloads are supported for the architectures? Like, if I compiled on m1 and requested Firefox, it would download |
If I understand correctly, seems there are two things:
About the second item... Let's say we build it locally and we check it into the repository, now the issue is in the bindings, because the bindings need to know on which architecture they are running to select the right Selenium Manager binary. Also, not sure if a binary compiled for macOS M1 works on ARM Linux, so if we want to support ARM on Linux then we need to figure out where to build it. All in all, if we build the binary for ARM macOS, we need to pack it into the bindings as well. If we end up supporting ARM on Linux, we need to pack it into the bindings as well... Should we start thinking about downloading Selenium Manager on demand? |
@diemol You are correct in everything. Besides all you said in the last paragraph, I would add that, for example, the current Selenium Manager macOS binary (x64) also works in an M1 (ARM) macOS. Therefore, I am not sure about the benefits of having two Selenium Manager macOS binaries (x64 and ARM). Maybe the ARM flavor is a bit faster in macOS M1/M2? Not sure if that benefit worths the added complexity to the release procedure, the extra weight in the Selenium distributions, and the required logic in the bindings to distinguish the local architecture. Another example is win32. It is true (I tested it in a Windows x32 Virtual Machine) that the current Selenium Manager binary (x64) does not work on that platform. But how many people are using Windows 32 nowadays? I would say that number is tiny. All in all, I would say that a good compromise is what we have now, i.e., Selenium Manager for win64, linux64, and mac64. To handle rare cases, maybe we can implement a procedure to use a custom Selenium Manager binary (e.g., compiled for win32 or mac-arm64, to name a few). If fact, that is an idea we have already discussed in the past. For instance, in the Java bindings, the Selenium Manager binary is currently decompressed from the JAR, as used in a temporal file (which is later deleted using a singleton). But instead, if the bindings use Selenium Manager from a known path, such as First, users can override that binary with a custom compilation (e.g., by a mac-arm64 in macOS). Second, users can manually invoke Selenium Manager (from the shell, as a CLI tool) when Selenium Manager provides additional features (e.g., create project scaffolding). What do you think? |
There is another alternative, which may be the most costly at the beginning but more optimal in the long run. In fact, it is something we have also discussed in the past. It consists on implementing a mini-manager logic in each binding to download the latest Selenium Manager release to the local machine (to the
The pros of this approach are:
The cons of this approach are:
We have previous experience with WebDriverManager and Selenium Manager to do this, so it is technically possible. If we decide to do this, I can do a reference implementation in the Java bindings (and do it similarly to the rest of the Selenium bindings). |
I am thinking more about this, and there is also another possibility. Each binding version (e.g., 4.9.0) only uses a fixed version of Selenium Manager (let's say the same number, 4.9.0). This way, we avoid the need to request the latest tag and the TTL value. Also, we avoid the problem of backward compatibility (since each binding released is supposed to be tested with a given Selenium Manager version). On the other hand, this way, we lost the auto-upgrade capability (for instance, when bug fixes arrive in new versions of Selenium Manager). But well, in that case, users simply need to bump to the next Selenium version (e.g., selenium-java 4.10.0 or whatever). |
Selenium-Manager amd64 works perfectly fine on my MacBook M1 because Rosetta 2 handles it for me. Considering the binary is lightweight, I am not sure we need to provide the arm64 version of Selenium-Manager. However, I think there is a bug in the implementation of Selenium-Manager because it should download the drivers for the host architecture, while currently it always downloads the amd64 version:
|
@p0deje Maybe the bindings are using an old version of Selenium Manager. But with the latest version, that should work. For instance, I have just executed the following in a macOS M1:
You can get the current version of Selenium Manager (at trunk) from here (you need to download selenium-manager_macos-x64). |
@bonigarcia I've just downloaded the link you provided, but it behaves the same. Maybe it works for you because of
|
Ah, I didn't realize selenium manager worked with Rosetta 2. Maybe it does make sense short term to not have a separate selenium manager while we are checking them in. That said, as I understand it, it does not download the native arm drivers, though, which I think is important. |
@p0deje Indeed. With the compiled version, for some reason, the architecture is not recognized, and it downloads the |
We can close this issue once that bug is fixed, thanks! |
I have just created PR #11611 to fix this issue. @p0deje The Selenium Manager binary for macOS built using that PR is this one: selenium-manager_macos-x64 |
@bonigarcia Wonderful, I can confirm it's working correctly now:
|
closing since the binary currently packaged works as desired |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature and motivation
This is a subset of #11357. Regardless of what all we decide to support eventually, I think supporting M1/M2 is the most important piece.
Chrome, Edge & Firefox all have drivers available for it:
I'm guessing rust would put these in
mac_arm64
directory instead ofmac64
?Java can get the architecture from
System.getProperty("os.arch")
, Ruby isRbConfig::CONFIG['host_cpu']
, .NET hasRuntimeInformation.OSArchitecture
. We'd need to get it all tested somehow.The compiling/cross-compiling piece I don't think should be a limiting factor. Someone with an M1 can build the binary and we package it like the others.
Usage example
n/a
The text was updated successfully, but these errors were encountered: