如何运行 MacRuby 补丁
我在尝试安装与 llvm 相关的 MacRuby 时遇到错误,并找到了针对特定问题的补丁,但不知道如何应用该补丁。
错误是
In file included from main.cpp:8:
llvm.h:21:38: error: llvm/Analysis/DIBuilder.h: No such file or directory
In file included from vm.h:594,
from main.cpp:17:
我找到的补丁是 无法在 r5276 中使用 LLVM 2.8 进行编译。
现在我有了补丁文件,该怎么办我跑去申请吗?
I ran into an error trying to install MacRuby related to llvm and found a patch for the specific problem but have no idea how to apply the patch.
The error is
In file included from main.cpp:8:
llvm.h:21:38: error: llvm/Analysis/DIBuilder.h: No such file or directory
In file included from vm.h:594,
from main.cpp:17:
And the patch I found was
Could not compile with LLVM 2.8 in r5276.
Now that I have the patch file, what do I run to apply it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该补丁看起来很简单,您可以简单地手动应用它 - 删除以
-
开头的行并添加以+
- 开头的行- 但只有当有足够多的更改导致补丁无法完全应用时才需要这样做。由于补丁文件可以通过不同的方式生成,因此也可以通过不同的方式应用:
如果修复文件位于层次结构中向下的六个目录中,则您需要尝试向上六个目录应用补丁,或者使用
-p6
或类似的选项来删除无关的前导目录。这可能听起来很复杂,但如果您将目录更改为包含要修补的文件的目录,通常只需运行
patch fix_compile.diff
或patch -p1 fix_compile.diff
。我喜欢首先尝试应用补丁,以防万一某些补丁应用干净,而有些则不能:或
等等。一旦找到有效的补丁,请将其删除
--dry-run
并应用、编译,看看是否可以开始。That patch looks simple enough that you could simply apply it by hand -- remove the lines starting with
-
and add the lines starting with+
-- but that's only necessary if there are enough changes that the patch won't apply cleanly.Because a patch file can be generated in different ways, it can also be applied in different ways:
If the fixed file is six directories down in the hierarchy, you either need to try applying the patch six directories up, or use a
-p6
or similar option to strip off extraneous leading directories.It might sound complicated, but if you change directory to whichever directory contains the files to be patched, you can usually just run
patch < fix_compile.diff
orpatch -p1 fix_compile.diff
. I like to try applying the patches first, just in case some of the patch applies cleanly, and some doesn't:or
etc. Once you find one that works, remove the
--dry-run
and apply, compile, and see if you're good to go.