-
Notifications
You must be signed in to change notification settings - Fork 30
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 Go modules #27
Comments
Ok, the chief problem with supporting go modules is that, even with vendoring enabled, non-Go files and non-Go package dependencies are not included in the vendored code (we can see this from @rsc's disappointing response in golang/go#26366 (comment)). The solution here will be to add another "include" implementation that searches through checked out, unmodified modules to find protobuf files and their on-disk locations to the include path. It looks like we can do this using the following command:
The above will output json records in this format:
This solves the problem of where these files will be on disk but it doesn't solve the issue of mapping proto imports to Go package names, which is the key benefit from protobuild. It seems like we'd also have to make temporary set of links with the go module paths that link out to the expanded version names to setup the correct import paths. For the example above (which doesn't have protobufs, so its contrived) would create a directory This doesn't seem like a hack and may actually be a decent improvement if we can make it work out of tree. |
Ok, looking into this a bit more now to make it work:
Super glad I don't have to implement the craziness above! |
|
@rsc Sorry that I said it was disappointing (please don't take it personally ;) ), but we need a way to be able to bring in non-Go directories. There are a lot of ways to organize protobufs, so being opinionated on the matter makes it challenging to implement a solution without creating a full package manager for protobufs (which, maybe, we need). Do you know a way I could create this vendor directory then clean it up as part of the build without polluting the user's source directory? I may still have to build a temporary directory to manage the output of protoc, which just outputs to My approach right now is to have a tmpdir with the following:
What do you suggest? |
#29 only made it compatible with |
It might be time to start considering support for Go modules. Suggestions and support are welcome.
The text was updated successfully, but these errors were encountered: