Skip to content

Commit

Permalink
Enable Cgo for Filebeat & Heartbeat
Browse files Browse the repository at this point in the history
This is to enable plugin support, and to enable future support (during the
6.x cycle) for importing other C libraries.

Metricbeat & Packetbeat already had Cgo enabled. We're leaving Winlogbeat
without Cgo because we don't foresee a reason for it to need it.

This change also affects the community Beats, but they can revert to pure-go
by adding `CGO=false` in their Makefile.

Switch Cgo to be the default
  • Loading branch information
Tudor Golubenco committed Jun 26, 2017
1 parent eefdbd6 commit b49b7d7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ https://github.com/elastic/beats/compare/v6.0.0-alpha1...master[Check the HEAD d
- Load Ingest Node pipelines when the Elasticsearch connection is established, instead of only once at startup. {pull}4479[4479]
- Add support for loading Xpack Machine Learning configurations from the modules, and added sample configurations for the Nginx module. {pull}4506[4506]
- Add udp prospector type. {pull}4452[4452]
- Enabled Cgo which means libc is dynamically compiled. {pull}4546[4546]

*Heartbeat*

- Enabled Cgo which means libc is dynamically compiled. {pull}4546[4546]

*Metricbeat*
- Add random startup delay to each metricset to avoid the thundering herd problem. {issue}4010[4010]
- Add the ability to configure audit rules to the kernel module. {pull}4482[4482]
Expand Down
6 changes: 3 additions & 3 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ PYTHON_ENV?=${BUILD_DIR}/python-env
BUILDID?=$(shell git rev-parse HEAD) ## @Building The build ID
VIRTUALENV_PARAMS?=
INTEGRATION_TESTS?=
CGO?=false ## @building if true, Build with C Go support
FIND=. ${PYTHON_ENV}/bin/activate; find . -type f -not -path "*/vendor/*" -not -path "*/build/*" -not -path "*/.git/*"

# Cross compiling targets
TARGETS?="linux/amd64 linux/386 windows/amd64 windows/386 darwin/amd64" ## @building list of platforms/architecture to be built by "make package"
TARGETS_OLD?="" ## @building list of Debian6 architecture to be built by "make package" when CGO is true
CGO?=true ## @building if true, Build with C Go support
TARGETS?="windows/amd64 windows/386 darwin/amd64" ## @building list of platforms/architecture to be built by "make package"
TARGETS_OLD?="linux/amd64 linux/386" ## @building list of Debian6 architecture to be built by "make package" when CGO is true
PACKAGES?=${BEAT_NAME}/deb ${BEAT_NAME}/rpm ${BEAT_NAME}/darwin ${BEAT_NAME}/win ${BEAT_NAME}/bin ## @Building List of OS to be supported by "make package"
SNAPSHOT?=yes ## @Building If yes, builds a snapshot version
BEATS_BUILDER_IMAGE?=tudorg/beats-builder ## @Building Name of the docker image to use when packaging the application
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ TEST_ENVIRONMENT?=true
GOPACKAGES=$(shell go list ${BEAT_PATH}/... | grep -v /vendor/)
ES_BEATS?=..

TARGETS?="windows/amd64 windows/386 darwin/amd64"
TARGETS_OLD?="linux/amd64 linux/386"
CGO=true

# Metricbeat can only be cross-compiled on platforms not requiring CGO.
GOX_OS=solaris netbsd linux windows
GOX_FLAGS=-arch="amd64 386 arm ppc64 ppc64le"
Expand Down
3 changes: 0 additions & 3 deletions packetbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ BEAT_NAME?=packetbeat
BEAT_DESCRIPTION?=Packetbeat analyzes network traffic and sends the data to Elasticsearch.
SYSTEM_TESTS?=true
TEST_ENVIRONMENT=false
TARGETS="windows/amd64 windows/386 darwin/amd64"
TARGETS_OLD="linux/amd64 linux/386"
CGO=true
ES_BEATS?=..

include ${ES_BEATS}/libbeat/scripts/Makefile
Expand Down
2 changes: 2 additions & 0 deletions winlogbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ GOX_OS=windows
TARGETS="windows/amd64 windows/386"
PACKAGES=winlogbeat/win

CGO=false # don't need Cgo in Winlogbeat

include ../libbeat/scripts/Makefile

.PHONY: gen
Expand Down

0 comments on commit b49b7d7

Please sign in to comment.