You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2021/03/19 17:44:02 UTC

[camel-k] branch release-1.3.x updated: fix: disable CGO when building on Fedora to avoid linking issues on the Ubuntu-based image (#2140)

This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch release-1.3.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/release-1.3.x by this push:
     new 0aa9e98  fix: disable CGO when building on Fedora to avoid linking issues on the Ubuntu-based image (#2140)
0aa9e98 is described below

commit 0aa9e98a780604dbeaa768c590a769105475ad17
Author: Otavio Rodolfo Piske <op...@redhat.com>
AuthorDate: Tue Mar 16 18:12:17 2021 +0100

    fix: disable CGO when building on Fedora to avoid linking issues on the Ubuntu-based image (#2140)
---
 script/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/script/Makefile b/script/Makefile
index 444e347..3d91c2c 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -162,7 +162,13 @@ test-local: build
 	#go test -timeout 60m -v ./e2e/local -tags=integration
 
 build-kamel:
+# Ensure the binary is statically linked when building on Linux due to ABI changes in newer glibc 2.32, otherwise
+# it would not run on older versions. See https://github.com/apache/camel-k/pull/2141#issuecomment-800990117
+ifeq ($(shell uname -s 2>/dev/null || echo Unknown),Linux)
+	CGO_ENABLED=0 go build $(GOFLAGS) -o kamel ./cmd/kamel/*.go
+else
 	go build $(GOFLAGS) -o kamel ./cmd/kamel/*.go
+endif
 
 build-resources: bundle-kamelets
 	./script/build_catalog.sh $(RUNTIME_VERSION) -Dcatalog.file=camel-catalog-$(RUNTIME_VERSION).yaml -Dcatalog.runtime=quarkus -Dstaging.repo="$(STAGING_RUNTIME_REPO)"