Skip to content

Commit

Permalink
build: enable journal in promtail linux release build (grafana#1072)
Browse files Browse the repository at this point in the history
* build: override promtail release build with cgo-enabled binary

The published binary of promtail for linux/amd64 was not built with CGO
support, so journal tailing could not be used.

This is kind of a dirty hack: we just re-build promtail at the end of
building everything else with CGO enabled. It's not clear how it could
be done more cleanly.

Fixes grafana#1057.

* build: break out gox builds
  • Loading branch information
rfratto authored and cyriltovena committed Oct 2, 2019
1 parent 8031347 commit cdc0dc4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,13 @@ cmd/promtail/promtail-debug: $(APP_GO_FILES) pkg/promtail/server/ui/assets_vfsda
# Releasing #
#############
# concurrency is limited to 4 to prevent CircleCI from OOMing. Sorry
GOX = gox $(GO_FLAGS) -parallel=4 -output="dist/{{.Dir}}-{{.OS}}-{{.Arch}}" -arch="amd64 arm64 arm" -os="linux"
GOX = gox $(GO_FLAGS) -parallel=4 -output="dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
CGO_GOX = gox $(DYN_GO_FLAGS) -cgo -parallel=4 -output="dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
dist: clean
CGO_ENABLED=0 $(GOX) -osarch="windows/amd64" ./cmd/loki
CGO_ENABLED=0 $(GOX) -osarch="darwin/amd64 windows/amd64 freebsd/amd64" ./cmd/promtail ./cmd/logcli
CGO_ENABLED=0 $(GOX) -osarch="linux/amd64 linux/arm64 linux/arm windows/amd64" ./cmd/loki
CGO_ENABLED=0 $(GOX) -osarch="linux/amd64 linux/arm64 linux/arm darwin/amd64 windows/amd64 freebsd/amd64" ./cmd/logcli
CGO_ENABLED=0 $(GOX) -osarch="linux/arm64 linux/arm darwin/amd64 windows/amd64 freebsd/amd64" ./cmd/promtail
CGO_ENABLED=1 $(CGO_GOX) -osarch="linux/amd64" ./cmd/promtail
gzip dist/*
pushd dist && sha256sum * > SHA256SUMS && popd

Expand Down

0 comments on commit cdc0dc4

Please sign in to comment.