Skip to content
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

Local build fails - can't find sd-journal.h #789

Closed
steveww opened this issue Jul 19, 2019 · 2 comments
Closed

Local build fails - can't find sd-journal.h #789

steveww opened this issue Jul 19, 2019 · 2 comments
Assignees

Comments

@steveww
Copy link

steveww commented Jul 19, 2019

Describe the bug
github.com/grafana/loki/vendor/github.com/coreos/go-systemd/sdjournal
vendor/github.com/coreos/go-systemd/sdjournal/journal.go:27:11: fatal error: systemd/sd-journal.h: No such file or directory
// #include <systemd/sd-journal.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

To Reproduce
git pull
go build cmd/promtail

Expected behavior
Successful compile of Promtail

Environment:
Ubuntu 18.04.2
Linux server1 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
go version go1.12.4 linux/amd64

Screenshots, promtail config, or terminal output
If applicable, add any output to help explain your problem.

@rfratto
Copy link
Member

rfratto commented Jul 19, 2019

Since #730 was merged promtail requires the systemd headers to be installed on linux (apt install libsystemd-dev). If you don't want to do that you can build promtail with CGO disabled which should also fix the problem for you: CGO_ENABLED=0 go build cmd/promtail.

We should probably update the build instructions to include this or disable journal support by default through a custom build tag.

@steveww
Copy link
Author

steveww commented Jul 22, 2019

New build instructions look good. Thanks.

@steveww steveww closed this as completed Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants