-
Notifications
You must be signed in to change notification settings - Fork 173
update gazelle and rules_go #3325
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @sgmonroy)
a discussion (no related file):
gazelle is throwing errors for me:
$ make bazel
...
DEBUG: /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazelle/internal/go_repository.bzl:182:13: gazelle: gazelle: finding module path for import gol
ang.org/x/sys/windows: exit status 1: go: finding golang.org/x/sys/windows latest
go: finding golang.org/x/sys latest
can't load package: package golang.org/x/sys/windows: build constraints exclude all Go files in /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazell
e_go_repository_cache/pkg/mod/golang.org/x/sys@v0.0.0-20191105231009-c1f44814a5cd/windows
DEBUG: /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazelle/internal/go_repository.bzl:182:13: gazelle: gazelle: finding module path for import git
hub.com/scionproto/scion/go/lib/serrors: exit status 1: go: finding github.com/scionproto/scion/go/lib/serrors latest
go: finding github.com/scionproto/scion/go/lib latest
go: finding github.com/scionproto/scion/go latest
go: finding github.com/scionproto/scion v0.3.1
go: downloading github.com/scionproto/scion v0.3.1
can't load package: package github.com/scionproto/scion/go/lib/serrors: unknown import path "github.com/scionproto/scion/go/lib/serrors": cannot find module providing package github.com/scio
nproto/scion/go/lib/serrors
gazelle: finding module path for import fake/serrors: exit status 1: can't load package: package fake/serrors: unknown import path "fake/serrors": cannot find module providing package fake/s
errors
gazelle: finding module path for import github.com/scionproto/scion/go/lib/serrors: exit status 1: go: finding github.com/scionproto/scion/go/lib/serrors latest
go: finding github.com/scionproto/scion/go/lib latest
go: finding github.com/scionproto/scion/go latest
go: finding github.com/scionproto/scion v0.3.1
go: downloading github.com/scionproto/scion v0.3.1
can't load package: package github.com/scionproto/scion/go/lib/serrors: unknown import path "github.com/scionproto/scion/go/lib/serrors": cannot find module providing package github.com/scio
nproto/scion/go/lib/serrors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sgmonroy)
a discussion (no related file):
Previously, kormat (Stephen Shirley) wrote…
gazelle is throwing errors for me:
$ make bazel ... DEBUG: /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazelle/internal/go_repository.bzl:182:13: gazelle: gazelle: finding module path for import gol ang.org/x/sys/windows: exit status 1: go: finding golang.org/x/sys/windows latest go: finding golang.org/x/sys latest can't load package: package golang.org/x/sys/windows: build constraints exclude all Go files in /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazell e_go_repository_cache/pkg/mod/golang.org/x/sys@v0.0.0-20191105231009-c1f44814a5cd/windows DEBUG: /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazelle/internal/go_repository.bzl:182:13: gazelle: gazelle: finding module path for import git hub.com/scionproto/scion/go/lib/serrors: exit status 1: go: finding github.com/scionproto/scion/go/lib/serrors latest go: finding github.com/scionproto/scion/go/lib latest go: finding github.com/scionproto/scion/go latest go: finding github.com/scionproto/scion v0.3.1 go: downloading github.com/scionproto/scion v0.3.1 can't load package: package github.com/scionproto/scion/go/lib/serrors: unknown import path "github.com/scionproto/scion/go/lib/serrors": cannot find module providing package github.com/scio nproto/scion/go/lib/serrors gazelle: finding module path for import fake/serrors: exit status 1: can't load package: package fake/serrors: unknown import path "fake/serrors": cannot find module providing package fake/s errors gazelle: finding module path for import github.com/scionproto/scion/go/lib/serrors: exit status 1: go: finding github.com/scionproto/scion/go/lib/serrors latest go: finding github.com/scionproto/scion/go/lib latest go: finding github.com/scionproto/scion/go latest go: finding github.com/scionproto/scion v0.3.1 go: downloading github.com/scionproto/scion v0.3.1 can't load package: package github.com/scionproto/scion/go/lib/serrors: unknown import path "github.com/scionproto/scion/go/lib/serrors": cannot find module providing package github.com/scio nproto/scion/go/lib/serrors
Nevermind, whatever that was, it went away when i did another make clean bazel
. v0v.
go/lib/overlay/conn/BUILD.bazel, line 9 at r1 (raw file):
visibility = ["//visibility:public"], deps = select({ "@io_bazel_rules_go//go/platform:android": [
It's very weird to see an android target show up here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @kormat)
go/lib/overlay/conn/BUILD.bazel, line 9 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
It's very weird to see an android target show up here.
Agree, but couldn't figure out a way to avoid that. For some reason gazelle wants to add it.
The source of it seems to be having the +build linux
GO tag in the file and makes the whole select
stuff happens and ultimately add the android target.
Maybe there is a way to restrict this somehow, I just didn't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sgmonroy)
WORKSPACE, line 510 at r1 (raw file):
importpath = "golang.org/x/ctx", sum = "", version = "latest",
This doesn't seem like a good idea. Is there a reason we can't ping to a specific version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @kormat)
WORKSPACE, line 510 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
This doesn't seem like a good idea. Is there a reason we can't ping to a specific version?
this was added by gazelle when updating the repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sgmonroy)
WORKSPACE, line 510 at r1 (raw file):
Previously, sgmonroy (Sergio Gonzalez Monroy) wrote…
this was added by gazelle when updating the repo
Huh, i see. Let's pin to a specific version, and see if that works. Otherwise this seems likely to break at some point in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @sgmonroy)
WORKSPACE, line 510 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Huh, i see. Let's pin to a specific version, and see if that works. Otherwise this seems likely to break at some point in the future.
Ah, also bazel chokes on this:
$ bazel query 'somepath(//:scion, @org_golang_x_ctx//...)'
INFO: Call stack for the definition of repository 'org_golang_x_ctx' which is a go_repository (rule definition at /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazelle/internal/go_repository.bzl:187:17):
- /home/kormat/go/src/github.com/scionproto/scion/WORKSPACE:506:1
ERROR: An error occurred during the fetch of repository 'org_golang_x_ctx':
if version is specified, sum must also be
ERROR: if version is specified, sum must also be
Loading: 1 packages loaded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @kormat)
WORKSPACE, line 510 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Ah, also bazel chokes on this:
$ bazel query 'somepath(//:scion, @org_golang_x_ctx//...)' INFO: Call stack for the definition of repository 'org_golang_x_ctx' which is a go_repository (rule definition at /home/kormat/.cache/bazel/_bazel_kormat/5fc5be52f0a76618e694c19b288efbf5/external/bazel_gazelle/internal/go_repository.bzl:187:17): - /home/kormat/go/src/github.com/scionproto/scion/WORKSPACE:506:1 ERROR: An error occurred during the fetch of repository 'org_golang_x_ctx': if version is specified, sum must also be ERROR: if version is specified, sum must also be Loading: 1 packages loaded
@sgmonroy this isn't needed please delete this repository dependency. It builds without it.
This patch works around some issues in rules_go/nogo from v0.19.0+ where it fails to exclude paths appropiately for packages that use cgo. See issue below: bazel-contrib/rules_go#2172
71fdc4f
to
5110a60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @kormat and @lukedirtwalker)
WORKSPACE, line 510 at r1 (raw file):
Previously, lukedirtwalker (Lukas Vogel) wrote…
@sgmonroy this isn't needed please delete this repository dependency. It builds without it.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @kormat)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
This patch works around some issues in rules_go/nogo from v0.19.0+
where it fails to exclude paths appropiately for packages that use cgo.
See issue below:
bazel-contrib/rules_go#2172
This change is