SergeyPirogov / webdriver_manager

Apache License 2.0
2.02k stars 452 forks source link

Raspberry Pi / Linux - arch not properly recognised for Gecko #616

Open Tuinslak opened 12 months ago

Tuinslak commented 12 months ago

Looks like aarch64 under Linux is not properly recognised. The file exists under releases (https://github.com/mozilla/geckodriver/releases -> geckodriver-v0.33.0-linux-aarch64.tar.gz )

72c4223860da:/# uname -a
Linux 72c4223860da 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 Linux

Inside docker, the script fails:

OSError: [Errno 8] Exec format error: '/root/.wdm/drivers/geckodriver/linux64/v0.33.0/geckodriver'

The downloaded file is an amd64 file:

72c4223860da:/# file /root/.wdm/drivers/geckodriver/linux64/v0.33.0/geckodriver
/root/.wdm/drivers/geckodriver/linux64/v0.33.0/geckodriver: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, BuildID[sha1]=204c340e375aa3e0fd8a9fa16ee94460221f8f1e, with debug_info, not stripped
stuaxo commented 11 months ago

I think this is the same issue I have on an arm Mac, it downloads amd64 not aarch64

sosie-js commented 11 months ago

Selenium Manager shipped within the linux arm64 driver (for example firefox last one https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux-aarch64.tar.gz ) doesn't work on linux-arm64, Yes because the arch is x86 for the selenium-manager, wondering why the binary has been built not for arm64 making troubles. There is a qemu workaround that solves this, I assume it is slower but works...

sudo apt install binfmt-support qemu qemu-user-static

by the way @SergeyPirogov , you need to take care of ubuntu users that does not have firefox but firefox-esr as binary else your manager is unable to find and trigger firefox until doing a symlink with

sudo update-alternatives --install /usr/bin/firefox firefox /usr/bin/firefox-esr 100

sosie-js commented 11 months ago

I think it replies as well to question of @stuaxo in https://github.com/SergeyPirogov/webdriver_manager/issues/619 . I replied first on https://stackoverflow.com/questions/76857893/is-there-a-known-working-configuration-for-using-selenium-on-linux-arm64/77099069#77099069

stuaxo commented 11 months ago

Interesting, for Firefox I didn't get into trying too far, since it turns out the codebase I'm working with only used Chrome.

While I do have Chrome for amd64 installed, I'm in a constrained VM so prefer not to do that, Chromium and it's webdriver are already installed in the system so I'd prefer the system to use those than what it does now.