-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
bazel targets for stdlib packages or alternative ideas? #1944
Comments
It would probably be possible to define What exactly does
We used to have this with |
bazel_gomock uses the library to create the GOPATH of source files with ( |
Referencing the code: https://github.com/jmhodges/bazel_gomock/blob/ff6c20a9b6978c52b88b7a1e2e55b3b86e26685b/gomock.bzl#L110 ( |
Makes sense, thanks for explaining. So if you're using For standard library sources, use For standard library packages, use These will usually both point to wherever the SDK was checked out, but in cross-compiling configurations, the packages will be compiled somewhere else. The sources will not be present at the other location. |
A user of bazel_gomock just opened an issue where they'd like to generate a mock for an interface in the stdlib.
Bazel_gomock accepts
go_library
targets as thelibrary
parameter to generate the GOPATHs we need to satisfy those libraries. That means it would need ago_library
to the specific package in the stdlib. However, it looks like rules_go (through@go_sdk
) doesn't supply those.It would be nice if rules_go did provide bazel targets for the individual stdlib packages for tooling purposes.
But I'm also open to other design ideas if y'all have them.
(For instance, I've thought about adding magic code that reverse mapped from import paths to bazel targets to figure out what it needed instead of the
library
param, but I'm not sure if that works in the general case. I was hoping to keep folks in the bazel way of referring to things instead of having them flip between bazel and go style inside BUILD files, but I could be convinced not to. Does that exist as a tool already in rules_go?)The text was updated successfully, but these errors were encountered: