Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Switch to Go modules #118

Merged
merged 2 commits into from
Apr 8, 2019
Merged

Switch to Go modules #118

merged 2 commits into from
Apr 8, 2019

Conversation

dennwc
Copy link
Member

@dennwc dennwc commented Apr 3, 2019

Switch import paths from gopkg.in to GitHub and switch Dep to Go modules.

This also bumps the client version to v4.

Signed-off-by: Denys Smirnov <denys@sourced.tech>
@dennwc dennwc self-assigned this Apr 3, 2019
@dennwc dennwc requested review from creachadair and bzz April 3, 2019 18:06
@dennwc
Copy link
Member Author

dennwc commented Apr 3, 2019

Waiting for someone to enable CIs :)

Copy link
Contributor

@bzz bzz left a comment

Choose a reason for hiding this comment

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

LGTM

And I guess at least 2 pages at documentation need to have paths updated as well?

@dennwc
Copy link
Member Author

dennwc commented Apr 4, 2019

@bzz Definitely. Also, still waiting for AppVeyor CI pass.

Signed-off-by: Denys Smirnov <denys@sourced.tech>
@dennwc dennwc merged commit 3338402 into bblfsh:master Apr 8, 2019
@dennwc dennwc deleted the modules branch April 8, 2019 15:08
@bzz
Copy link
Contributor

bzz commented Apr 10, 2019

JFYI go test all on current master does not seem to pass.

Sorry for not noticing that earlier. Similar failures were rised as relevant in module migration in enry so posting it here:

# github.com/pkg/errors
vet: ../../../go/pkg/mod/github.com/pkg/errors@v0.8.0/bench_test.go:26:6: toperr declared but not used
FAIL	github.com/pkg/errors [build failed]

@dennwc
Copy link
Member Author

dennwc commented Apr 10, 2019

@bzz go test all runs test not only for the current project but for all other packages in GOPATH (or required by the module). Thus, this failure is not related to Go client - it's a test failure in github.com/pkg/errors. All we can do is bump the dependency version when they fix it.

@bzz
Copy link
Contributor

bzz commented Apr 10, 2019

I know, @dennwc and thought the same, it's just that a different opinion was expressed by @creachadair at src-d/enry#219 (comment) so I'm just sharing it here.

Would be good to treat those uniformly somehow, given that there is no conceptual difference between these two.

@creachadair
Copy link
Contributor

I know, @dennwc and thought the same, it's just that a different opinion was expressed by @creachadair at src-d/enry#219 (comment) so I'm just sharing it here.

Would be good to treat those uniformly somehow, given that there is no conceptual difference between these two.

Well, we should probably not be using go test all in our CI, which I think would simplify both cases.

@bzz
Copy link
Contributor

bzz commented Apr 11, 2019

Agree! But I'm a bit confused - I'm not aware of anyone using go test all on CI so far.

@creachadair
Copy link
Contributor

Agree! But I'm a bit confused - I'm not aware of anyone using go test all on CI so far.

Sorry, based on #118 (comment) I thought maybe you were saying our failures were due to that. If go test ./... from the module root passes, I think we should be OK.

@@ -1,15 +1,15 @@
language: go
go_import_path: gopkg.in/bblfsh/client-go.v3
go_import_path: github.com/bblfsh/go-client
Copy link
Contributor

@bzz bzz Apr 12, 2019

Choose a reason for hiding this comment

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

I'm sorry for digging this up - but @dennwc do you think we still need this for some reason, given GO111MODULE=on?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can try disabling it. The only reason to do this is to allow CI to pass in forks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, thank you for confirming - that is what I thought as well.

On the second thought - would not CI on forks still work, even without it, as GO111MODULE=on ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should be able to infer the import path from go.mod anyway, so you are right, it should work. Let me try to open a PR with it, we'll see if it fails or not on my fork.

Copy link
Contributor

Choose a reason for hiding this comment

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

😆 thank you for brave experiments!

Copy link
Member Author

Choose a reason for hiding this comment

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

@bzz bzz mentioned this pull request Apr 12, 2019
8 tasks
@dennwc dennwc mentioned this pull request Apr 12, 2019
install:
- |
if [[ $TRAVIS_OS_NAME = linux ]]; then
docker run --privileged -d -p 9432:9432 --name bblfshd bblfsh/bblfshd:$BBLFSHD_VERSION
docker exec bblfshd bblfshctl driver install bblfsh/python-driver:$BBLFSH_PYTHON_VERSION
fi
- go get -v -t ./...
- go mod download
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, do you think this is necessary for correctness, or is it just an optimisation to warm up some FS cache between jobs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's only to split the dependency download process and the test process. It will work if we remove it, but it will download everything during go test.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants