Skip to content

Commit

Permalink
enable Debian 12 and bump llvm version to swift-5.6.3 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jun 19, 2023
1 parent ff03545 commit 1274d03
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .ci/llvm-apple.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pipeline {
axes {
axis {
name 'DEBIAN_VERSION'
values '10', '11'
values '10', '11', '12'
}
axis {
name 'AGENT_LABELS'
Expand Down
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -119,6 +119,16 @@ pipeline {
values 'Makefile.debian11'
}
}
exclude {
axis {
name 'PLATFORM'
values 'arm'
}
axis {
name 'MAKEFILE'
values 'Makefile.debian12'
}
}
}
stages {
stage('Staging') {
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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})

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Replace `<GOLANG_VERSION>` with the version you would like to use, for instance:
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-main-debian9` - linux/i386, linux/amd64, windows/386, windows/amd64
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-main-debian10` - linux/i386, linux/amd64, windows/386, windows/amd64
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-main-debian11` - linux/i386, linux/amd64, windows/386, windows/amd64
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-main-debian12` - linux/i386, linux/amd64, windows/386, windows/amd64
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips` - linux/mips64, linux/mips64el
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-mips32` - linux/mips, linux/mipsle
- `docker.elastic.co/beats-dev/golang-crossbuild:<GOLANG_VERSION>-ppc` - linux/ppc64, linux/ppc64le
Expand Down
14 changes: 14 additions & 0 deletions go/Makefile.debian12
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions go/arm/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/armel/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/armhf/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/base/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions go/base/sources-debian12.list
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions go/darwin-arm64/Dockerfile.tmpl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }}

Expand Down
10 changes: 5 additions & 5 deletions go/darwin/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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 / \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions go/llvm-apple/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion go/main/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/mips/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/mips32/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/ppc/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/s390x/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1274d03

Please sign in to comment.