I was recently working with a custom SQLite3 extension (https://github.com/vlcn-io/cr-sqlite). After placing the required
/usr/local/lib—the only user-writable path that SQLite searches by default when issuing the
.load command, I found myself facing this
brew doctor spew problem.
I found the hardcoded
allow_list array inside
diagnostic.rb (https://github.com/Homebrew/brew/blob/master/Library/Homebrew/diagnostic.rb#L200), but couldn't find any user-definable config file or supported method of customizing this list (other than editing the file directly, which was subject to being overwritten by updates).
The solution I came up with was to create a shell wrapper function around sqlite3, which exports the
DYLD_FALLBACK_LIBRARY_PATH variable. This allowed me to place the dylib in a subfolder, which prevents Homebrew from complaining about it.
e.g. in your
The dylib can then be placed into
A similar solution might be applicable to other programs, although it might not work in all cases. You can also try exporting
DYLD_LIBRARY_PATH if the fallback path isn't honored.