Comments (12)
Fails with the regular Go tooling, but I see it needs bazel to build. Closing.
from tink.
Hey I want to make it work with the regular Go tooling too. Can you tell me the errors that you encountered? I'm new to Go...
from tink.
From the tink/go
directory,
So, it seems like at least the protobuf descriptions aren't committed to the repository which is common for Go projects so they can be build directly with go get
.
$ go build ./...
aead/aead_key_templates.go:21:2: cannot find package "github.com/google/tink/proto/aes_gcm_proto" in any of:
/Users/dgryski/work/src/go/src/github.com/google/tink/proto/aes_gcm_proto (from $GOROOT)
/Users/dgryski/go/src/github.com/google/tink/proto/aes_gcm_proto (from $GOPATH)
tink/proto_util.go:20:2: cannot find package "github.com/google/tink/proto/common_proto" in any of:
/Users/dgryski/work/src/go/src/github.com/google/tink/proto/common_proto (from $GOROOT)
/Users/dgryski/go/src/github.com/google/tink/proto/common_proto (from $GOPATH)
tink/cleartext_keyset_handle.go:22:2: cannot find package "github.com/google/tink/proto/tink_proto" in any of:
/Users/dgryski/work/src/go/src/github.com/google/tink/proto/tink_proto (from $GOROOT)
/Users/dgryski/go/src/github.com/google/tink/proto/tink_proto (from $GOPATH)
mac/hmac_key_manager.go:22:2: found packages mac (hmac.go) and hmac (hmac_test.go) in /Users/dgryski/go/src/github.com/google/tink/go/subtle/mac
mac/hmac_key_manager.go:25:2: cannot find package "github.com/google/tink/proto/hmac_proto" in any of:
/Users/dgryski/work/src/go/src/github.com/google/tink/proto/hmac_proto (from $GOROOT)
/Users/dgryski/go/src/github.com/google/tink/proto/hmac_proto (from $GOPATH)
signature/ecdsa_sign_key_manager.go:27:2: cannot find package "github.com/google/tink/proto/ecdsa_proto" in any of:
/Users/dgryski/work/src/go/src/github.com/google/tink/proto/ecdsa_proto (from $GOROOT)
/Users/dgryski/go/src/github.com/google/tink/proto/ecdsa_proto (from $GOPATH)
can't load package: mac/hmac_key_manager.go:22:2: found packages mac (hmac.go) and hmac (hmac_test.go) in /Users/dgryski/go/src/github.com/google/tink/go/subtle/mac
The mac
vs hmac
naming issue is a small quick fix.
from tink.
Thanks, I'll generate the proto code.
from tink.
I'm using
go version
go version go1.8.1 darwin/amd64
Here's what I did and the errors that I got:
$ pwd
/Users/thaidn/tink/cloudcryptosdk/go # cloudcryptosdk was our code name for Tink
$ cd go/
$ go build ./...
aead/aes_gcm_key_manager.go:22:2: cannot find package "github.com/google/tink/go/subtle/aead" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/subtle/aead (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/subtle/aead (from $GOPATH)
aead/aes_gcm_key_manager.go:23:2: cannot find package "github.com/google/tink/go/subtle/random" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/subtle/random (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/subtle/random (from $GOPATH)
aead/aead_config.go:20:2: cannot find package "github.com/google/tink/go/tink" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/tink (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/tink (from $GOPATH)
aead/aead_key_templates.go:21:2: cannot find package "github.com/google/tink/proto/aes_gcm_proto" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/proto/aes_gcm_proto (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/proto/aes_gcm_proto (from $GOPATH)
mac/hmac_key_manager.go:22:2: cannot find package "github.com/google/tink/go/subtle/mac" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/subtle/mac (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/subtle/mac (from $GOPATH)
mac/mac_key_templates.go:21:2: cannot find package "github.com/google/tink/proto/common_proto" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/proto/common_proto (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/proto/common_proto (from $GOPATH)
mac/hmac_key_manager.go:25:2: cannot find package "github.com/google/tink/proto/hmac_proto" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/proto/hmac_proto (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/proto/hmac_proto (from $GOPATH)
signature/ecdsa_sign_key_manager.go:24:2: cannot find package "github.com/google/tink/go/subtle" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/subtle (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/subtle (from $GOPATH)
signature/ecdsa_sign_key_manager.go:25:2: cannot find package "github.com/google/tink/go/subtle/signature" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/subtle/signature (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/subtle/signature (from $GOPATH)
signature/ecdsa_sign_key_manager.go:27:2: cannot find package "github.com/google/tink/proto/ecdsa_proto" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/proto/ecdsa_proto (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/proto/ecdsa_proto (from $GOPATH)
testutil/testutil.go:24:2: cannot find package "github.com/google/tink/go/aead" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/aead (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/aead (from $GOPATH)
testutil/testutil.go:25:2: cannot find package "github.com/google/tink/go/mac" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/mac (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/mac (from $GOPATH)
testutil/testutil.go:26:2: cannot find package "github.com/google/tink/go/signature" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/google/tink/go/signature (from $GOROOT)
/Users/thaidn/go/src/github.com/google/tink/go/signature (from $GOPATH)
It seems that go build cannot figure out that the prefix of my package is github.com/google/tink. What I should do?
from tink.
My GOPATH points to /Users/thaidn/go.
from tink.
the build.bazel is in tink/go/tink. If you run go build *.go
there, you get the usual proto errors. I think that might be the correct directory to build?
from tink.
Normally the directory structure is expected to mirror the package name. For this kind of shared-language repo, it's not uncommon to have go
in the package path. For example Vitess's packages are all at github.com/youtube/vitess/go
: https://godoc.org/github.com/youtube/vitess/go .
If you checkout the repository into /Users/thaidn/go/src/github.com/google/tink
then packages should be found (after updating the imports to be github.com/google/tink/go/aead
, etc)
from tink.
Thanks for the instructions, I appreciate it.
With my pending PR, go get github.com/google/tink/go/aead works now, but go get github.com/google/tink/go doesn't because I don't actually have any Go code in https://github.com/google/tink/tree/master/go. Is there a trick or convention that allows me to ensure all Tink packages are downloaded and installed with a single command?
from tink.
You can use go get github.com/google/tink/go/...
where ...
means "all packages under this directory".
from tink.
Thanks!
With b081da6, I think go get github.com/google/tink/go/... should work now. Please help verify.
You're more than welcome to play with the Go code and tell us what you think, but please don't use it in production.
from tink.
$ go get -v -u github.com/google/tink/go/...
github.com/google/tink (download)
github.com/golang/protobuf (download)
github.com/google/tink/go/subtle
github.com/google/tink/go/subtle/random
github.com/golang/protobuf/proto
github.com/google/tink/proto/tink_proto
github.com/google/tink/proto/common_proto
github.com/google/tink/proto/aes_gcm_proto
github.com/google/tink/proto/hmac_proto
github.com/google/tink/proto/ecdsa_proto
github.com/google/tink/go/tink
github.com/google/tink/go/subtle/mac
github.com/google/tink/go/subtle/aead
github.com/google/tink/go/subtle/signature
github.com/google/tink/go/aead
github.com/google/tink/go/mac
github.com/google/tink/go/signature
github.com/google/tink/go/testutil
LGTM. Thanks!
from tink.
Related Issues (20)
- tink cannot be installed on arm64 linux HOT 9
- Cannot install it with googleapis-common-protos and other related libs in python HOT 7
- Envelope AEAD Performance with GCP KMS HOT 1
- java tink library is not scaling with java threads HOT 1
- Tink installation on bazel and pip3 fail HOT 4
- Missing classes dectected while running R8 HOT 11
- Is Tink for Objective-C buildable via Bazel? HOT 9
- Recommendation on the best approach for rotation HOT 1
- tink 1.7.0 depends on protobuf 3.20.1 which has a security vulnerability patched in a newer version HOT 4
- Windows OS Support HOT 4
- Cannot download tinkey - The project to be billed is associated with a closed billing account. HOT 2
- cannot verify signature HOT 3
- java.security.GeneralSecurityException: cannot verify signature HOT 1
- No manager for type 'type.googleapis.com/google.crypto.tink.HpkePrivateKey' has been registered HOT 2
- H HOT 1
- compile tink cpp library for ios HOT 4
- OSS-Fuzz issue 66058 HOT 1
- Intent to archive https://github.com/google/tink
- Duplicate class found in modules jetified-tink-1.8.0 and jetified-tink-android-1.8.0 HOT 1
- Add PRF Documentation to website HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tink.