Skip to content

Linux + Mac aarch64/arm64 support #37

Description

@juancferrer

Looks like browserstack-local binary is only compiled for x86_64 and ia32.

I'm on an an M1 mac successfully running multiple docker containers with selenium and browserstack, etc..., but I'm running into issues when trying to run browserstack-local.

$ uname -a
Linux 3d7e5f8f8bfb 5.10.76-linuxkit #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021 aarch64 GNU/Linux

And when I try to run browserstack-local I get the following:

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

and

Error
Traceback (most recent call last):
  File "/prefix/prefix/app/tests/test_web.py", line 41, in setUpClass
    cls.bs_local.start(**cls.bs_local_args)
  File "/usr/local/lib/python3.9/site-packages/browserstack/local.py", line 43, in start
    self.binary_path = LocalBinary().get_binary()
  File "/usr/local/lib/python3.9/site-packages/browserstack/local_binary.py", line 112, in get_binary
    raise BrowserStackLocalError('BrowserStack Local binary is corrupt')
browserstack.bserrors.BrowserStackLocalError: BrowserStack Local binary is corrupt

Obviously because all my docker containers are running an ARM linux kernel, and there's only browserstack-local binaries for x86_64 and ia32

Activity

  1. edwinclement08 commented on Jul 12, 2022

    @edwinclement08
    Contributor
  2. harish18051991 commented on Mar 27, 2023

    @harish18051991

    I am facing the same issue with nodejs library, did you get this issue fixed or have any work around.

  3. yarramneedik17 commented on Apr 11, 2023

    @yarramneedik17

    I am facing similar issue, But I am not running on Docker, it is in my local I am getting the issue below

    
    line 37, in __init__
       self.bs_local.start(**self.bs_local_args)
     File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/browserstack/local.py", line 100, in start
       raise BrowserStackLocalError(data["message"]["message"])
    browserstack.bserrors.BrowserStackLocalError: Auth Token must be alphanumeric characters only. Please fetch it from Local Testing section of settings page:  https://www.browserstack.com/accounts/settings
    Local binary disconnected - bs_local status: False
    
    
  4. rahulHbrowserstack commented on Apr 12, 2023

    @rahulHbrowserstack

    Hello @yarramneedik17 , this issue occurs when you have used wrong Accesskey. Check your Accesskey from the link https://www.browserstack.com/accounts/settings; and make the changes accordingly.

  5. yarramneedik17 commented on Apr 13, 2023

    @yarramneedik17

    Thanks for the suggestion, I have fixed that issue, but we are seeing new issue.

    line 37, in __init__
        self.bs_local.start(**self.bs_local_args)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/browserstack/local.py", line 105, in start
        raise BrowserStackLocalError('Error parsing JSON output from daemon. Raw String = "{}"'.format(output_string))
    browserstack.bserrors.BrowserStackLocalError: Error parsing JSON output from daemon. Raw String = ""
    Local binary disconnected - bs_local status: False
    
  6. juancferrer commented on Apr 25, 2023

    @juancferrer
    Author

    I'm still not able to run browserstacklocal inside an aarch64 docker container.

    At first I was getting:
    qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

    I was able to get rid of the missing libraries by having something like the following in my Dockerfile

    RUN apt-get install libc6-amd64-cross
    RUN ln -s /usr/x86_64-linux-gnu/lib64/ /lib64
    ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/lib64:/usr/x86_64-linux-gnu/lib"
    

    Now when I run the BrowserStackLocal binary, it just prints out Bus error to the terminal, and exits
    Was hoping that installing all the x86-64 libraries would make it work, but that doesn't seem to be the case.

    The core issue being that there are NOT any aarch64 builds for BrowserStackLocal.
    You can see here: https://github.com/browserstack/browserstack-local-python/blob/master/browserstack/local_binary.py#L10

    There's builds for mac (intel), linux 32+64 bit and windows. No builds for mac (apple silicon) or what I want, which is linux aarch64/arm64.

    Looks like you're not able to use browserstack local if you're developing on aarch64 mac or linux. 👎🏼

  7. changed the title [-]M1 Mac / aarch64 support[/-] [+]Linux + Mac aarch64/arm64 support[/+] on Apr 25, 2023
  8. juancferrer commented on Apr 28, 2023

    @juancferrer
    Author

    @yarramneedik17 @harish18051991
    I think I finally figured it out.

    I'm successfully running BrowserStackLocal 8.9 x86-64 binary

    file BrowserStackLocal
    BrowserStackLocal: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=ad80d59dd2ba86614fa8b0a06354ac7baaf6d7c7, stripped
    

    inside a Linux aarch64 docker container

    uname -a
    Linux bed2a7055516 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux
    

    So to get everything working, you just need the libstdc++6-amd64-cross package, and make sure your LD_LIBRARY_PATH includes the path to the x86_64 libraries

    So on my ubuntu/debian based docker image, I just had to do the following

    RUN apt-get install libstdc++6-amd64-cross
    RUN ln -s /usr/x86_64-linux-gnu/lib64/ /lib64
    ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/lib64:/usr/x86_64-linux-gnu/lib"
    

    and now inside that docker container, the BrowserStackLocal binary runs as expected.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions