restore `make install-with-libs`
Regression
Post 387ef518f995d7bd0254b3cf70c143eab891b10a macOS Infer executable, built according to INSTALL.md, fails running on "clean" macOS machines.
Pre 387ef518f995d7bd0254b3cf70c143eab891b10a macOS Infer executable, for example Infer 0.17.0 OSX release, succeeds running on "clean" macOS machines.
"clean" means machines that do not have the dependencies used to build Infer.
Analysis
Troubleshooting the issue we have observed that whereas previous Infer versions packaged all the dependencies in the final executable artifact (check the content of infer-osx-v0.17.0/lib/infer/infer/libso/ i.e.), post 387ef518f995d7bd0254b3cf70c143eab891b10a runtime dependencies are not packaged anymore.
The consequence and the pain-point As a consequence of the above radical change in behavior, a built Infer executable now fails to run on any machine unless the customer explicitly goes and installs these dependencies manually.
Why is this a problem? We are targeting a zero-touch large-scale distribution of the Infer executable to a population of customers/engineers. The currently produced Infer executable is too brittle as it is not self-contained but depends and is influenced by what libraries users have or have not on their machines.
Conclusion Can you please:
- provide a rationale why the
install_with_libstarget has been removed, hence introducing this regression - engage with us on a permanent fix of this behavior that makes Infer executables self-contained ?
Thanks
The original motivation of install_with_libs was to avoid having to install "apron" and "elina" on machines in order to run infer. We removed install_with_libs because we removed the dependency on elina and apron.
What libraries are typically missing on machines where you'd like to run infer? Note that, in general, providing portable binaries is a near-impossible task so some dynamic dependencies will always be needed (eg libc).
If the rationale was to only not install apron and elina could that change have been more surgical and allow any other runtime dependency to be kept?
We are experiencing the issue with gmp and sqllite, and they both manifest either due to wrong versioning or to the runtime dependency missing completely. However, regardless of the specificity of this case, I'd like the problem to be looked at more generally, with focus on building a self contained executable (statically linked libs i.e.?).
Static linking libraries in OCaml is difficult because we would need to change the way some dependencies of infer are built and we have little control over that. We could indeed revive the install-with-libs horribleness (as it seems less horrible than other options) and add libsqlite to it too.
I do agree that "rolling-back" this regression is the first thing to do.
After that we can look into the difficulty you are hinting at, because difficult at least does not mean impossible, and that's a good news!
Let's talk tomorrow for updates on what it means in terms of time to reinstate good old install-with-libs, thanks.
otool -L says:
/usr/local/opt/gmp/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 308.4.0)
/usr/lib/libSystem.B.dylib
The main problem is libgmp.
Maybe libsqlite could help with the sqlite bug mentioned here? https://github.com/facebook/infer/issues/1081#issuecomment-487512452 But this is probably another issue.
Thanks!
Thanks for the fix!
Please re-open if this doesn't work for you.