Skip to content

Commit

Permalink
Merge pull request #9 from ipfs/feat/trimpath
Browse files Browse the repository at this point in the history
Use trimpath for compatibility with go-ipfs v0.7.0
  • Loading branch information
aschmahmann committed Sep 22, 2020
2 parents b3f291a + 426ea45 commit ea010aa
Show file tree
Hide file tree
Showing 4 changed files with 376 additions and 93 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ GO111MODULE = on
GOCC ?= go
GOFLAGS ?=

# make reproducable
GOFLAGS += -asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"

# If set, override the install location for plugins
IPFS_PATH ?= $(HOME)/.ipfs

# If set, override the IPFS version to build against. This _modifies_ the local
# go.mod/go.sum files and permanently sets this version.
IPFS_VERSION ?= $(lastword $(shell $(GOCC) list -m github.com/ipfs/go-ipfs))

# make reproducible
ifneq ($(findstring /,$(IPFS_VERSION)),)
# Locally built go-ipfs
GOFLAGS += -asmflags=all=-trimpath="$(GOPATH)" -gcflags=all=-trimpath="$(GOPATH)"
else
# Remote version of go-ipfs (e.g. via `go get -trimpath` or official distribution)
GOFLAGS += -trimpath
endif

.PHONY: install build

go.mod: FORCE
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ You can set `IPFS_VERSION` to:

* `vX.Y.Z` to build against that version of IPFS.
* `$commit` or `$branch` to build against a specific go-ipfs commit or branch.
* Note: if building against a commit or branch make sure to build that commit/branch using the -trimpath flag. For example getting the binary via `go get -trimpath github.com/ipfs/go-ipfs/cmd/ipfs@COMMIT`
* `/absolute/path/to/source` to build against a specific go-ipfs checkout.

To update the go-ipfs, run:
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/ipfs/go-ipfs-example-plugin

go 1.12
go 1.14

require (
github.com/ipfs/go-datastore v0.4.4
github.com/ipfs/go-ipfs v0.5.1
github.com/ipfs/go-datastore v0.4.5
github.com/ipfs/go-ipfs v0.7.0
github.com/ipfs/go-ipfs-delay v0.0.1
github.com/ipfs/interface-go-ipfs-core v0.2.7
github.com/ipfs/interface-go-ipfs-core v0.4.0
)
Loading

0 comments on commit ea010aa

Please sign in to comment.