Use trimpath for compatibility with go-ipfs v0.7.0 #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the build flags used when building plugins.
There are 3 types of go-ipfs we support building plugins against:
Previously:
Use the
-asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"
flags no matter which version of the plugin we're building against.This was a pain when building against a Git commit/branch/tagged version of go-ipfs since the complex set of flags above had to be passed into
go get github.com/ipfs/go-ipfs/cmd/ipfs@{commit|branch|tag}
. Additionally, the use of GOPATH here may not be correct depending on how the users' directory structure is set up.Now:
Use the
-asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"
only when building against a locally build copy of go-ipfs, otherwise use the-trimpath
flag instead.This means we can run
go get -trimpath github.com/ipfs/go-ipfs/cmd/ipfs@{commit|branch|tag}
and just build the plugin with-trimpath
(as done in the Makefile here) and things will work.