add support to go 1.18
peczenyj opened this issue · 2 comments
Hello
Using go 1.18, I am able to install with success this module via go get
. However if I try to run the tests for this particular repository via make test
(using master) I got this:
$ make test
go mod tidy
github.com/vesoft-inc/nebula-go/v3/nebula/graph/graph_service-remote imports
../../github.com/vesoft-inc/nebula-go/v3/nebula/graph: "../../github.com/vesoft-inc/nebula-go/v3/nebula/graph" is relative, but relative import paths are not supported in module mode
github.com/vesoft-inc/nebula-go/v3/nebula/meta/meta_service-remote imports
../../github.com/vesoft-inc/nebula-go/v3/nebula/meta: "../../github.com/vesoft-inc/nebula-go/v3/nebula/meta" is relative, but relative import paths are not supported in module mode
github.com/vesoft-inc/nebula-go/v3/nebula/storage/graph_storage_service-remote imports
../../github.com/vesoft-inc/nebula-go/v3/nebula/storage: "../../github.com/vesoft-inc/nebula-go/v3/nebula/storage" is relative, but relative import paths are not supported in module mode
make: *** [Makefile:10: test] Error 1
The issue is about this line:
also
It seems an easy thing to fix (just remove the ../.. in the import), however this code is Autogenerated by Thrift Compiler.
Since this is an issue with how the latest versions of go handle the module versus gopath mode and I did not find an easy command line option to fix it, I search and see that the tests are running using go 1.13 - last released was on 2020-08-06. It is no longer support.
Use make test
using the current go version available is something that 99% of the people who wants to contribute will do. If there is a specific requirement to run tests will be nice add a note (or add a section / page about this).
Questions
- why the tests are running in such old go version?
- is it possible generate the thrifit code compatible with go 1.19?
- do we really need the files listed here? seems they are programs and perhaps the nebula-go can work without it.
Thanks
Hello, thanks for your feedback on this. I'll look into this and once a fix is ready, I'll link the PR to this issue.
To answer your questions:
- It is actually the problem with tests, but the
go mod tidy
command. We use an older version in case there are users running the program in the environments with older Go. But I agree with you that we might need an update for the minimum Go version requirement. - I do not think so because the generation is processed by fbthrift, but we can make modifications manually just as you said.
- In some scenarios, nebula-go will be imported for internal usage, so some of the files will be accessed. I'll take a look at this.