Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Support MacOS sed for obtaining module list. #1483

Merged
merged 1 commit into from
Oct 8, 2018

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Oct 6, 2018

This modifies the code in run_tests.sh which obtains the stripped list of modules to test based on the output of the go list command to work with MacOS as well. It seems that sed on MacOS does not like the "or" regexp syntax, so this modifies it to perform each branch separately.

@davecgh davecgh added this to the 1.4.0 milestone Oct 6, 2018
@dnldd
Copy link
Member

dnldd commented Oct 6, 2018

gometalinter is generating a lot of warnings for me with this. Each module is being tested separately as intended however.

...
+ for module in '$MODPATHS'
+ echo '==> txscript'
==> txscript
+ cd txscript
+ env GORACE=halt_on_error=1 CC=gcc go test -short -race -tags rpctest ./...
ok  	github.com/decred/dcrd/txscript	(cached)
+ for module in '$MODPATHS'
+ echo '==> wire'
==> wire
+ cd wire
+ env GORACE=halt_on_error=1 CC=gcc go test -short -race -tags rpctest ./...
ok  	github.com/decred/dcrd/wire	(cached)
+ [[ 1.11 != 1.10 ]]
+ go mod vendor
+ unset GO111MODULE
+ gometalinter --vendor --disable-all --deadline=10m --enable=gofmt --enable=gosimple --enable=unconvert --enable=ineffassign ./...
vendor/github.com/dchest/siphash/siphash.go:12:8:warning: could not import hash (cannot find package "hash" in any of: (gosimple)
internal/version/version.go:11:2:warning: could not import bytes (cannot find package "bytes" in any of: (unconvert)
internal/version/version.go:12:2:warning: could not import fmt (cannot find package "fmt" in any of: (unconvert)
internal/version/version.go:13:2:warning: could not import strings (cannot find package "strings" in any of: (unconvert)
vendor/github.com/decred/dcrd/blockchain/stake/internal/dbnamespace/dbnamespace.go:7:2:warning: could not import encoding/binary (cannot find package "encoding/binary" in any of: (unconvert)
vendor/github.com/dchest/siphash/siphash.go:12:8:warning: could not import hash (cannot find package "hash" in any of: (unconvert)
blockchain/internal/dbnamespace/dbnamespace.go:7:2:warning: could not import encoding/binary (cannot find package "encoding/binary" in any of: (unconvert)
vendor/github.com/dchest/blake256/blake256.go:12:8:warning: could not import hash (cannot find package "hash" in any of: (unconvert)
internal/limits/limits_unix.go:11:2:warning: could not import fmt (cannot find package "fmt" in any of: (unconvert)
internal/limits/limits_unix.go:12:2:warning: could not import syscall (cannot find package "syscall" in any of: (unconvert)
vendor/github.com/decred/dcrd/chaincfg/chainhash/hash.go:9:2:warning: could not import encoding/hex (cannot find package "encoding/hex" in any of: (unconvert)
vendor/github.com/decred/dcrd/chaincfg/chainhash/hash.go:10:2:warning: could not import fmt (cannot find package "fmt" in any of: (unconvert)
dcrjson/chainsvrcmds.go:12:2:warning: could not import encoding/json (cannot find package "encoding/json" in any of: (unconvert)
dcrjson/chainsvrcmds.go:13:2:warning: could not import fmt (cannot find package "fmt" in any of: (unconvert)
dcrjson/cmdinfo.go:10:2:warning: could not import reflect (cannot find package "reflect" in any of: (unconvert)
dcrjson/cmdinfo.go:11:2:warning: could not import strings (cannot find package "strings" in any of: (unconvert)
dcrjson/cmdparse.go:12:2:warning: could not import strconv (cannot find package "strconv" in any of: (unconvert)
dcrjson/help.go:9:2:warning: could not import bytes (cannot find package "bytes" in any of: (unconvert)
dcrjson/help.go:13:2:warning: could not import text/tabwriter (cannot find package "text/tabwriter" in any of: (unconvert)
dcrjson/parse.go:8:2:warning: could not import encoding/hex (cannot find package "encoding/hex" in any of: (unconvert)
dcrjson/register.go:12:2:warning: could not import sort (cannot find package "sort" in any of: (unconvert)
dcrjson/register.go:15:2:warning: could not import sync (cannot find package "sync" in any of: (unconvert)
vendor/github.com/decred/dcrd/certgen/certgen.go:9:2:warning: could not import bytes (cannot find package "bytes" in any of: (unconvert)
vendor/github.com/decred/dcrd/certgen/certgen.go:10:2:warning: could not import crypto/ecdsa (cannot find package "crypto/ecdsa" in any of: (unconvert)
vendor/github.com/decred/dcrd/certgen/certgen.go:11:2:warning: could not import crypto/elliptic (cannot find package "crypto/elliptic" in any of: (unconvert)
vendor/github.com/decred/dcrd/certgen/certgen.go:12:2:warning: could not import crypto/rand (cannot find package "crypto/rand" in any of: (unconvert)
vendor/github.com/decred/dcrd/certgen/certgen.go:13:4:warning: could not import crypto/sha512 (cannot find package "crypto/sha512" in any of: (unconvert)
vendor/github.com/decred/dcrd/certgen/certgen.go:14:2:warning: could not import crypto/x509 (cannot find package "crypto/x509" in any of: (unconvert)
...```

@davecgh
Copy link
Member Author

davecgh commented Oct 6, 2018

Looks like an old version of gometalinter.

@dnldd
Copy link
Member

dnldd commented Oct 8, 2018

sorted out and working as expected.

Copy link
Member

@jrick jrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't test on macOS but looks reasonable

This modifies the code in run_tests.sh which obtains the stripped list
of modules to test based on the output of the go list command to work
with MacOS as well.  It seems that sed on MacOS does not like the "or"
regexp syntax, so this modifies it to perform each branch separately.
@davecgh davecgh force-pushed the build_fix_macos_module_list branch from e2c95bc to 7e3dfb2 Compare October 8, 2018 17:32
@davecgh davecgh merged commit 7e3dfb2 into decred:master Oct 8, 2018
@davecgh davecgh deleted the build_fix_macos_module_list branch October 8, 2018 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants