Skip to content
66 changes: 57 additions & 9 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ agent:
machine:
type: s1-prod-ubuntu24-04-arm64-00
execution_time_limit:
hours: 3
hours: 10

auto_cancel:
running:
Expand All @@ -16,6 +16,8 @@ global_job_config:
- checkout
- mkdir artifacts
- mkdir dest
- 'export SEMAPHORE_GIT_TAG_NAME="${SEMAPHORE_GIT_TAG_NAME:-${SEMAPHORE_WORKFLOW_ID}-s390x}"'
- 'echo "SEMAPHORE_GIT_TAG_NAME=${SEMAPHORE_GIT_TAG_NAME}"'
env_vars:
- name: CACHE_TAG
value: '7'
Expand Down Expand Up @@ -227,6 +229,51 @@ blocks:
- packaging/tools/build-release-artifacts.sh --disable-gssapi alpine:3.16.9 artifacts/librdkafka.tgz


- name: 'Linux s390x: release artifact docker builds'
dependencies: []
# run:
# when: "tag =~ '^v[0-9]\\.'"
task:
agent:
machine:
type: s1-prod-ubuntu24-04-amd64-1
prologue:
commands:
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
- docker run --privileged --rm tonistiigi/binfmt --install s390x
epilogue:
commands:
- '[[ -z $SEMAPHORE_GIT_TAG_NAME ]] || artifact push workflow artifacts/ --destination artifacts/${ARTIFACT_KEY}/'
jobs:
- name: 'Build: centos8 glibc +gssapi'
env_vars:
- name: ARTIFACT_KEY
value: p-librdkafka__plat-linux__dist-centos8__arch-s390x__lnk-std__extra-gssapi
commands:
- packaging/tools/build-release-artifacts.sh --platform linux/s390x quay.io/pypa/manylinux_2_28_s390x:2024.07.01-1 artifacts/librdkafka.tgz

- name: 'Build: centos8 glibc'
env_vars:
- name: ARTIFACT_KEY
value: p-librdkafka__plat-linux__dist-centos8__arch-s390x__lnk-all
commands:
- packaging/tools/build-release-artifacts.sh --disable-gssapi --platform linux/s390x quay.io/pypa/manylinux_2_28_s390x:2024.07.01-1 artifacts/librdkafka.tgz

# - name: 'Build: alpine musl +gssapi'
# env_vars:
# - name: ARTIFACT_KEY
# value: p-librdkafka__plat-linux__dist-alpine__arch-s390x__lnk-all__extra-gssapi
# commands:
# - packaging/tools/build-release-artifacts.sh --platform linux/s390x alpine:3.16.9 artifacts/librdkafka.tgz

# - name: 'Build: alpine musl'
# env_vars:
# - name: ARTIFACT_KEY
# value: p-librdkafka__plat-linux__dist-alpine__arch-s390x__lnk-all
# commands:
# - packaging/tools/build-release-artifacts.sh --disable-gssapi --platform linux/s390x alpine:3.16.9 artifacts/librdkafka.tgz


- name: 'Windows x64: MinGW-w64'
dependencies: []
run:
Expand Down Expand Up @@ -309,14 +356,15 @@ blocks:
- name: 'Packaging'
dependencies:
- 'Build documentation'
- 'OSX arm64/m1'
- 'OSX x64'
- 'Linux x64: release artifact docker builds'
- 'Linux arm64: release artifact docker builds'
- 'Windows x64: MinGW-w64'
- 'Windows x64: Windows SDK 10.0 / MSVC v142 / VS 2019'
run:
when: "tag =~ '^v[0-9]\\.'"
# - 'OSX arm64/m1'
# - 'OSX x64'
# - 'Linux x64: release artifact docker builds'
# - 'Linux arm64: release artifact docker builds'
- 'Linux s390x: release artifact docker builds'
# - 'Windows x64: MinGW-w64'
# - 'Windows x64: Windows SDK 10.0 / MSVC v142 / VS 2019'
# run:
# when: "tag =~ '^v[0-9]\\.'"
task:
agent:
machine:
Expand Down
17 changes: 17 additions & 0 deletions packaging/nuget/nugetpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ class NugetPackage (Package):
'./usr/local/lib/librdkafka.so.1',
'runtimes/linux-arm64/native/alpine-librdkafka.so'),

