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

add support to go 1.18 #199

Closed
peczenyj opened this issue Apr 28, 2022 · 2 comments · Fixed by #200
Closed

add support to go 1.18 #199

peczenyj opened this issue Apr 28, 2022 · 2 comments · Fixed by #200
Assignees

Comments

@peczenyj
Copy link
Contributor

peczenyj commented Apr 28, 2022

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:

"../../github.com/vesoft-inc/nebula-go/v3/nebula/graph"

also

"../../github.com/vesoft-inc/nebula-go/v3/nebula/meta"

"../../github.com/vesoft-inc/nebula-go/v3/nebula/storage"

"../../github.com/vesoft-inc/nebula-go/v3/nebula/storage"

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

  1. why the tests are running in such old go version?
  2. is it possible generate the thrifit code compatible with go 1.19?
  3. do we really need the files listed here? seems they are programs and perhaps the nebula-go can work without it.

Thanks

@jamieliu1023
Copy link

Thanks @peczenyj for bringing up the issue! @Aiee Could you please help look at this?
CC @wey-gu

@Aiee
Copy link
Contributor

Aiee commented May 5, 2022

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:

  1. 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.
  2. I do not think so because the generation is processed by fbthrift, but we can make modifications manually just as you said.
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants