Skip to content

Commit d05a125

Browse files
author
Binh Nguyen
committed
build(ci): add s390x native build, test, and release pipeline
- Add s390x.yml: native PR/push gate running unit tests on self-hosted [self-hosted, Linux, s390x] runners; catches big-endian issues that x86_64 CI cannot detect - Add build-s390x-native job in publish.yml: native build + unit tests on self-hosted s390x runner before packaging; shipped binary is the same one that was tested - Restore cross.yml to pristine upstream state by removing s390x-unknown-linux-gnu from the cross-compilation matrix - Fix publish.yml: replace upstream-only release-builder-linux runner with ubuntu-24.04 for build-linux-cross job - Wire build-s390x-native into all downstream publish jobs so s390x artifacts are included in checksums and GitHub releases - Bypass install-protoc.sh (no s390x binary) and mold (no s390x binary) in all s390x jobs; use apt protobuf-compiler instead
1 parent 6b0201a commit d05a125

7 files changed

Lines changed: 115 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136

137137
build-linux-cross:
138138
name: Build Vector for ${{ matrix.target }}
139-
runs-on: release-builder-linux
139+
runs-on: ubuntu-24.04
140140
timeout-minutes: 60
141141
needs: generate-publish-metadata
142142
env:
@@ -165,7 +165,7 @@ jobs:
165165
protoc: true
166166
libsasl2: true
167167
- name: Install cross-compilation tools
168-
run: sudo apt-get install -y binutils-arm-linux-gnueabihf binutils-aarch64-linux-gnu cmark-gfm
168+
run: sudo apt-get install -y binutils-arm-linux-gnueabihf binutils-aarch64-linux-gnu binutils-s390x-linux-gnu cmark-gfm
169169
- name: Install rpm
170170
if: endsWith(matrix.target, '-linux-gnu') || matrix.target == 'armv7-unknown-linux-gnueabihf'
171171
run: sudo apt-get install -y rpm
@@ -177,6 +177,45 @@ jobs:
177177
name: vector-${{ env.VECTOR_VERSION }}-${{ matrix.target }}
178178
path: target/artifacts/vector*
179179

180+
build-s390x-native:
181+
name: Build and test Vector for s390x-unknown-linux-gnu (native)
182+
runs-on: [self-hosted, Linux, s390x]
183+
timeout-minutes: 120
184+
needs: generate-publish-metadata
185+
env:
186+
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
187+
VECTOR_BUILD_DESC: ${{ needs.generate-publish-metadata.outputs.vector_build_desc }}
188+
CHANNEL: ${{ needs.generate-publish-metadata.outputs.vector_release_channel }}
189+
steps:
190+
- name: Checkout Vector
191+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
192+
with:
193+
ref: ${{ inputs.git_ref }}
194+
- name: Install system dependencies
195+
run: |
196+
sudo apt-get update
197+
sudo apt-get install -y --no-install-recommends \
198+
cmark-gfm \
199+
rpm \
200+
libsasl2-dev \
201+
protobuf-compiler
202+
- uses: ./.github/actions/setup
203+
with:
204+
rust: true
205+
cargo-nextest: true
206+
cargo-deb: true
207+
protoc: false
208+
vdev: false
209+
- name: Run unit tests
210+
run: make test FEATURES="default"
211+
- name: Build Vector
212+
run: make NATIVE=true package-s390x-unknown-linux-gnu-all
213+
- name: Stage package artifacts for publish
214+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
215+
with:
216+
name: vector-${{ env.VECTOR_VERSION }}-s390x-unknown-linux-gnu
217+
path: target/artifacts/vector*
218+
180219
build-apple-darwin-packages:
181220
name: Build Vector for ${{ matrix.architecture }}-apple-darwin (.tar.gz)
182221
runs-on: ${{ matrix.runner }}
@@ -279,6 +318,7 @@ jobs:
279318
- generate-publish-metadata
280319
- build-linux-gnu-native
281320
- build-linux-cross
321+
- build-s390x-native
282322
env:
283323
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
284324
DD_PKG_VERSION: "latest"
@@ -335,6 +375,7 @@ jobs:
335375
- generate-publish-metadata
336376
- build-linux-gnu-native
337377
- build-linux-cross
378+
- build-s390x-native
338379
env:
339380
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
340381
DD_PKG_VERSION: "latest"
@@ -430,6 +471,7 @@ jobs:
430471
- generate-publish-metadata
431472
- build-linux-gnu-native
432473
- build-linux-cross
474+
- build-s390x-native
433475
- deb-verify
434476
env:
435477
VECTOR_VERSION: ${{ needs.generate-publish-metadata.outputs.vector_version }}
@@ -489,6 +531,7 @@ jobs:
489531
- generate-publish-metadata
490532
- build-linux-gnu-native
491533
- build-linux-cross
534+
- build-s390x-native
492535
- build-apple-darwin-packages
493536
- build-x86_64-pc-windows-msvc-packages
494537
- deb-verify
@@ -531,6 +574,7 @@ jobs:
531574
- generate-publish-metadata
532575
- build-linux-gnu-native
533576
- build-linux-cross
577+
- build-s390x-native
534578
- build-apple-darwin-packages
535579
- build-x86_64-pc-windows-msvc-packages
536580
- deb-verify
@@ -566,6 +610,7 @@ jobs:
566610
- generate-publish-metadata
567611
- build-linux-gnu-native
568612
- build-linux-cross
613+
- build-s390x-native
569614
- build-apple-darwin-packages
570615
- build-x86_64-pc-windows-msvc-packages
571616
env:

