Skip to content
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

Microsoft Edge driver error on macOS 10.15 - dyld: Library not loaded: @rpath/libc++.dylib #2462

Closed
1 of 7 tasks
kapoorlakshya opened this issue Jan 17, 2021 · 2 comments
Closed
1 of 7 tasks
Assignees
Labels
Area: Apple investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS

Comments

@kapoorlakshya
Copy link

kapoorlakshya commented Jan 17, 2021

Description
Getting an error when I run msedgedriver --version on macOS 10.15 and Microsoft Edge (chromium) version >= v86:

dyld: Library not loaded: @rpath/libc++.dylib
  Referenced from: /Users/runner/.webdrivers/msedgedriver
  Reason: image not found

Apparently, PR #1780 was merged a few months ago to lock Edge to v85, but this this workaround is no longer in place and I am seeing the error again (see line 8 in this run). I am able to use the workaround from that PR in my workflow config and install v85 to get past this error, but definitely not a long term solution:

- name: Install microsoft-edge v85
  run: |
    brew uninstall --cask microsoft-edge
    cd "$(brew --repo homebrew/homebrew-cask)"
    git checkout 81f9d08d2b9b7557c0178621078cf59d2c5db2bc
    brew install --cask microsoft-edge
    git checkout master
    sleep 30

Area for Triage: Apple

Question, Bug, or Feature?: Bug

Virtual environments affected

Expected behavior
msedgedriver --version should successfully return the driver version.

Actual behavior

Command 'msedgedriver --version' has finished with exit code
dyld: Library not loaded: @rpath/libc++.dylib
Referenced from: /usr/local/bin/msedgedriver
Reason: image not found

Repro steps

  1. Download msedgedriver version >= 86 from https://msedgewebdriverstorage.z22.web.core.windows.net/
  2. Run msedgedriver --version

The workflow definition will look something like this (have not tested it):

get-msedgedriver-version:
  runs-on: 'macos-10.15'
  steps:
    - name: Download driver
      run: |
        wget https://msedgedriver.azureedge.net/87.0.630.0/edgedriver_mac64.zip
        unzip -a edgedriver_mac64.zip
        msedgedriver --version
@github-actions github-actions bot added Area: Apple investigate Collect additional information, like space on disk, other tool incompatibilities etc. labels Jan 17, 2021
@maxim-lobanov
Copy link
Contributor

Hello @kapoorlakshya ,
I can't reproduce the issue with msedgedriver preinstalled on Hosted images.
Running which msedgedriver && msedgedriver --version returns correct result:

/usr/local/bin/msedgedriver
MSEdgeDriver 87.0.664.60 (23fbc5c433ca16cabc81bf118f0e6fd9f7368f1e)

Based on error, I see that your code uses edgedriver located in /Users/runner/.webdrivers/msedgedriver. This file don't actually exist on clean VM so looks like it is downloaded during your build. I am not sure what exact version you download in runtime but please make sure that it is valid.
If some version of Edge driver is broken, I think it should be reported to Microsoft Edge team.

The pull-request #1780 was a temporary workaround because Edge team has released broken version and it fails with the similar error. It was reverted in #1898 after Edge team has provided fix and released new version.

@kapoorlakshya
Copy link
Author

Hey @maxim-lobanov, thanks for responding and providing context on the PRs. Motivated me to further debug this and figure out the root cause.

I had incorrectly assumed the issue was with the hosted image because I was unable to reproduce the errors locally or on TravisCI. After a lot of manual debugging since your comment, turns out the image is fine and the issue is indeed with the driver. Looks like some Microsoft Edge driver versions ship with their own libc++.dylib file in the zip. This is not required and not included for all versions for whatever reason. For example, v87 zips have that file, but v85 and v86 do not. However, v85 works fine without the lib, but v86 throws the error. And the reason you weren't able to reproduce this is because the lib file is included with the driver in /usr/local/share/edge_driver/, which links to /usr/local/bin/, on the hosted image. I have also confirmed that linking it to the ~/.webdrivers folder that my tests use avoids the error in the image:

$ ln -s /usr/local/share/edge_driver/libc++.dylib ~/.webdrivers/libc++.dylib
$ ~/.webdrivers/msedgedriver --version
MSEdgeDriver 87.0.664.75 (4da88d617daabd8aec59b88632014fe98444caeb-refs/heads/master@{#838960})

The primary reason I didn't catch this until now is because the project I'm working on (webdrivers Ruby gem) automatically downloads the zip and only extracts the driver file. It has been the only file we've needed until now. So I never knew the lib was included in the zip until I manually downloaded and unzipped one of the v87 zip files to troubleshoot this. Anyway, I'm working on updating webdrivers gem to extract the libc++.dylib file along with the driver, if it exists.

I'm going ahead and closing this ticket, but hope my findings help others who may run into this issue. Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Apple investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS
Projects
None yet
Development

No branches or pull requests

3 participants