二进制似乎找不到链接的 .dylib 库
我有一个适用于 macos 的 github 操作,需要下载 dmg 存档、提取二进制文件 并重新配置二进制文件,以便它们可以运行并链接到下载的 .dylib 库。下面是我正在使用的脚本。 不幸的是,当我运行二进制文件(kdu_expand)时,出现错误
/Users/runner/work/_temp/92b88adb-5bec-4d13-a51d-85fdf4e84e8d.sh: line 16: 1603 Killed: 9 ./kdu_expand -version
Error: Process completed with exit code 137.
这是重新配置二进制文件以链接到动态库的正确方法吗?
wget -q http://kakadusoftware.com/wp-content/uploads/KDU805_Demo_Apps_for_MacOS_200602.dmg_.zip
mkdir kdu && mv KDU805_Demo_Apps_for_MacOS_200602.dmg_.zip kdu && cd kdu
7z e KDU805_Demo_Apps_for_MacOS_200602.dmg_.zip
7z e KDU805_Demo_Apps_for_MacOS_200602.dmg 2>/dev/null || true
7z e Payload~ 2>/dev/null || true
chmod +x kdu_expand
chmod +x kdu_compress
install_name_tool -id ${PWD}/libkdu_v80R.dylib libkdu_v80R.dylib
install_name_tool -change /usr/local/lib/libkdu_v80R.dylib ${PWD}/libkdu_v80R.dylib kdu_compress
install_name_tool -change /usr/local/lib/libkdu_v80R.dylib ${PWD}/libkdu_v80R.dylib kdu_expand
echo "${{ github.workspace }}/kdu" >> $GITHUB_PATH
./kdu_expand -version
I have a github action for macos that needs to download a dmg archive, extract binaries
and re-configure binaries so that they can run and link to the downloaded .dylib
library. Below is the script I am using.
Unfortunately, when I run the binary (kdu_expand) I get an error
/Users/runner/work/_temp/92b88adb-5bec-4d13-a51d-85fdf4e84e8d.sh: line 16: 1603 Killed: 9 ./kdu_expand -version
Error: Process completed with exit code 137.
Is this the correct way of re-configuring the binary to link to the dynamic library ?
wget -q http://kakadusoftware.com/wp-content/uploads/KDU805_Demo_Apps_for_MacOS_200602.dmg_.zip
mkdir kdu && mv KDU805_Demo_Apps_for_MacOS_200602.dmg_.zip kdu && cd kdu
7z e KDU805_Demo_Apps_for_MacOS_200602.dmg_.zip
7z e KDU805_Demo_Apps_for_MacOS_200602.dmg 2>/dev/null || true
7z e Payload~ 2>/dev/null || true
chmod +x kdu_expand
chmod +x kdu_compress
install_name_tool -id ${PWD}/libkdu_v80R.dylib libkdu_v80R.dylib
install_name_tool -change /usr/local/lib/libkdu_v80R.dylib ${PWD}/libkdu_v80R.dylib kdu_compress
install_name_tool -change /usr/local/lib/libkdu_v80R.dylib ${PWD}/libkdu_v80R.dylib kdu_expand
echo "${{ github.workspace }}/kdu" >> $GITHUB_PATH
./kdu_expand -version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Killed: 9
通常会提示代码设计错误。也就是说,通过更改安装名称,您修改了二进制文件,从而使它们的代码签名无效(在我的例子中,
install_name_tool
警告我这一点)。要修复此问题,请对您修改的每个二进制文件运行以下命令:
Killed: 9
more often than not hints at a codesigning error.That is, by changing install names you modified the binaries, thus invalidating their code signatures (and in my case,
install_name_tool
warns me about this).To fix it, run the following command against each binary you modified: