From ee3add69dc0448a8dc92e0cdd34ad0ce25f48600 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 27 Mar 2023 18:08:06 +0200 Subject: [PATCH] Stop crossbuilding using Debian 8 (#34921) The GPG keys are expired and we should start building for the more recent version of Debian. (cherry picked from commit 5e71fe7a7947b844013218a8fe02dce04a142bd9) --- dev-tools/mage/crossbuild.go | 4 +--- dev-tools/mage/pkgdeps.go | 2 +- filebeat/scripts/mage/build.go | 22 ++-------------------- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/dev-tools/mage/crossbuild.go b/dev-tools/mage/crossbuild.go index 8fcd1e2e6d1a..f500611e5cc9 100644 --- a/dev-tools/mage/crossbuild.go +++ b/dev-tools/mage/crossbuild.go @@ -241,9 +241,7 @@ func CrossBuildImage(platform string) (string, error) { case platform == "linux/s390x": tagSuffix = "s390x-debian10" case strings.HasPrefix(platform, "linux"): - // Use an older version of libc to gain greater OS compatibility. - // Debian 8 uses glibc 2.19. - tagSuffix = "main-debian8" + tagSuffix = "main-debian10" } goVersion, err := GoVersion() diff --git a/dev-tools/mage/pkgdeps.go b/dev-tools/mage/pkgdeps.go index 626cd833c92c..3b4598287700 100644 --- a/dev-tools/mage/pkgdeps.go +++ b/dev-tools/mage/pkgdeps.go @@ -121,7 +121,7 @@ func installDependencies(arch string, pkgs ...string) error { return err } - params := append([]string{"install", "-y", "--force-yes", + params := append([]string{"install", "-y", "--no-install-recommends", // Journalbeat is built with old versions of Debian that don't update diff --git a/filebeat/scripts/mage/build.go b/filebeat/scripts/mage/build.go index b7786d947c54..f8d3a5fe8e1b 100644 --- a/filebeat/scripts/mage/build.go +++ b/filebeat/scripts/mage/build.go @@ -18,8 +18,6 @@ package mage import ( - "strings" - "github.com/magefile/mage/mg" "go.uber.org/multierr" @@ -42,7 +40,7 @@ var ( ) // GolangCrossBuild builds the Beat binary inside the golang-builder and then -// checks the binaries GLIBC requirements for RHEL compatability. +// checks the binaries GLIBC requirements for RHEL compatibility. // Do not use directly, use crossBuild instead. func GolangCrossBuild() error { return multierr.Combine( @@ -65,21 +63,5 @@ func golangCrossBuild() error { // CrossBuild cross-builds the beat for all target platforms. func CrossBuild() error { - return devtools.CrossBuild(devtools.ImageSelector(func(platform string) (string, error) { - image, err := devtools.CrossBuildImage(platform) - if err != nil { - return "", err - } - // Normally linux/amd64 and linux/386 binaries are build using debian7 - // because it has an older glibc version that makes the binaries work on - // RHEL 6, but debian7 does not have the systemd libraries needed for - // the journald input. - // - // So use the debian8 image, but test the binary to ensure that the - // linked glibc version requirement is still compatible with RHEL6. - if platform == "linux/amd64" || platform == "linux/386" { - image = strings.ReplaceAll(image, "main-debian7", "main-debian8") - } - return image, nil - })) + return devtools.CrossBuild(devtools.ImageSelector(devtools.CrossBuildImage)) }