Vikas Jadhav
Vikas Jadhav

Reputation: 41

Getting below error while building hyperledger fabric

Running below command to build hyperledger after some time I see below error in my terminal

$ make dist-clean all

build/bin/peer
CGO_CFLAGS=" " GOBIN=/usr/share/go-1.6/src/github.com/hyperledger/fabric/build/bin go install -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=0.7.0-snapshot-29d7fc0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.0 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric" github.com/hyperledger/fabric/peer
/usr/lib/go-1.6/src/github.com/hyperledger/fabric/core/chaincode/ccproviderimpl.go:20:2: cannot find package "context" in any of:
    /usr/lib/go-1.6/src/github.com/hyperledger/fabric/vendor/context (vendor tree)
    /usr/lib/go-1.6/src/vendor/context
    /usr/share/go/src/github.com/hyperledger/fabric/vendor/context
    /usr/share/go/src/vendor/context
    /usr/lib/go-1.6/src/context (from $GOROOT)
    /usr/share/go/src/context (from $GOPATH)
Makefile:177: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1

Upvotes: 1

Views: 832

Answers (3)

Pranoy Gn
Pranoy Gn

Reputation: 509

The problem has to do with this: #23672 It affects Go versions 1.8.7, 1.9.4 and 1.10rc2

I downgraded the golang version from 1.9.4 to 1.9 which worked for me.

Upvotes: 1

Zhao Chong
Zhao Chong

Reputation: 1

Update your golang version, 1.7.0+ may be helpful.

Upvotes: 0

Kim
Kim

Reputation: 601

There are so many ways to build and test the fabric that you will need to provide some context for this question to have any chance of being answered.

However, to short-circuit the process, allow me to offer a couple of useful documents that should be read before attempting to work with the latest fabric code:

https://github.com/hyperledger/fabric/blob/master/docs/source/install_instantiate.rst

https://github.com/hyperledger/fabric/blob/master/docs/source/dev-setup/build.rst

Upvotes: 1

Related Questions