You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/03/18 09:21:07 UTC
[camel-k] branch master 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.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push:
new 33a02e7 fix: disable CGO when building on Fedora to avoid linking issues on the Ubuntu-based image (#2140)
33a02e7 is described below
commit 33a02e7d7807d9dab1d2187b01808081351343ee
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 53f5ae6..527613b 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -174,7 +174,13 @@ test-kamel-cli: build
#go test -timeout 60m -v ./e2e/common/cli -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:
./script/build_catalog.sh $(RUNTIME_VERSION) -Dcatalog.file=camel-catalog-$(RUNTIME_VERSION).yaml -Dcatalog.runtime=quarkus -Dstaging.repo="$(STAGING_RUNTIME_REPO)"