Skip to content

Commit adc471d

Browse files
authored
Merge pull request #381 from meshplus/fix(1.23)/grpc_version
fix: grpc and packr version
2 parents 6eeb32d + b6cd2c4 commit adc471d

File tree

9 files changed

+254
-26
lines changed

9 files changed

+254
-26
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN go mod download -x
1414
# Build real binaries
1515
COPY . .
1616

17-
RUN go get -u github.com/gobuffalo/packr/packr
17+
RUN go get github.com/gobuffalo/packr/v2/packr2@v2.8.3
1818

1919
RUN make install
2020

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,33 @@ test-coverage:
4949
@go test -short -coverprofile cover.out -covermode=atomic ${TEST_PKGS}
5050
@cat cover.out >> coverage.txt
5151

52-
packr:
53-
cd internal/repo && packr
52+
packr2:
53+
cd internal/repo && packr2
5454

5555
prepare:
5656
cd scripts && bash prepare.sh
5757

5858
## make install: Go install the project (hpc)
59-
install: packr
59+
install: packr2
6060
rm -f imports/imports.go
6161
$(GO) install $(GOFLAG) -ldflags '${GOLDFLAGS}' ./cmd/${APP_NAME}
6262
@printf "${GREEN}Install pier successfully${NC}\n"
6363

64-
build: packr
64+
build: packr2
6565
@mkdir -p bin
6666
rm -f imports/imports.go
6767
$(GO) build $(GOFLAG) -ldflags '${GOLDFLAGS}' ./cmd/${APP_NAME}
6868
@mv ./pier bin
6969
@printf "${GREEN}Build Pier successfully!${NC}\n"
7070

71-
installent: packr
71+
installent: packr2
7272
cp imports/imports.go.template imports/imports.go
7373
@sed "s?)?$(MODS))?" go.mod | tr '@' '\n' > goent.mod
7474
@cat goent.diff | grep '^replace' >> goent.mod
7575
$(GO) install $(GOFLAG) -tags ent -ldflags '${GOLDFLAGS}' -modfile goent.mod ./cmd/${APP_NAME}
7676
@printf "${GREEN}Install pier ent successfully${NC}\n"
7777

78-
buildent: packr
78+
buildent: packr2
7979
@mkdir -p bin
8080
cp imports/imports.go.template imports/imports.go
8181
@sed "s?)?$(MODS)@)?" go.mod | tr '@' '\n' > goent.mod
@@ -86,7 +86,7 @@ buildent: packr
8686
mod:
8787
sed "s?)?$(MODS)\n)?" go.mod
8888

89-
docker-build: packr
89+
docker-build: packr2
9090
$(GO) install $(GOFLAG) -ldflags '${STATIC_LDFLAGS}' ./cmd/${APP_NAME}
9191
@echo "Build pier successfully"
9292

cmd/pier/plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
"github.com/cavaliercoder/grab"
1515
"github.com/gobuffalo/packd"
16-
"github.com/gobuffalo/packr"
16+
packr2 "github.com/gobuffalo/packr/v2"
1717
"github.com/meshplus/bitxhub-kit/fileutil"
1818
"github.com/meshplus/bitxhub-kit/types"
1919
"github.com/meshplus/pier/internal/repo"
@@ -416,7 +416,7 @@ func updateAppchainType(repoRoot, chainType string) error {
416416
}
417417

