Xcode: Install-time editing with install_name_tool breaks signatures
When using the Xcode generator, install-time editing operations with install_name_tool
warn:
install_name_tool: warning: changes being made to the file will invalidate the code signature in: ...
and break the signatures of binaries. This occurs when editing binaries to change LC_LOAD_DYLIB
names for dependencies, e.g. to switch to @executable_path/...
.
This is particularly prevalent on macOS arm64 machines, where all tooling signs binaries (even if a local ad-hoc signature) and macOS requires all binaries to be signed before running.