From ef4ac04b5d08991d6d2052af4d9500770fa1b746 Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Thu, 27 Aug 2020 09:47:16 -0400 Subject: [PATCH 1/3] [Build] Make mage-linux-amd64 statically compiled. When I've upgraded my arch system, they have upgraded the libc library, that libary is much newer than the library used in the crossbuild docker images. This made building beats impossible because the mage-linux-amd64 is compiled dynamically and used in all our docker build. This PR make the mage binary to be statically compiled so it doesn't rely on any installed libraries. --- CHANGELOG.next.asciidoc | 1 + dev-tools/mage/crossbuild.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 4c0e94732c9..3cd7491f9a8 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -20,6 +20,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Ensure dynamic template names are unique for the same field. {pull}18849[18849] - Remove the deprecated `xpack.monitoring.*` settings. Going forward only `monitoring.*` settings may be used. {issue}9424[9424] {pull}18608[18608] - Added `certificate` TLS verification mode to ignore server name mismatch. {issue}12283[12283] {pull}20293[20293] +- Make the mage binary used by the build process in the docker container to be statically compiled. {pull}xx[xxx] *Auditbeat* diff --git a/dev-tools/mage/crossbuild.go b/dev-tools/mage/crossbuild.go index 6a11f7666cd..22b0ae574df 100644 --- a/dev-tools/mage/crossbuild.go +++ b/dev-tools/mage/crossbuild.go @@ -173,7 +173,7 @@ func CrossBuildXPack(options ...CrossBuildOption) error { // values for Docker. It has the benefit of speeding up the build because the // mage -compile is done only once rather than in each Docker container. func buildMage() error { - return sh.Run("mage", "-f", "-goos=linux", "-goarch=amd64", + return sh.RunWith(map[string]string{"CGO_ENABLED": "0"}, "mage", "-f", "-goos=linux", "-goarch=amd64", "-compile", CreateDir(filepath.Join("build", "mage-linux-amd64"))) } From f9aa1fde35fac26b77be11a99209f51887547167 Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Thu, 27 Aug 2020 09:53:20 -0400 Subject: [PATCH 2/3] changelog # --- CHANGELOG.next.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 3cd7491f9a8..2bd9519d140 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -20,7 +20,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Ensure dynamic template names are unique for the same field. {pull}18849[18849] - Remove the deprecated `xpack.monitoring.*` settings. Going forward only `monitoring.*` settings may be used. {issue}9424[9424] {pull}18608[18608] - Added `certificate` TLS verification mode to ignore server name mismatch. {issue}12283[12283] {pull}20293[20293] -- Make the mage binary used by the build process in the docker container to be statically compiled. {pull}xx[xxx] +- Make the mage binary used by the build process in the docker container to be statically compiled. {pull}20827[20827] *Auditbeat* From 4a5085114831de032faafd7c1947d7e315a13d90 Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Thu, 27 Aug 2020 12:33:27 -0400 Subject: [PATCH 3/3] move to dev changelog --- CHANGELOG-developer.next.asciidoc | 1 + CHANGELOG.next.asciidoc | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG-developer.next.asciidoc b/CHANGELOG-developer.next.asciidoc index 29734e17fa8..cf02bc84960 100644 --- a/CHANGELOG-developer.next.asciidoc +++ b/CHANGELOG-developer.next.asciidoc @@ -101,3 +101,4 @@ The list below covers the major changes between 7.0.0-rc2 and master only. - Update Go version to 1.14.4. {pull}19753[19753] - Update Go version to 1.14.7. {pull}20508[20508] - Add packaging for docker image based on UBI minimal 8. {pull}20576[20576] +- Make the mage binary used by the build process in the docker container to be statically compiled. {pull}20827[20827] diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 2bd9519d140..4c0e94732c9 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -20,7 +20,6 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Ensure dynamic template names are unique for the same field. {pull}18849[18849] - Remove the deprecated `xpack.monitoring.*` settings. Going forward only `monitoring.*` settings may be used. {issue}9424[9424] {pull}18608[18608] - Added `certificate` TLS verification mode to ignore server name mismatch. {issue}12283[12283] {pull}20293[20293] -- Make the mage binary used by the build process in the docker container to be statically compiled. {pull}20827[20827] *Auditbeat*