osquery / osquery-go

Go bindings for osquery
MIT License
388 stars 79 forks source link

Glide and dependencies #55

Closed javierpr71 closed 6 years ago

javierpr71 commented 6 years ago

I'm trying to compile logger.go from your samples. I'm using Glide to manage dependencies.

"glide.exe init" generates a glide.yaml like this:

package: .
import:
- package: github.com/kolide/osquery-go
  subpackages:
  - gen/osquery

When I run "go build" the results is this:

C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1154:15: assignment mismatch: 2 variables but 1 values C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1203:20: not enough arguments in call to oprot.Flush have () want (context.Context) C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1227:15: assignment mismatch: 2 variables but 1 values C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1272:29: cannot use extensionProcessorPing literal (type extensionProcessorPing) as type thrift.TProcessorFunction in assignment: extensionProcessorPing does not implement thrift.TProcessorFunction (wrong type for Process method) have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException) want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException) C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1273:29: cannot use extensionProcessorCall literal (type extensionProcessorCall) as type thrift.TProcessorFunction in assignment: extensionProcessorCall does not implement thrift.TProcessorFunction (wrong type for Process method) have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException) want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException) C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1274:33: cannot use extensionProcessorShutdown literal (type extensionProcessorShutdown) as type thrift.TProcessorFunction in assignment: extensionProcessorShutdown does not implement thrift.TProcessorFunction (wrong type for Process method) have Process(int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException) want Process(context.Context, int32, thrift.TProtocol, thrift.TProtocol) (bool, thrift.TException) C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1284:27: not enough arguments in call to processor.Process have (int32, thrift.TProtocol, thrift.TProtocol) want (context.Context, int32, thrift.TProtocol, thrift.TProtocol) C:\Users\Axel\go\src\github.com\kolide\osquery-go\gen\osquery\osquery.go:1284:27: too many errors

Any idea?

groob commented 6 years ago

@javierpr71, to use this repo with a project in glide you have to override the thrift dependency version. See the Gopkg.toml file in the kolide/launcher repo as an example.