capnproto / go-capnp

Cap'n Proto library and code generator for Go

Home Page:https://capnproto.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to install go-capnp using installation instructions

ogelami opened this issue · comments

I am trying to install go-capnp by following the installation instructions in the README file. However, I am encountering an error when trying to install the Go language bindings using the following command:

GO111MODULE=off go get -u capnproto.org/go/capnp/v3/

The error message I am receiving is:

cannot find package "capnproto.org/go/capnp/v3" in any of:
	/usr/local/Cellar/go/1.20.2/libexec/src/capnproto.org/go/capnp/v3 (from $GOROOT)
	/Users/rahbn/go/src/capnproto.org/go/capnp/v3 (from $GOPATH)

It seems that the v3 folder is not being created in the correct location. Instead, only the capnproto.org/go/capnp directory is being created.

I have already installed the Cap'n Proto tools as instructed. Is there anything else I can try to resolve this issue?

Thank you.

What immediately catches my eye is that my installation is located at $GOPATH/src/capnproto.org/go/capnp; there is no /v3 path suffix on my machine.

Can you please try GO111MODULE=off go get -u capnproto.org/go/capnp?

If that doesn't work, let us know. We'll have you up and running in no time at all 😉

Maybe we should tweak the instructions to tell people to just do git clone; GOPATH builds are basically not a thing anymore, and it feels like the extra indirection is making this harder than it should be.

@ogelami, you should be able to make this work wherever it got checked out, as long as you pass the right path to capnp compile's -I flag when generating code; in general, it should be capnp compile -I ${path_to_go_capnp}/std; see where the std ended up and invoke accordingly.

Maybe we should tweak the instructions to tell people to just do git clone; GOPATH builds are basically not a thing anymore, and it feels like the extra indirection is making this harder than it should be.

👍

Wonderful, thank's for the welcoming and swift response.
Manually cloning the project, building the capnpc-go and referencing the /std path did the trick!