.github/workflows/s390x.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: S390x CI
2+
3+
# Native unit test gate for s390x (big-endian). Catches endianness bugs that
4+
# x86_64-based CI cannot detect. Runs on every PR and master push.
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
12+
permissions:
13+
contents: read
14+
15+
env:
16+
CI: true
17+
DISABLE_MOLD: true # mold does not ship s390x binaries
18+
19+
jobs:
20+
test-s390x:
21+
name: Unit tests (s390x native)
22+
runs-on: [self-hosted, Linux, s390x]
23+
timeout-minutes: 60
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
27+
- name: Install system dependencies
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y --no-install-recommends \
31+
libsasl2-dev \
32+
protobuf-compiler
33+
34+
- uses: ./.github/actions/setup
35+
with:
36+
rust: true
37+
cargo-nextest: true
38+
protoc: false # upstream script has no s390x binary; use apt protobuf-compiler above
39+
vdev: false # no s390x vdev binary; not needed for testing
40+
41+
- name: Run unit tests
42+
run: make test FEATURES="default"

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ target-armv7-unknown-linux-gnueabihf = ["target-unix"]
580580
target-armv7-unknown-linux-musleabihf = ["target-base"]
581581
target-arm-unknown-linux-gnueabi = ["target-unix"]
582582
target-arm-unknown-linux-musleabi = ["target-base"]
583+
target-s390x-unknown-linux-gnu = ["target-unix"]
583584
target-x86_64-unknown-linux-gnu = ["target-unix", "vendored"]
584585
target-x86_64-unknown-linux-musl = ["target-unix"]
585586
# Apple targets opt into `gssapi` (dynamic linkage to system libsasl2 + Apple's

Cross.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ image = "vector-cross-env:arm-unknown-linux-gnueabi"
3535

3636
[target.arm-unknown-linux-musleabi]
3737
image = "vector-cross-env:arm-unknown-linux-musleabi"
38+
39+
[target.s390x-unknown-linux-gnu]
40+
image = "vector-cross-env:s390x-unknown-linux-gnu"

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ build-arm-unknown-linux-gnueabi: target/arm-unknown-linux-gnueabi/release/vector
124124
build-arm-unknown-linux-musleabi: target/arm-unknown-linux-musleabi/release/vector ## Build a release binary for the arm-unknown-linux-musleabi triple.
125125
@echo "Output to ${<}"
126126

127+
.PHONY: build-s390x-unknown-linux-gnu
128+
build-s390x-unknown-linux-gnu: target/s390x-unknown-linux-gnu/release/vector ## Build a release binary for the s390x-unknown-linux-gnu triple.
129+
@echo "Output to ${<}"
130+
127131
.PHONY: check-build-tools
128132
check-build-tools:
129133
ifeq ($(shell command -v cargo >/dev/null || echo not-found), not-found)
@@ -148,6 +152,7 @@ CROSS_DIGEST_armv7-unknown-linux-gnueabihf := sha256:73294ebb06e077e49bbbecfe8f
148152
CROSS_DIGEST_armv7-unknown-linux-musleabihf := sha256:49bdc9a4cf2f1bcb385389c85be8f43c4399fa6d6fe22883702ef13eb921e443
149153
CROSS_DIGEST_arm-unknown-linux-gnueabi := sha256:0c70b0e54724bd599dff00a2888f8ea176a5b6c85af47aad9ad25296f63e2967
150154
CROSS_DIGEST_arm-unknown-linux-musleabi := sha256:0ca8f4afcc29fb5964aa63e482452e8869311a610c5868f22ded400c4e483328
155+
CROSS_DIGEST_s390x-unknown-linux-gnu := sha256:7e1a5bac3f275881425146faf87b78b79ae60e49bcc86f198572501d41299265
151156

