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

Go

Go Problem Overview


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.)

$ go get -u github.com/presbrey/magicmime
# github.com/presbrey/magicmime
../../../src/github.com/presbrey/magicmime/magicmime.go:20:11: fatal error:   'magic.h' file not found
#include <magic.h>

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.)

Go Solutions


Solution 1 - Go

Run go build -x on problem package:

go build -x github.com/presbrey/magicmime

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontimblView Question on Stackoverflow
Solution 1 - GoJoshuaView Answer on Stackoverflow