Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linkage_checker: attempt
dlopen
before reporting broken linkage.
When `dyld` is not able to find a library at its install name, it attempts to find it inside its default search path. This means that for libraries we ship that are also provided by the system (e.g. `libc++`), `brew linkage` can fail even if the formula still works (i.e. `brew test` succeeds). Given this, it makes sense to attempt to `dlopen` the library first before deciding the linkage is broken. This will be useful when we ship Homebrew/homebrew-core#106925, which will move the install location of `libc++`, causing `brew linkage` to fail for any formula that links with that `libc++`. Those formulae that link with LLVM's `libc++` will fall back to Apple's `libc++`, which is why we see multiple `brew test`s succeed even when `brew linkage` failed in the LLVM PR linked above. This change helps avoid unnecessary source rebuilds for formulae that link with LLVM's `libc++` after LLVM 15 ships.
- Loading branch information