Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion auditbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"github.com/magefile/mage/mg"
"go.uber.org/multierr"

auditbeat "github.com/elastic/beats/v7/auditbeat/scripts/mage"
devtools "github.com/elastic/beats/v7/dev-tools/mage"
Expand Down Expand Up @@ -59,7 +60,10 @@ func Build() error {
// GolangCrossBuild build the Beat binary inside of the golang-builder.
// Do not use directly, use crossBuild instead.
func GolangCrossBuild() error {
return devtools.GolangCrossBuild(devtools.DefaultGolangCrossBuildArgs())
return multierr.Combine(
devtools.GolangCrossBuild(devtools.DefaultGolangCrossBuildArgs()),
devtools.TestLinuxForCentosGLIBC(),
)
}

// BuildGoDaemon builds the go-daemon binary (use crossBuildGoDaemon).
Expand Down
6 changes: 3 additions & 3 deletions dev-tools/mage/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ func TestPackages(options ...TestPackagesOption) error {
}

// TestLinuxForCentosGLIBC checks the GLIBC requirements of linux/amd64 and
// linux/386 binaries to ensure they meet the requirements for RHEL 6 which has
// glibc 2.12.
// linux/386 binaries to ensure they meet the requirements for RHEL 7 which has
// glibc 2.17.
func TestLinuxForCentosGLIBC() error {
switch Platform.Name {
case "linux/amd64", "linux/386":
return TestBinaryGLIBCVersion(filepath.Join("build/golang-crossbuild", BeatName+"-linux-"+Platform.GOARCH), "2.12")
return TestBinaryGLIBCVersion(filepath.Join("build/golang-crossbuild", BeatName+"-linux-"+Platform.GOARCH), "2.17")
default:
return nil
}
Expand Down
7 changes: 6 additions & 1 deletion packetbeat/scripts/mage/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package mage

import (
"go.uber.org/multierr"

devtools "github.com/elastic/beats/v7/dev-tools/mage"
)

Expand All @@ -34,7 +36,10 @@ func GolangCrossBuild() error {
params.Env["CGO_CFLAGS"] = flags
}

return devtools.GolangCrossBuild(params)
return multierr.Combine(
devtools.GolangCrossBuild(params),
devtools.TestLinuxForCentosGLIBC(),
)
}

// -----------------------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion x-pack/auditbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/magefile/mage/mg"
"go.uber.org/multierr"

auditbeat "github.com/elastic/beats/v7/auditbeat/scripts/mage"
devtools "github.com/elastic/beats/v7/dev-tools/mage"
Expand Down Expand Up @@ -46,7 +47,10 @@ func Build() error {
// GolangCrossBuild build the Beat binary inside of the golang-builder.
// Do not use directly, use crossBuild instead.
func GolangCrossBuild() error {
return devtools.GolangCrossBuild(devtools.DefaultGolangCrossBuildArgs())
return multierr.Combine(
devtools.GolangCrossBuild(devtools.DefaultGolangCrossBuildArgs()),
devtools.TestLinuxForCentosGLIBC(),
)
}

// CrossBuild cross-builds the beat for all target platforms.
Expand Down