mozilla-services / heka

DEPRECATED: Data collection and processing made easy.
http://hekad.readthedocs.org/
Other
3.39k stars 530 forks source link

Heka golang client installation #1211

Open ildus opened 9 years ago

ildus commented 9 years ago

Client installation fails:

➜ go get github.com/mozilla-services/heka/client
# github.com/mozilla-services/heka/message
../../go/src/github.com/mozilla-services/heka/message/message_matcher.go:21: undefined: tree

I understand why (because need to generate message_matcher_parser.go first), but is there any way to install client without full heka build?

blalor commented 9 years ago

Running into this, too. There really should be first-class client support.

ildus commented 9 years ago

@blalor By now, you can use this library: https://github.com/ildus/golog/tree/master/heka_emitter

blalor commented 9 years ago

Cool! I’ll check that out.

trixpan commented 9 years ago

@blalor have you had any luck?

blalor commented 9 years ago

I never tried it. My Heka project never got off the ground.

trixpan commented 9 years ago

@ildus . From the trail it seems to be fixed, should we close this ticket?

ildus commented 9 years ago

@trixpan I'm not sure that is still related, but now I get this error: ➜ ~ go get github.com/mozilla-services/heka/message
package code.google.com/p/gogoprotobuf/proto: unable to detect version control system for code.google.com/ path ➜ ~ go get github.com/mozilla-services/heka/client package code.google.com/p/gogoprotobuf/proto: unable to detect version control system for code.google.com/ path

trixpan commented 9 years ago

@ildus

I don't think it is.

Seems to me you are hitting golang's default behaviour/expectation around a stable HEAD...

If you look at commit ad5b214aa95ad571c3f93cc783e262f5647a9058 you will see that @rafrombrc removed the very same links to googlecode back in July under the the v.0.10 tag. However, the github master tree still points to stable code (i.e. 0.9.2)

As the link above explains, golang get always will retrieve the default version of the git repository and as such you are instructing your compiler to get an old version of Heka (Looking back, perhaps commit ad5b214aa95ad571c3f93cc783e262f5647a9058 should have been done against the master, not only dev...)

In any case... Although - to the best of my knowledge - golang doesn't have a native solution around this, there are some workarounds proposed around this. the simpler of them is using an intermediary service like gopkg.in ...

Can you try to run and let us know if it still happens?

$ go get gopkg.in/mozilla-services/heka.v0.10.0b1

Cheers

starchou commented 9 years ago

I have same problem when I use command go test -run=TestInit in the path = heka/sandbox/lua。

rafrombrc commented 9 years ago

@starchou You can run tests in a functional Heka build by first activating the environment (using source env.sh) and then using the full path to the go package. In your case the command would be go test -v -run=TestInit github.com/mozilla-services/heka/sandbox/lua.

starchou commented 9 years ago

@rafrombrc thanks! it works now ! I hack lua_sandbox.go set the cgo CFLAGS and cgo LDFLAGS