418418
func copyDir(srcDir, dstDir string) error {
419-
box := packr.NewBox(srcDir)
419+
box := packr2.New("box", srcDir)
420420
return box.Walk(func(s string, file packd.File) error {
421421
p := filepath.Join(dstDir, s)
422422
dir := filepath.Dir(p)

go.mod

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ go 1.13
55
require (
66
github.com/Rican7/retry v0.1.0
77
github.com/btcsuite/btcd v0.21.0-beta
8+
github.com/bytecodealliance/wasmtime-go v0.37.0 // indirect
89
github.com/cavaliercoder/grab v2.0.0+incompatible
910
github.com/cbergoon/merkletree v0.2.0
1011
github.com/fatih/color v1.9.0
1112
github.com/fsnotify/fsnotify v1.4.9
12-
github.com/gobuffalo/packd v1.0.0
13-
github.com/gobuffalo/packr v1.30.1
13+
github.com/gobuffalo/packd v1.0.1
14+
github.com/gobuffalo/packr/v2 v2.8.3
1415
github.com/golang/mock v1.6.0
1516
github.com/google/btree v1.0.0
1617
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd
@@ -24,15 +25,15 @@ require (
2425
github.com/meshplus/go-lightp2p v0.0.0-20200817105923-6b3aee40fa54
2526
github.com/mitchellh/go-homedir v1.1.0
2627
github.com/multiformats/go-multiaddr v0.3.0
27-
github.com/pelletier/go-toml v1.8.1
28+
github.com/pelletier/go-toml v1.9.3
2829
github.com/sirupsen/logrus v1.8.1
29-
github.com/spf13/viper v1.7.1
30-
github.com/stretchr/testify v1.7.0
30+
github.com/spf13/viper v1.8.1
31+
github.com/stretchr/testify v1.8.0
3132
github.com/tidwall/gjson v1.6.8
3233
github.com/urfave/cli v1.22.1
3334
github.com/wonderivan/logger v1.0.0
3435
go.uber.org/atomic v1.7.0
35-
google.golang.org/grpc v1.33.2
36+
google.golang.org/grpc v1.38.0
3637
)
3738

3839
replace github.com/libp2p/go-libp2p-core => github.com/libp2p/go-libp2p-core v0.5.6

go.sum

Lines changed: 212 additions & 2 deletions
Large diffs are not rendered by default.

internal/repo/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"github.com/fsnotify/fsnotify"
1616
"github.com/gobuffalo/packd"
17-
"github.com/gobuffalo/packr"
17+
packr2 "github.com/gobuffalo/packr/v2"
1818
"github.com/meshplus/bitxhub-kit/crypto"
1919
"github.com/meshplus/bitxhub-kit/crypto/asym"
2020
"github.com/mitchellh/go-homedir"
@@ -70,7 +70,7 @@ func Initialize(repoRoot, algo string) error {
7070
}
7171
}
7272

73-
box := packr.NewBox(ConfigPath)
73+
box := packr2.New("box", ConfigPath)
7474

7575
cryptoType, err := crypto.CryptoNameToType(algo)
7676
if err != nil {

scripts/cross_compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ linux-amd64)
1818
pier-ubuntu/compile \
1919
/bin/bash -c "go env -w GO111MODULE=on &&
2020
go env -w GOPROXY=https://goproxy.cn,direct &&
21-
go get -u github.com/gobuffalo/packr/packr &&
21+
go install github.com/gobuffalo/packr/v2/packr2@v2.8.3 &&
2222
cd /code/pier-client-fabric && make fabric1.4 &&
2323
cd /code/pier-client-ethereum && make eth &&
2424
cd /code/pier && make install &&

scripts/prepare.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33
BLUE='\033[0;34m'
44
NC='\033[0m'
55

6+
function go_install() {
7+
version=$(go env GOVERSION)
8+
if [[ ! "$version" < "go1.16" ]];then
9+
go install "$@"
10+
else
11+
go get "$@"
12+
fi
13+
}
14+
615
function print_blue() {
716
printf "${BLUE}%s${NC}\n" "$1"
817
}
918

1019
print_blue "===> 1. Install packr"
11-
if ! type packr >/dev/null 2>&1; then
12-
go get -u github.com/gobuffalo/packr/packr@v1.30.1
20+
if ! type packr2 >/dev/null 2>&1; then
21+
go_install github.com/gobuffalo/packr/v2/packr2@v2.8.3
1322
fi
1423

1524
print_blue "===> 2. Install golangci-lint"

scripts/release_binary.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ PROJECT_PATH=$(dirname "${CURRENT_PATH}")
88
RELEASE_PATH=${PROJECT_PATH}/bin
99
APP_VERSION=$(if [ `git rev-parse --abbrev-ref HEAD` == 'HEAD' ];then git describe --tags HEAD ; else echo "dev" ; fi)
1010

11-
print_blue "===> 1. Install packr"
12-
if ! type packr >/dev/null 2>&1; then
13-
go get -u github.com/gobuffalo/packr/packr@v1.30.1
11+
function go_install() {
12+
version=$(go env GOVERSION)
13+
if [[ ! "$version" < "go1.16" ]];then
14+
go install "$@"
15+
else
16+
go get "$@"
17+
fi
18+
}
19+
print_blue "===> 1. Install packr2"
20+
if ! type packr2 >/dev/null 2>&1; then
21+
go_install github.com/gobuffalo/packr/v2/packr2@v2.8.3
1422
fi
1523

1624
print_blue "===> 2. build pier"

0 commit comments

Comments
 (0)