macOS dylib's id does not use a fully qualified path
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 1.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 126
Description
Xcode 12 lost the ability to test libraries linked against the C library when using the swift compiler (though ironically, swift test from the command line works just fine). After many hours of investigation, I noticed the the dylib's id is not fully qualified:
```
$ otool -L /usr/local/lib/libfdb_c.dylib
/usr/local/lib/libfdb_c.dylib:
libfdb_c.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
```
Most other dylibs I compared against, and that are fine to link against do have a full path for the first line of that output (`libfdb_c.dylib (compatibility ...`). Fixing it is thankfully easy, but must be done every time the user updates FDB:
`$ install_name_tool -id /usr/local/lib/libfdb_c.dylib /usr/local/lib/libfdb_c.dylib`
Having this be part of the official release will reduce friction tremendously.
See https://github.com/kirilltitov/FDBSwift/issues/70#issuecomment-726421104 for more information.
As a second note, having a pkgconfig be installed along side the library on mac and linux would be tremendously useful, as currently, swift packages that depend on FDB must install their own each time.
Contributor guide
Assessment
This issue has not been assessed yet.