Venus: [bug] go run ./build build error

Created on 17 Apr 2019  路  9Comments  路  Source: filecoin-project/venus

Describe the bug

I encounter some error for: go run ./build build
To Reproduce

after generating deps
run: go run ./build build
Expected behavior

Screenshots

jasonwang$ go run ./build build
Building go-filecoin...
git log -n 1 --format=%H
go build -ldflags -X github.com/filecoin-project/go-filecoin/flags.Commit=09c3fa3cf9c4be011770f66a18c3d4346af66616 -v -o go-filecoin .
build github.com/filecoin-project/go-filecoin: cannot load gx/ipfs/QmcZLyosDwMKdB6NLRsiss9HXzDPhVhhRtPy67JFKTDQDX/go-ipld-cbor: cannot find module providing package gx/ipfs/QmcZLyosDwMKdB6NLRsiss9HXzDPhVhhRtPy67JFKTDQDX/go-ipld-cbor
Command 'go build -ldflags -X github.com/filecoin-project/go-filecoin/flags.Commit=09c3fa3cf9c4be011770f66a18c3d4346af66616 -v -o go-filecoin .' failed: exit status 1
exit status 1
Version information

  • Go:
    go version go1.12.1 darwin/amd64
  • Rust:
    rustc 1.33.0 (2aa4c46cf 2019-02-28)
  • Cargo:
    cargo 1.33.0 (f099fe94b 2019-02-12)
  • Commit:
    09c3fa3cf9c4be011770f66a18c3d4346af66616
C-bug

All 9 comments

That's really strange. Nothing in the project should be loading anything from gx anymore.

@frrist, can you look into this one?

Hi @jscode017 this looks like it could be an issue with cached deps.

To clear your go mode cache you can run: go clean -n -modcache. Then rerun go run ./build deps and go run ./build build.

If the problem persists, please share the output of the three aforementioned commands here and we will investigate further.

This happens on 0.1.4(user devnet release), haven't seen this in master.
go run ./build deps would get the gx repo, but that branch seems to have other problems as well

end of go run ./build deps

# github.com/alecthomas/gometalinter
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:36:94: cannot use loadConfig (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("config", "Load JSON configuration from file.").Envar("GOMETALINTER_CONFIG").Action
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:38:100: cannot use disableAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("disable", "Disable previously enabled linters.").PlaceHolder("LINTER").Short('D').Action
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:39:99: cannot use enableAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("enable", "Enable previously disabled linters.").PlaceHolder("LINTER").Short('E').Action
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:40:83: cannot use cliLinterOverrides (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("linter", "Define a linter.").PlaceHolder("NAME:COMMAND:PATTERN").Action
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:43:56: cannot use disableAllAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("disable-all", "Disable all linters.").Action
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:44:54: cannot use enableAllAction (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.cmdMixin.flagGroup.Flag("enable-all", "Enable all linters.").Action
../../../../pkg/mod/github.com/alecthomas/[email protected]+incompatible/main.go:200:12: cannot use loadDefaultConfig (type func(*kingpin.Application, *kingpin.ParseElement, *kingpin.ParseContext) error) as type kingpin.Action in argument to app.Action
Command 'go get -u github.com/alecthomas/gometalinter' failed: exit status 2
exit status 1

I'm still installing deps not sure if it will work
But the comment of @kishansagathiya remind me something.
I has previously install the version of git tag 0.1.4, maybe that is what cause the problem?
sorry that I did not mention this

After deleting the $GOPATH/bin/go-filecoin
and rerun the whole building process, it built successfully and tests seems to pass
So maybe should delete go-filecoin in $GOPATH/bin before reinstall?

@kishansagathiya I believe the errors you are seeing are due to the environment variable GO111MODULE being set to on when running deps on 0.1.4 (which doesn't use go mod, I have been able to reproduce the errors you are seeing by running deps with GO111MODULE=on on version 0.1.4). Can you set GO111MODULE to off (export GO111MODULE=off) and run deps again? I believe this will fix your problem when building 0.1.4.

@jscode017 did you clear your go mod cache (go clean -n -modcache) before running deps again on 0.1.4? I don't believe deleting your filecoin binary will have any effect on the issue you were facing.

@frrist my scenario is that I built 0.1.4 first, and then built the newest commit
And somehow when I had go-filecoin(0.1.4 version) in my $GOPATH/bin, the building process won't compile files, maybe there is some setting I do causes it fail?
Kinds of weird, however, thankfully my issue is solved.

Can you set GO111MODULE to off

that worked, thanks @frrist

@jscode017 this behaviour is not something I am familiar with, but I am happy it resolved your issue. Since it sounds like this has fixed the problem I am going to close this issue. If the problem resurfaces feel free to reopen and share your output.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mishmosh picture mishmosh  路  9Comments

ognots picture ognots  路  7Comments

ZenGround0 picture ZenGround0  路  6Comments

NatoBoram picture NatoBoram  路  6Comments

Aboatlai picture Aboatlai  路  4Comments