[build][OSX] Fail the build if install_name_tool fails to patch rpath

Summary:
When install_name_tool fails to patch rpath (and we've seen such cases
in the wild; can happen for many reasons) we better fail the build rather
than ship the binary that will likely fail on start unless a user
happens to have gmp and sqlite dylibs installed.

Reviewed By: skcho

Differential Revision: D23187313

fbshipit-source-id: 83afd0992
master
Artem Pianykh 5 years ago committed by Facebook GitHub Bot
parent 6fae5f641e
commit 015f6e1477

@ -756,13 +756,13 @@ ifneq ($(INSTALL_NAME_TOOL),no)
done
set -x; \
for sofile in '$(DESTDIR)$(libdir)'/infer/infer/libso/*.dylib; do \
$(INSTALL_NAME_TOOL) -add_rpath "@executable_path" "$$sofile" 2> /dev/null || true; \
$(INSTALL_NAME_TOOL) -add_rpath "@executable_path" "$$sofile"; \
scripts/set_libso_path.sh '$(DESTDIR)$(libdir)'/infer/infer/libso "$$sofile"; \
done
$(INSTALL_NAME_TOOL) -add_rpath '@executable_path/../libso' '$(DESTDIR)$(libdir)'/infer/infer/bin/infer 2> /dev/null || true
$(INSTALL_NAME_TOOL) -add_rpath '@executable_path/../libso' '$(DESTDIR)$(libdir)'/infer/infer/bin/infer
scripts/set_libso_path.sh '$(DESTDIR)$(libdir)'/infer/infer/libso '$(DESTDIR)$(libdir)'/infer/infer/bin/infer
ifeq ($(IS_FACEBOOK_TREE),yes)
$(INSTALL_NAME_TOOL) -add_rpath '@executable_path/../libso' '$(DESTDIR)$(libdir)'/infer/infer/bin/InferCreateTraceViewLinks 2> /dev/null || true
$(INSTALL_NAME_TOOL) -add_rpath '@executable_path/../libso' '$(DESTDIR)$(libdir)'/infer/infer/bin/InferCreateTraceViewLinks
scripts/set_libso_path.sh '$(DESTDIR)$(libdir)'/infer/infer/libso '$(DESTDIR)$(libdir)'/infer/infer/bin/InferCreateTraceViewLinks
endif
else # install_name_tool not found

Loading…
Cancel
Save