How can I see the internal compile commands which fail in a "go get" installation?

huangapple go评论85阅读模式
英文:

How can I see the internal compile commands which fail in a "go get" installation?

问题

我正在拉取和安装一个带有依赖项的软件包,但编译失败了,报错找不到文件magic.h。我想知道编译命令和标志是什么,该怎么查看?使用-v选项没有帮助。(我不需要关于如何获取magic.h文件的建议,这只是一个例子。)

你可以查看编译过程中的详细信息,包括查找包含文件的位置和编译的确切源文件。在这种情况下,你可以在$GO_PATH/src目录下找到源文件,检查其中的#include是否被注释掉,同时确保/usr/local/include/match.h文件存在。

英文:

I am pulling and installing a package with dependencies, and a compilation fails, in this case not finding a file, magic.h. How do I see what the compilation commands and flags were? The -v option does not help. (I do NOT want ideas about where to get magic.h from, this is just an example.)

<!-- language: lang-bash -->

$ go get -u github.com/presbrey/magicmime
# github.com/presbrey/magicmime
../../../src/github.com/presbrey/magicmime/magicmime.go:20:11: fatal error:   &#39;magic.h&#39; file not found
#include &lt;magic.h&gt;

How can I find, for example, where it was looking for include files, what source exactly it was compiling? (In this case the source file I see in $GO_PATH/src has that #include commented out, and a /usr/local/include/match.h exists anyway.)

答案1

得分: 100

运行以下命令在问题包上进行编译:

go build -x github.com/presbrey/magicmime
英文:

Run go build -x on problem package:

go build -x github.com/presbrey/magicmime

huangapple
  • 本文由 发表于 2015年7月10日 23:56:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/31345230.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定