152157
# GNU Make < 3.82 pattern matching priority depends on the definition order
153158
# so cross-image-% must be defined before cross-%

Makefile.packaging

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ package-arm-unknown-linux-gnueabi-all: package-arm-unknown-linux-gnueabi package
6161
.PHONY: package-arm-unknown-linux-musleabi-all
6262
package-arm-unknown-linux-musleabi-all: package-arm-unknown-linux-musleabi # .tar.gz
6363

64+
.PHONY: package-s390x-unknown-linux-gnu-all
65+
package-s390x-unknown-linux-gnu-all: package-s390x-unknown-linux-gnu package-deb-s390x package-rpm-s390x # .tar.gz, .deb, .rpm
66+
6467
.PHONY: package-x86_64-unknown-linux-gnu
6568
package-x86_64-unknown-linux-gnu: target/artifacts/vector-${VERSION}-x86_64-unknown-linux-gnu.tar.gz ## Build an archive suitable for the `x86_64-unknown-linux-gnu` triple.
6669
@echo "Output to ${<}."
@@ -93,6 +96,10 @@ package-arm-unknown-linux-gnueabi: target/artifacts/vector-${VERSION}-arm-unknow
9396
package-arm-unknown-linux-musleabi: target/artifacts/vector-${VERSION}-arm-unknown-linux-musleabi.tar.gz ## Build an archive suitable for the `arm-unknown-linux-musleabi` triple.
9497
@echo "Output to ${<}."
9598

99+
.PHONY: package-s390x-unknown-linux-gnu
100+
package-s390x-unknown-linux-gnu: target/artifacts/vector-${VERSION}-s390x-unknown-linux-gnu.tar.gz ## Build an archive suitable for the `s390x-unknown-linux-gnu` triple.
101+
@echo "Output to ${<}."
102+
96103
# debs
97104

98105
.PHONY: package-deb-x86_64-unknown-linux-gnu
@@ -115,6 +122,10 @@ package-deb-armv7-gnu: package-armv7-unknown-linux-gnueabihf ## Build the armv7-
115122
package-deb-arm-gnu: package-arm-unknown-linux-gnueabi ## Build the arm-unknown-linux-gnueabi deb package
116123
TARGET=arm-unknown-linux-gnueabi $(VDEV) package deb
117124

125+
.PHONY: package-deb-s390x
126+
package-deb-s390x: package-s390x-unknown-linux-gnu ## Build the s390x-unknown-linux-gnu deb package
127+
TARGET=s390x-unknown-linux-gnu $(VDEV) package deb
128+
118129
# rpms
119130

120131
.PHONY: package-rpm-x86_64-unknown-linux-gnu
@@ -133,4 +144,8 @@ package-rpm-aarch64: package-aarch64-unknown-linux-gnu ## Build the aarch64 rpm
133144
package-rpm-armv7hl-gnu: package-armv7-unknown-linux-gnueabihf ## Build the armv7hl-unknown-linux-gnueabihf rpm package
134145
TARGET=armv7-unknown-linux-gnueabihf ARCH=armv7hl $(VDEV) package rpm
135146

147+
.PHONY: package-rpm-s390x
148+
package-rpm-s390x: package-s390x-unknown-linux-gnu ## Build the s390x-unknown-linux-gnu rpm package
149+
TARGET=s390x-unknown-linux-gnu $(VDEV) package rpm
150+
136151

scripts/build-docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ IFS=, read -ra REPO_LIST <<< "$REPOS"
2222

2323
IFS=, read -ra REQUESTED_PLATFORMS <<< "$PLATFORM"
2424
declare -A SUPPORTED_PLATFORMS=(
25-
[debian]="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8"
25+
[debian]="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/s390x"
2626
[alpine]="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8"
2727
[distroless-static]="linux/amd64,linux/arm/v7,linux/arm64/v8"
28-
[distroless-libc]="linux/amd64,linux/arm/v7,linux/arm64/v8"
28+
[distroless-libc]="linux/amd64,linux/arm/v7,linux/arm64/v8,linux/s390x"
2929
)
3030

3131
#

0 commit comments

Comments
 (0)