Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better Libdl.dlopen error when using non-standard extension (#46998)
When trying to dlopen a file with non-standard extension (e.g. `foo.so` instead of `foo.dylib` when running on macOS), if this failed (e.g. because of a reference to an undefined symbol), then instead of printing the error message returned by `dlerror` with a helpful notice what went wrong, a message indicating something to the effect that "foo.so.dylib was not found" was shown, which was not helpful at all. To get the actual helpful error message, add a check so that when dlopen fails for a file that actually exists, we don't retry loading from a file with the standard extension attached, which might not even exist; instead we just give up. This matches what is already being done for relative paths. This patch simply copies the relevant check to also be applied to the case dealing with absolute paths.
- Loading branch information