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

golang 1.6 + codis 安装错误 #715

Closed
ujumpijump opened this issue Mar 2, 2016 · 7 comments
Closed

golang 1.6 + codis 安装错误 #715

ujumpijump opened this issue Mar 2, 2016 · 7 comments

Comments

@ujumpijump
Copy link

golang 1.6 版本

配置了 GOPATH 系统变量,但安装 codis 时,出现如下错误:
root# make
GOPATH=godep path godep restore
Error: GO15VENDOREXPERIMENT is enabled and the vendor/ directory is not a valid Go workspace.
godep: Error restore requires GOPATH but it is empty.
make: *** [godep] Error 1

@yangzhe1991
Copy link
Member

1.6刚出,我们还没针对1.6测试过……

@ujumpijump
Copy link
Author

ok,那目前 codis 支持的 golang 最高版本是?辛苦:)

@yangzhe1991
Copy link
Member

https://github.com/CodisLabs/codis/blob/master/.travis.yml 这个持续集成的配置文件里涉及到的版本就是我们目前期望支持的版本,如果里面有而有兼容问题就属于非预期的bug了。

@spinlock
Copy link
Member

spinlock commented Mar 3, 2016

go 现在才刚刚到 go1.6.1,到 1.6.x 稳定以后,我们会把正确的支持集成进来。

现在这个错误,是 godep 与 go1.6 冲突导致的,可以简单 fix 一下。

release 3.0 的话,修改如下。

diff --git a/Makefile b/Makefile
index ec9c57e..555c881 100644
--- a/Makefile
+++ b/Makefile
@@ -7,12 +7,12 @@ GODEP :=
 ifndef GODEP
 GODEP := $(shell \
    if which godep 2>&1 >/dev/null; then \
-       echo "godep"; \
+       echo GO15VENDOREXPERIMENT="0" "godep"; \
    else \
        if [ ! -x "${GOPATH}/bin/godep" ]; then \
            go get -u github.com/tools/godep; \
        fi; \
-       echo "${GOPATH}/bin/godep"; \
+       echo GO15VENDOREXPERIMENT="0" "${GOPATH}/bin/godep"; \
    fi;)
 endif

master 分支的话,GO15VENDOREXPERIMENT="0" make 应该就可以了。

@hsqlu
Copy link

hsqlu commented Mar 14, 2016

也可以在make之前 export GO15VENDOREXPERIMENT = 0. 这是go
1.5beta3之后加的一个experimental feature。你的go环境可能默认开启了

@han2o
Copy link

han2o commented May 4, 2016

0 > cd $GOPATH/src/github.com/CodisLabs/codis
0 > cat Makefile
all: build

build: build-version godep build-proxy build-config build-server

godep:
    @go get -u github.com/tools/godep
    GO15VENDOREXPERIMENT=0 GOPATH=`echo $GOPATH` /path/to/$GOBIN/godep restore

build-version:
    @bash genver.sh

build-proxy:
    GOPATH=`echo $GOPATH`:$$GOPATH go build -o bin/codis-proxy ./cmd/proxy

build-config:
    GOPATH=`echo $GOPATH`:$$GOPATH go build -o bin/codis-config ./cmd/cconfig
    @rm -rf bin/assets && cp -r cmd/cconfig/assets bin/

build-server:
    @mkdir -p bin
    make -j4 -C extern/redis-2.8.21/
    @rm -f bin/codis-server
    @cp -f extern/redis-2.8.21/src/redis-server bin/codis-server

clean:
    @rm -rf bin
    @rm -f *.rdb *.out *.log *.dump deploy.tar
    @rm -f extern/Dockerfile
    @rm -f sample/log/*.log sample/nohup.out
    @if [ -d test ]; then cd test && rm -f *.out *.log *.rdb; fi

distclean: clean
    @make --no-print-directory --quiet -C extern/redis-2.8.21 clean

gotest:
    GOPATH=`echo $GOPATH`:$$GOPATH go test ./pkg/... ./cmd/...
0 > sudo env GOPATH=`echo $GOPATH` make
0 > ls $GOPATH/src/github.com/CodisLabs/codis/bin
assets  codis-config  codis-proxy  codis-server

@spinlock spinlock removed the todo label Jun 7, 2016
@GeorgeforChina
Copy link

codis编译的是时候,改了Makefile之后还是报 GO15VENDOREXPERIMENT is enabled and the vendor/ directory is not a valid ,请问除了修复Makefile和 GO15VENDOREXPERIMENT="0" make这两种方法,其他的方法有吗。

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

No branches or pull requests

6 participants