Reputation: 1181
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.)
Upvotes: 126
Views: 5540
Reputation: 26722
Run go build -x on problem package:
go build -x github.com/presbrey/magicmime
Upvotes: 100