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

Support multiple packages in the same directory #7

Open
jayconrod opened this issue Dec 6, 2017 · 3 comments
Open

Support multiple packages in the same directory #7

jayconrod opened this issue Dec 6, 2017 · 3 comments

Comments

@jayconrod
Copy link
Contributor

(Originally bazelbuild/rules_go#315)

We should consider supporting projects with multiple Go packages in the same directory. "go build" does not allow this, but it is fairly common within Google, and some projects being open-sourced by Google have expressed interest in this.

#5 (naming rules after Go packages) is probably a prerequisite.

@ashi009
Copy link
Contributor

ashi009 commented Dec 14, 2017

It has become a lower priority FR for me atm.

The most critical thing for all Bazel go project is to maintain the compatibility with the standard go toolchain — that’s the way to get out of box code completion, in-line document look up etc.

Unless we have a better approach for solving that, I don’t think this worth the effort. Of course it will be useful when open sourcing a google project.

EdSchouten pushed a commit to EdSchouten/bazel that referenced this issue Feb 24, 2019
- Add go_package attributes to the .proto files, so that protoc can
  properly generate imports for files that are linked together.

- Manually add go_proto_library/go_library tags. Due to multiple .proto
  files being stored in one directory, Gazelle is not capable of
  automatically generating rules for them. See
  bazelbuild/bazel-gazelle#7 for details.
@mariusgrigoriu
Copy link

How should we import repositories that have multiple packages in one directory? For example go_repository doesn't work with https://github.com/rivo/uniseg because the directory has a package uniseg and package main.

Can we specify which package to use for the build file?

@nvachhar
Copy link

I just ran into the issue with https://github.com/rivo/uniseg. It would be nice if we could specify the package we cared about

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

No branches or pull requests

4 participants