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

Refactor library lookup #968

Merged
merged 2 commits into from Dec 11, 2022
Merged

Commits on Jul 17, 2022

  1. Refactor library lookup

    * Try every prefix, not just the first one where the file exists.
      The first existing file might be for the wrong architecture or have
      other issues and cannot be loaded.
    * Show which directories were searched in error message.
    * Only consider /opt/homebrew/lib on darwin-aarch64.
    * Only rescue LoadError and RuntimeError, not Exception.
    * Refactor in smaller functions to improve readability.
    * Fixes ffi#880.
    * Example error message:
      Could not open library 'notexist': notexist: cannot open shared object file: No such file or directory. (LoadError)
      Could not open library 'libnotexist.so': libnotexist.so: cannot open shared object file: No such file or directory.
      Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib
    eregon committed Jul 17, 2022
    Configuration menu
    Copy the full SHA
    602dfb3 View commit details
    Browse the repository at this point in the history
  2. Simplify errors to an array

    * The keys are not used, and the paths are typically already part of the error message.
    * Makes it possible to just use a recursive call instead of retry.
    eregon committed Jul 17, 2022
    Configuration menu
    Copy the full SHA
    c179308 View commit details
    Browse the repository at this point in the history