From fd6e244416e493ac300fa9d72e8e6d00ee1c5593 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 12 Jun 2023 19:38:33 +0200 Subject: [PATCH 1/4] enable debian 12 --- .github/release-drafter.yml | 1 + Jenkinsfile | 12 +++++++++++- Makefile | 6 ++++-- README.md | 1 + go/Makefile.debian12 | 14 ++++++++++++++ go/base/sources-debian12.list | 3 +++ 6 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 go/Makefile.debian12 create mode 100644 go/base/sources-debian12.list diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index e419fd02..71524bb9 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -44,6 +44,7 @@ template: | - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian9` - linux/i386, linux/amd64, windows/386, windows/amd64 - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian10` - linux/i386, linux/amd64, windows/386, windows/amd64 - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian11` - linux/i386, linux/amd64, windows/386, windows/amd64 + - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-main-debian12` - linux/i386, linux/amd64, windows/386, windows/amd64 - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-mips` - linux/mips64, linux/mips64el - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-mips32` - linux/mips, linux/mipsle - `docker.elastic.co/beats-dev/golang-crossbuild:$RESOLVED_VERSION-ppc` - linux/ppc64, linux/ppc64le diff --git a/Jenkinsfile b/Jenkinsfile index a70f7e1b..1f8015aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,7 @@ pipeline { axes { axis { name 'MAKEFILE' - values 'Makefile', 'Makefile.debian7', 'Makefile.debian8', 'Makefile.debian9', 'Makefile.debian10', 'Makefile.debian11' + values 'Makefile', 'Makefile.debian7', 'Makefile.debian8', 'Makefile.debian9', 'Makefile.debian10', 'Makefile.debian11', 'Makefile.debian12' } axis { name 'PLATFORM' @@ -119,6 +119,16 @@ pipeline { values 'Makefile.debian11' } } + exclude { + axis { + name 'PLATFORM' + values 'arm' + } + axis { + name 'MAKEFILE' + values 'Makefile.debian12' + } + } } stages { stage('Staging') { diff --git a/Makefile b/Makefile index 773c5604..29cbf8d6 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,8 @@ build: $(MAKE) -C $(var) -f Makefile.debian8 $@ || echo '1' > ${status}; \ $(MAKE) -C $(var) -f Makefile.debian9 $@ || echo '1' > ${status}; \ $(MAKE) -C $(var) -f Makefile.debian10 $@ || echo '1' > ${status}; \ - $(MAKE) -C $(var) -f Makefile.debian11 $@ || echo '1' > ${status}) + $(MAKE) -C $(var) -f Makefile.debian11 $@ || echo '1' > ${status}; \ + $(MAKE) -C $(var) -f Makefile.debian12 $@ || echo '1' > ${status}) @make -C fpm $@ || echo '1' > ${status} exit $$(cat ${status}) @@ -36,7 +37,8 @@ push: $(MAKE) -C $(var) -f Makefile.debian8 $@ || echo '1' > ${status}; \ $(MAKE) -C $(var) -f Makefile.debian9 $@ || echo '1' > ${status}; \ $(MAKE) -C $(var) -f Makefile.debian10 $@ || echo '1' > ${status}; \ - $(MAKE) -C $(var) -f Makefile.debian11 $@ || echo '1' > ${status}) + $(MAKE) -C $(var) -f Makefile.debian11 $@ || echo '1' > ${status}; \ + $(MAKE) -C $(var) -f Makefile.debian12 $@ || echo '1' > ${status}) @make -C fpm $@ || echo '1' > ${status} exit $$(cat ${status}) diff --git a/README.md b/README.md index 4024af5f..e87a91af 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Replace `` with the version you would like to use, for instance: - `docker.elastic.co/beats-dev/golang-crossbuild:-main-debian9` - linux/i386, linux/amd64, windows/386, windows/amd64 - `docker.elastic.co/beats-dev/golang-crossbuild:-main-debian10` - linux/i386, linux/amd64, windows/386, windows/amd64 - `docker.elastic.co/beats-dev/golang-crossbuild:-main-debian11` - linux/i386, linux/amd64, windows/386, windows/amd64 +- `docker.elastic.co/beats-dev/golang-crossbuild:-main-debian12` - linux/i386, linux/amd64, windows/386, windows/amd64 - `docker.elastic.co/beats-dev/golang-crossbuild:-mips` - linux/mips64, linux/mips64el - `docker.elastic.co/beats-dev/golang-crossbuild:-mips32` - linux/mips, linux/mipsle - `docker.elastic.co/beats-dev/golang-crossbuild:-ppc` - linux/ppc64, linux/ppc64le diff --git a/go/Makefile.debian12 b/go/Makefile.debian12 new file mode 100644 index 00000000..af003d66 --- /dev/null +++ b/go/Makefile.debian12 @@ -0,0 +1,14 @@ +IMAGES := base main darwin arm armhf armel mips ppc s390x darwin-arm64 npcap +DEBIAN_VERSION := 12 +TAG_EXTENSION := -debian12 + +export DEBIAN_VERSION TAG_EXTENSION + +build: + @$(foreach var,$(IMAGES),$(MAKE) -C $(var) build || exit 1;) + +# Requires login at https://docker.elastic.co:7000/. +push: + @$(foreach var,$(IMAGES),$(MAKE) -C $(var) push || exit 1;) + +.PHONY: build push diff --git a/go/base/sources-debian12.list b/go/base/sources-debian12.list new file mode 100644 index 00000000..0f5b46e8 --- /dev/null +++ b/go/base/sources-debian12.list @@ -0,0 +1,3 @@ +# see https://wiki.debian.org/CrossToolchains +deb http://deb.debian.org/debian bookworm main +deb http://deb.debian.org/debian-security/ bookworm-security main From e661152595792661f3e5e7e47c7bb69671e1a18f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Jun 2023 12:45:03 +0200 Subject: [PATCH 2/4] Add debian12 in the conditions --- go/arm/Dockerfile.tmpl | 4 ++-- go/armel/Dockerfile.tmpl | 2 +- go/armhf/Dockerfile.tmpl | 2 +- go/base/Dockerfile.tmpl | 2 +- go/darwin-arm64/Dockerfile.tmpl | 4 ++-- go/darwin/Dockerfile.tmpl | 10 +++++----- go/llvm-apple/Dockerfile.tmpl | 2 +- go/main/Dockerfile.tmpl | 2 +- go/mips/Dockerfile.tmpl | 2 +- go/mips32/Dockerfile.tmpl | 2 +- go/ppc/Dockerfile.tmpl | 2 +- go/s390x/Dockerfile.tmpl | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/go/arm/Dockerfile.tmpl b/go/arm/Dockerfile.tmpl index c18e29c7..b4a3ad6a 100644 --- a/go/arm/Dockerfile.tmpl +++ b/go/arm/Dockerfile.tmpl @@ -36,7 +36,7 @@ RUN apt install -y \ libsystemd-dev:arm64 libsystemd0:arm64 liblz4-1:arm64 {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:arm64 @@ -81,7 +81,7 @@ RUN apt install -y \ libsystemd-dev libsystemd0 liblz4-1 {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev diff --git a/go/armel/Dockerfile.tmpl b/go/armel/Dockerfile.tmpl index f3beb637..80f8100d 100644 --- a/go/armel/Dockerfile.tmpl +++ b/go/armel/Dockerfile.tmpl @@ -36,7 +36,7 @@ RUN apt install -y \ libsystemd-dev:armel libsystemd0:armel liblz4-1:armel {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:armel diff --git a/go/armhf/Dockerfile.tmpl b/go/armhf/Dockerfile.tmpl index 91ef2f80..aa088d1c 100644 --- a/go/armhf/Dockerfile.tmpl +++ b/go/armhf/Dockerfile.tmpl @@ -36,7 +36,7 @@ RUN apt install -y \ libsystemd-dev:armhf libsystemd0:armhf liblz4-1:armhf {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:armhf diff --git a/go/base/Dockerfile.tmpl b/go/base/Dockerfile.tmpl index a176ee26..f0f5c156 100644 --- a/go/base/Dockerfile.tmpl +++ b/go/base/Dockerfile.tmpl @@ -18,7 +18,7 @@ RUN apt-get -o Acquire::Check-Valid-Until=false update -y --no-install-recommend file \ flex \ bison \ -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} binutils-multiarch \ binutils-multiarch-dev \ python3-venv \ diff --git a/go/darwin-arm64/Dockerfile.tmpl b/go/darwin-arm64/Dockerfile.tmpl index 5673bda5..b7d359e4 100644 --- a/go/darwin-arm64/Dockerfile.tmpl +++ b/go/darwin-arm64/Dockerfile.tmpl @@ -1,7 +1,7 @@ ARG REPOSITORY ARG VERSION ARG TAG_EXTENSION='' -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} FROM --platform=linux/amd64 docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian{{ .DEBIAN_VERSION }}-amd64 AS build-llvm-apple-amd64 FROM --platform=linux/arm64 docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian{{ .DEBIAN_VERSION }}-arm64 AS build-llvm-apple-arm64 # workaround to https://github.com/moby/moby/issues/34482 @@ -14,7 +14,7 @@ RUN echo "Building ${TARGETARCH} on a ${BUILDARCH}" {{- end }} FROM ${REPOSITORY}/golang-crossbuild:${VERSION}-base${TAG_EXTENSION} -{{- if and (ne .DEBIAN_VERSION "10") (ne .DEBIAN_VERSION "11")}} +{{- if and (ne .DEBIAN_VERSION "10") (ne .DEBIAN_VERSION "11") (ne .DEBIAN_VERSION "12")}} RUN echo "This Docker image will work only with Debian >10" && exit 1 {{- end }} diff --git a/go/darwin/Dockerfile.tmpl b/go/darwin/Dockerfile.tmpl index cb92311a..6d221e88 100644 --- a/go/darwin/Dockerfile.tmpl +++ b/go/darwin/Dockerfile.tmpl @@ -2,7 +2,7 @@ ARG REPOSITORY ARG VERSION ARG TAG_EXTENSION='' -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} FROM --platform=linux/amd64 docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian{{ .DEBIAN_VERSION }}-amd64 AS build-llvm-apple-amd64 FROM --platform=linux/arm64 docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian{{ .DEBIAN_VERSION }}-arm64 AS build-llvm-apple-arm64 # workaround to https://github.com/moby/moby/issues/34482 @@ -22,7 +22,7 @@ RUN \ llvm \ cmake \ patch \ -{{- if and (ne .DEBIAN_VERSION "10") (ne .DEBIAN_VERSION "11")}} +{{- if and (ne .DEBIAN_VERSION "10") (ne .DEBIAN_VERSION "11") (ne .DEBIAN_VERSION "12") }} python \ {{- end }} libssl-dev \ @@ -32,7 +32,7 @@ RUN \ uuid-dev \ && rm -rf /var/lib/apt/lists/* -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12") }} ARG OSXCROSS_PATH=/usr/local/osxcross COPY --from=build-llvm-apple /osxcross.tar.gz /tmp/osxcross.tar.gz RUN tar -xzf /tmp/osxcross.tar.gz -C / \ @@ -66,7 +66,7 @@ RUN cd / \ && file helloWorld.x86_64 \ && file helloWorld.x86_64 | grep -c 'Mach-O 64-bit x86_64' -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} RUN cd / \ && oa64-clang helloWorld.c -o helloWorld.arm64 \ && file helloWorld.arm64 \ @@ -79,7 +79,7 @@ RUN cd / \ {{- end }} # MacOSX10.14 SDK does not have 32bits compiler -{{- if and (ne .DEBIAN_VERSION "10") (ne .DEBIAN_VERSION "11")}} +{{- if and (ne .DEBIAN_VERSION "10") (ne .DEBIAN_VERSION "11") (ne .DEBIAN_VERSION "12")}} RUN cd / \ && o32-clang helloWorld.c -o helloWorld.i368 \ && file helloWorld.i368 \ diff --git a/go/llvm-apple/Dockerfile.tmpl b/go/llvm-apple/Dockerfile.tmpl index e231ca8b..9c6304ea 100644 --- a/go/llvm-apple/Dockerfile.tmpl +++ b/go/llvm-apple/Dockerfile.tmpl @@ -20,7 +20,7 @@ RUN apt-get -o Acquire::Check-Valid-Until=false update -y --no-install-recommend libxml2-dev \ lzma-dev \ uuid-dev \ -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} binutils-multiarch \ binutils-multiarch-dev \ python3-venv \ diff --git a/go/main/Dockerfile.tmpl b/go/main/Dockerfile.tmpl index 123a0746..034e54bd 100644 --- a/go/main/Dockerfile.tmpl +++ b/go/main/Dockerfile.tmpl @@ -32,7 +32,7 @@ RUN apt install -y --no-install-recommends --allow-unauthenticated\ libsystemd-dev {{- end }} -{{- if or (eq .DEBIAN_VERSION "9") (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") }} +{{- if or (eq .DEBIAN_VERSION "9") (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # msitools RUN apt install -y --no-install-recommends --allow-unauthenticated\ msitools diff --git a/go/mips/Dockerfile.tmpl b/go/mips/Dockerfile.tmpl index 742c293a..c355de6e 100644 --- a/go/mips/Dockerfile.tmpl +++ b/go/mips/Dockerfile.tmpl @@ -43,7 +43,7 @@ RUN apt install -y \ # libsystemd-dev:mips64el libsystemd0:mips64el liblz4-1:mips64el {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:mips64el diff --git a/go/mips32/Dockerfile.tmpl b/go/mips32/Dockerfile.tmpl index da598a77..fc75d67d 100644 --- a/go/mips32/Dockerfile.tmpl +++ b/go/mips32/Dockerfile.tmpl @@ -41,7 +41,7 @@ RUN apt install -y \ # libsystemd-dev:mips libsystemd0:mips liblz4-1:mips {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:mips diff --git a/go/ppc/Dockerfile.tmpl b/go/ppc/Dockerfile.tmpl index 0013d71e..666c113a 100644 --- a/go/ppc/Dockerfile.tmpl +++ b/go/ppc/Dockerfile.tmpl @@ -37,7 +37,7 @@ RUN apt install -qq -y \ # libsystemd-dev:ppc64el libsystemd0:ppc64el liblz4-1:ppc64el {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:ppc64el diff --git a/go/s390x/Dockerfile.tmpl b/go/s390x/Dockerfile.tmpl index 1ed55879..1629d128 100644 --- a/go/s390x/Dockerfile.tmpl +++ b/go/s390x/Dockerfile.tmpl @@ -36,7 +36,7 @@ RUN apt install -qq -y \ # libsystemd-dev:s390x libsystemd0:s390x liblz4-1:s390x {{- end }} -{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11")}} +{{- if or (eq .DEBIAN_VERSION "10") (eq .DEBIAN_VERSION "11") (eq .DEBIAN_VERSION "12")}} # librpm-dev RUN apt install -y \ librpm-dev:s390x From 89082eccaf6053047e83cd446e8c292088472dfa Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Jun 2023 12:47:43 +0200 Subject: [PATCH 3/4] ci: enable debian 12 in the llvm apple --- .ci/llvm-apple.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/llvm-apple.groovy b/.ci/llvm-apple.groovy index 6883fd5a..0b316a68 100644 --- a/.ci/llvm-apple.groovy +++ b/.ci/llvm-apple.groovy @@ -64,7 +64,7 @@ pipeline { axes { axis { name 'DEBIAN_VERSION' - values '10', '11' + values '10', '11', '12' } axis { name 'AGENT_LABELS' From 71673bdff632868f3b73a79492caa001f8f16943 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 13 Jun 2023 17:59:29 +0200 Subject: [PATCH 4/4] fix issue regarding missing import see https://github.com/elastic/golang-crossbuild/pull/298\#issuecomment-1589596842 --- go/llvm-apple/Dockerfile.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/llvm-apple/Dockerfile.tmpl b/go/llvm-apple/Dockerfile.tmpl index 9c6304ea..3fac7e93 100644 --- a/go/llvm-apple/Dockerfile.tmpl +++ b/go/llvm-apple/Dockerfile.tmpl @@ -32,7 +32,7 @@ RUN apt-get -o Acquire::Check-Valid-Until=false update -y --no-install-recommend #https://www.llvm.org/docs/CMake.html #https://github.com/apple/llvm-project RUN mkdir -p /tmp/llvm-project && cd /tmp/llvm-project \ - && curl -sSL "https://github.com/apple/llvm-project/archive/refs/tags/swift-5.4.1-RELEASE.tar.gz" \ + && curl -sSL "https://github.com/apple/llvm-project/archive/refs/tags/swift-5.6.3-RELEASE.tar.gz" \ | tar -C /tmp/llvm-project --strip=1 -xzf - \ && mkdir build && cd build \ && cmake -DLLVM_ENABLE_PROJECTS="clang" \