# Linux glibc centos8 s390x without GSSAPI (no external deps)
Mapping({'arch': 's390x',
'plat': 'linux',
'dist': 'centos8',
'lnk': 'all'},
'librdkafka.tgz',
'./usr/local/lib/librdkafka.so.1',
'runtimes/linux-s390x/native/librdkafka.so'),
# Linux musl alpine s390x without GSSAPI (no external deps)
# Mapping({'arch': 's390x',
# 'plat': 'linux',
# 'dist': 'alpine',
# 'lnk': 'all'},
# 'librdkafka.tgz',
# './usr/local/lib/librdkafka.so.1',
# 'runtimes/linux-s390x/native/alpine-librdkafka.so'),

# Common Win runtime
Mapping({'arch': 'x64',
'plat': 'win'},
Expand Down
36 changes: 36 additions & 0 deletions packaging/nuget/staticpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,42 @@ class StaticPackage (Package):
'./usr/local/lib/pkgconfig/rdkafka-static.pc',
'librdkafka_musl_linux_arm64.pc'),

# glibc linux s390x static lib and pkg-config file
Mapping({'arch': 's390x',
'plat': 'linux',
'dist': 'centos8',
'lnk': 'all',
'!extra': 'gssapi'},
'librdkafka.tgz',
'./usr/local/lib/librdkafka-static.a',
'librdkafka_glibc_linux_s390x.a'),
Mapping({'arch': 's390x',
'plat': 'linux',
'dist': 'centos8',
'lnk': 'all',
'!extra': 'gssapi'},
'librdkafka.tgz',
'./usr/local/lib/pkgconfig/rdkafka-static.pc',
'librdkafka_glibc_linux_s390x.pc'),

# musl linux s390x static lib and pkg-config file
# Mapping({'arch': 's390x',
# 'plat': 'linux',
# 'dist': 'alpine',
# 'lnk': 'all',
# '!extra': 'gssapi'},
# 'librdkafka.tgz',
# './usr/local/lib/librdkafka-static.a',
# 'librdkafka_musl_linux_s390x.a'),
# Mapping({'arch': 's390x',
# 'plat': 'linux',
# 'dist': 'alpine',
# 'lnk': 'all',
# '!extra': 'gssapi'},
# 'librdkafka.tgz',
# './usr/local/lib/pkgconfig/rdkafka-static.pc',
# 'librdkafka_musl_linux_s390x.pc'),

# osx x64 static lib and pkg-config file
Mapping({'arch': 'x64',
'plat': 'osx',
Expand Down
15 changes: 11 additions & 4 deletions packaging/tools/build-release-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
# alpine:3.16
# quay.io/pypa/manylinux_2_28_aarch64 (centos8)
# quay.io/pypa/manylinux_2_28_x86_64 (centos8)
# quay.io/pypa/manylinux_2_28_s390x (centos8, requires QEMU binfmt)
#
# Usage:
# packaging/tools/build-release-artifacts.sh [--disable-gssapi] <docker-image> <relative-output-tarball-path.tgz>
# packaging/tools/build-release-artifacts.sh [--disable-gssapi] [--platform <docker-platform>] <docker-image> <relative-output-tarball-path.tgz>
#
# The output path must be a relative path and inside the librdkafka directory
# structure.
Expand Down Expand Up @@ -42,20 +43,26 @@ else
disable_gssapi=""
fi

docker_platform=""
if [ "$1" = "--platform" ]; then
docker_platform="--platform=$2"
shift 2
fi

# Check if we're running on the host or the (docker) build target.
if [ "$1" = "--in-docker" -a $# -eq 2 ]; then
output="$2"
elif [ $# -eq 2 ]; then
docker_image="$1"
output="$2"
else
echo "Usage: $0 [--disable-gssapi] <manylinux-docker-image> <output-path.tgz>"
echo "Usage: $0 [--disable-gssapi] [--platform <docker-platform>] <manylinux-docker-image> <output-path.tgz>"
exit 1
fi

if [ -n "$docker_image" ]; then
# Running on the host, spin up the docker builder.
exec docker run -v "$PWD:/v" $docker_image /v/packaging/tools/build-release-artifacts.sh $disable_gssapi --in-docker "/v/$output"
exec docker run $docker_platform -v "$PWD:/v" $docker_image /v/packaging/tools/build-release-artifacts.sh $disable_gssapi --in-docker "/v/$output"
# Only reached on exec error
exit $?
fi
Expand All @@ -76,7 +83,7 @@ if grep -q alpine /etc/os-release 2>/dev/null ; then

else
# CentOS
yum install -y libstdc++-devel gcc gcc-c++ python3 git perl-IPC-Cmd perl-Pod-Html $extra_pkgs_rpm
yum install -y libstdc++-devel gcc gcc-c++ python3 git perl-IPC-Cmd perl-Pod-Html perl-bignum $extra_pkgs_rpm
fi


Expand Down