Skip to content

Commit 947a22f

Browse files
committed
Release v0.5.5
1 parent a767425 commit 947a22f

File tree

7 files changed

+184
-4
lines changed

7 files changed

+184
-4
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,21 @@ jobs:
104104
nimcpu: ""
105105
march: "-march=x86_64 -mno-avx -mno-avx2"
106106
toolchain: zig
107+
- arch: amd64_v4
108+
target: x86_64-linux-musl
109+
nimcpu: ""
110+
march: "-march=x86-64-v4 -mtune=znver4"
111+
toolchain: zig
107112
- arch: arm64
108113
target: aarch64-linux-musl
109114
nimcpu: "--cpu:arm64"
110115
march: "-march=armv8-a -mtune=cortex_a72"
111116
toolchain: zig
117+
- arch: arm64v9
118+
target: aarch64-linux-musl
119+
nimcpu: "--cpu:arm64"
120+
march: "-march=armv9-a+sve2 -mtune=neoverse_n2"
121+
toolchain: zig
112122
- arch: armhf
113123
target: arm-linux-musleabihf
114124
nimcpu: "--cpu:arm"
@@ -137,6 +147,16 @@ jobs:
137147
nimcpu: "--cpu:mips"
138148
march: "-mcpu=mips32r2"
139149
toolchain: zig
150+
- arch: i686
151+
target: x86-linux-musl
152+
nimcpu: "--cpu:i386"
153+
march: "-mcpu=pentium4"
154+
toolchain: zig
155+
- arch: i586
156+
target: x86-linux-musl
157+
nimcpu: "--cpu:i386"
158+
march: "-mcpu=i586"
159+
toolchain: zig
140160
- arch: armel
141161
nimcpu: "--cpu:arm"
142162
toolchain: bootlin

Install.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Installation Guide
77
REQUIREMENTS
88
------------
99
- Linux with BTRFS filesystems (source and destination must both be BTRFS)
10-
- Supported architectures (uname -m): x86_64, aarch64, armv7l, armv5l, riscv64, ppc64le, loongarch64, mips64, mips
11-
- Binary names (Debian dpkg naming): amd64, arm64, armhf, armel, riscv64, ppc64el, loong64, mips64el, mipsel
10+
- Supported architectures (uname -m): x86_64, i686, i586, i486, i386, aarch64, armv7l, armv5l, riscv64, ppc64le, loongarch64, mips64, mips
11+
- Binary names (Debian dpkg naming): amd64, amd64_v4, i686, i586, arm64, arm64v9, armhf, armel, riscv64, ppc64el, loong64, mips64el, mipsel
1212
- Root access (sudo) for backup operations
1313
- Bash 5.2 or newer (for automatic installer)
1414
- btrfs-progs 5.14 or newer

docs/cpu-requirements.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
| Binary | ISA | Required Extensions | ABI |
77
|--------|-----|---------------------|-----|
88
| `amd64` | x86-64 | SSE2 | SysV AMD64 |
9+
| `amd64_v4` | x86-64-v4 | AVX-512 (F, VL, BW, CD, DQ), AVX2, BMI2 | SysV AMD64 |
10+
| `i686` | Pentium 4 | SSE, SSE2, MMX | SysV i386 |
11+
| `i586` | Pentium | (none) | SysV i386 |
912
| `arm64` | ARMv8-A | FP, NEON | AAPCS64 |
13+
| `arm64v9` | ARMv9.0-A | FP, NEON, SVE2, MTE, BF16 | AAPCS64 |
1014
| `armhf` | ARMv7-A | VFPv3, NEON, Thumb-2 | EABI5 hard-float |
1115
| `armel` | ARMv5TEJ | Thumb | EABI5 soft-float |
1216
| `riscv64` | RV64I 2.1 | M 2.0, A 2.1, F 2.2, D 2.2, C 2.0, Zicsr 2.0, Zifencei 2.0, Zmmul 1.0, Zaamo 1.0, Zalrsc 1.0, Zca 1.0, Zcd 1.0 | LP64D |

docs/docker-test-environments.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ Docker images used to verify binary compatibility for each supported architectur
88
| Binary | Docker Image | OS | `uname -m` | `dpkg --print-architecture` |
99
|--------|--------------|----|-----------:|----------------------------:|
1010
| `amd64` | `debian:trixie` | Debian 13 (trixie) | `x86_64` | `amd64` |
11+
| `amd64_v4` | `debian:trixie` | Debian 13 (trixie) | `x86_64` | `amd64` |
12+
| `i686` | `i386/debian:trixie` | Debian 13 (trixie) | `x86_64`** | `i386` |
13+
| `i586` | `i386/debian:bookworm` | Debian 12 (bookworm) | `x86_64`** | `i386` |
1114
| `arm64` | `arm64v8/debian:trixie` | Debian 13 (trixie) | `aarch64` | `arm64` |
15+
| `arm64v9` | `arm64v8/debian:trixie` | Debian 13 (trixie) | `aarch64` | `arm64` |
1216
| `armhf` | `arm32v7/debian:trixie` | Debian 13 (trixie) | `armv7l` | `armhf` |
1317
| `armel` | `arm32v5/debian:latest` | Debian 13 (trixie) | `armv7l`* | `armel` |
1418
| `riscv64` | `riscv64/debian:trixie` | Debian 13 (trixie) | `riscv64` | `riscv64` |
@@ -18,3 +22,5 @@ Docker images used to verify binary compatibility for each supported architectur
1822
| `mipsel` | `aoqi/debian-mipsel:latest` | Debian 9 (stretch) | `mips` | `mipsel` |
1923

2024
\* QEMU user-mode emulation reports `armv7l` even for ARMv5 containers.
25+
26+
\*\* QEMU/Docker on amd64 host reports host architecture for 32-bit x86 containers.

justfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ release: && _clean-cache
158158
loongarch64) nimble releaseLoong64 && cp bin/yabb-linux-loong64 bin/yabb ;;
159159
mips64el) nimble releaseMips64el && cp bin/yabb-linux-mips64el bin/yabb ;;
160160
mipsel) nimble releaseMipsel && cp bin/yabb-linux-mipsel bin/yabb ;;
161+
i686) nimble releaseI686 && cp bin/yabb-linux-i686 bin/yabb ;;
162+
i586) nimble releaseI586 && cp bin/yabb-linux-i586 bin/yabb ;;
161163
*) echo "Unsupported architecture: $ARCH" && exit 1 ;;
162164
esac
163165
echo "Release build: bin/yabb (musl static, optimised, stripped)"
@@ -175,11 +177,21 @@ build-amd64:
175177
@echo "Cross-compiling for x86_64..."
176178
nimble releaseAmd64
177179

180+
# Build for x86_64-v4 Linux (Zen4 optimised, AVX-512)
181+
build-amd64_v4:
182+
@echo "Cross-compiling for x86_64-v4 (Zen4)..."
183+
nimble releaseAmd64V4
184+
178185
# Build for ARM64 Linux (static musl)
179186
build-arm64:
180187
@echo "Cross-compiling for ARM64..."
181188
nimble releaseArm64
182189

190+
# Build for ARM64v9 Linux (Neoverse N2 optimised, SVE2)
191+
build-arm64v9:
192+
@echo "Cross-compiling for ARM64v9 (Neoverse N2)..."
193+
nimble releaseArm64V9
194+
183195
# Build for ARMv7 Linux (static musl, hard-float, NEON - Debian armhf)
184196
# Note: Zig's musl requires NEON, so this won't run on NEON-less ARMv7 devices
185197
build-armhf:
@@ -220,9 +232,19 @@ build-mipsel:
220232
@echo "Cross-compiling for MIPS32EL (ALT Linux mipsel)..."
221233
nimble releaseMipsel
222234

235+
# Build for x86 32-bit Linux (i686/SSE2 - Debian i386 multiarch)
236+
build-i686:
237+
@echo "Cross-compiling for i686 (SSE2)..."
238+
nimble releaseI686
239+
240+
# Build for x86 32-bit Linux (i586/legacy - no SSE, no cmov)
241+
build-i586:
242+
@echo "Cross-compiling for i586 (legacy)..."
243+
nimble releaseI586
244+
223245
# Release binaries for all Linux architectures
224246
# Note: armel is CI-only (Bootlin toolchain not available locally)
225-
release-all: build-amd64 build-arm64 build-armhf build-riscv64 build-ppc64el build-loong64 build-mips64el build-mipsel
247+
release-all: build-amd64 build-amd64_v4 build-arm64 build-arm64v9 build-armhf build-riscv64 build-ppc64el build-loong64 build-mips64el build-mipsel build-i686 build-i586
226248
@echo ""
227249
@echo "All architectures built (armel is CI-only):"
228250
@ls -lh bin/yabb-linux-* 2>/dev/null || echo "No binaries found"

scripts/setup-yabb.sh

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ declare -rA ARCH_MAP=(
178178
[mips64]="mips64el" # uname -m on little-endian MIPS64
179179
[mipsel]="mipsel"
180180
[mips]="mipsel" # uname -m on little-endian MIPS32
181+
# 32-bit x86 - will be refined by detect_x86_binary()
182+
[i686]="x86_32"
183+
[i586]="x86_32"
184+
[i486]="x86_32"
185+
[i386]="x86_32"
181186
)
182187

183188
#-------------------------------------------------------------------------------
@@ -334,6 +339,59 @@ get_system_endianness() {
334339
fi
335340
}
336341

342+
#-------------------------------------------------------------------------------
343+
# x86 CPU Feature Detection
344+
#-------------------------------------------------------------------------------
345+
detect_x86_binary() {
346+
# Check for SSE2 support in /proc/cpuinfo flags
347+
# SSE2 is the deciding factor between i686 (pentium4) and i586 binaries
348+
# i686 binary: Pentium 4 baseline with SSE2, MMX, cmov
349+
# i586 binary: Original Pentium baseline, no SSE, no cmov
350+
if grep -qE "^flags[[:space:]]*:.*\bsse2\b" /proc/cpuinfo 2>/dev/null; then
351+
echo "i686"
352+
else
353+
echo "i586"
354+
fi
355+
}
356+
357+
#-------------------------------------------------------------------------------
358+
# x86_64 CPU Feature Detection (AVX-512 for v4)
359+
#-------------------------------------------------------------------------------
360+
detect_amd64_binary() {
361+
# Check for x86-64-v4 support (AVX-512 foundation extensions)
362+
# x86-64-v4 requires: AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL
363+
# amd64_v4 binary: Zen4/Ice Lake+ optimised with AVX-512
364+
# amd64 binary: Baseline x86_64 (maximum compatibility)
365+
local flags
366+
flags=$(grep -m1 "^flags" /proc/cpuinfo 2>/dev/null || echo "")
367+
if [[ ${flags} == *avx512f* ]] \
368+
&& [[ ${flags} == *avx512bw* ]] \
369+
&& [[ ${flags} == *avx512cd* ]] \
370+
&& [[ ${flags} == *avx512dq* ]] \
371+
&& [[ ${flags} == *avx512vl* ]]; then
372+
echo "amd64_v4"
373+
else
374+
echo "amd64"
375+
fi
376+
}
377+
378+
#-------------------------------------------------------------------------------
379+
# ARM64 CPU Feature Detection (SVE2 for v9)
380+
#-------------------------------------------------------------------------------
381+
detect_arm64_binary() {
382+
# Check for ARMv9 support (SVE2 is the key indicator)
383+
# ARMv9 requires: SVE2 (Scalable Vector Extension 2)
384+
# arm64v9 binary: Neoverse N2/Graviton 3+ optimised with SVE2
385+
# arm64 binary: Baseline ARMv8-A (maximum compatibility)
386+
local features
387+
features=$(grep -m1 "^Features" /proc/cpuinfo 2>/dev/null || echo "")
388+
if [[ ${features} == *sve2* ]]; then
389+
echo "arm64v9"
390+
else
391+
echo "arm64"
392+
fi
393+
}
394+
337395
# Dry-run aware execution
338396
execute() {
339397
if [[ ${DRY_RUN} == true ]]; then
@@ -826,6 +884,32 @@ detect_architecture() {
826884
local machine
827885
machine="$(uname -m)" || die "Failed to detect architecture" "${EXIT_GENERAL_ERROR}"
828886

887+
# Handle x86 specially - check CPU features to select optimal binary
888+
case "${machine}" in
889+
x86_64)
890+
ARCH=$(detect_amd64_binary)
891+
local feature_msg
892+
feature_msg=$([[ ${ARCH} == "amd64_v4" ]] && echo "AVX-512 detected" || echo "baseline")
893+
log_success "Architecture: ${machine} -> ${ARCH} (${feature_msg})"
894+
return 0
895+
;;
896+
aarch64)
897+
ARCH=$(detect_arm64_binary)
898+
local feature_msg
899+
feature_msg=$([[ ${ARCH} == "arm64v9" ]] && echo "SVE2 detected" || echo "baseline")
900+
log_success "Architecture: ${machine} -> ${ARCH} (${feature_msg})"
901+
return 0
902+
;;
903+
i?86)
904+
ARCH=$(detect_x86_binary)
905+
local feature_msg
906+
feature_msg=$([[ ${ARCH} == "i686" ]] && echo "SSE2 detected" || echo "legacy/no SSE2")
907+
log_success "Architecture: ${machine} -> ${ARCH} (${feature_msg})"
908+
return 0
909+
;;
910+
*) ;;
911+
esac
912+
829913
# Check for MIPS big-endian systems (uname reports same for BE and LE)
830914
if [[ ${machine} == mips64 || ${machine} == mips ]]; then
831915
local endianness
@@ -838,6 +922,14 @@ detect_architecture() {
838922

839923
if [[ -v ARCH_MAP[${machine}] ]]; then
840924
ARCH="${ARCH_MAP[${machine}]}"
925+
# Handle x86_32 placeholder (shouldn't reach here due to case above, but safety)
926+
if [[ ${ARCH} == "x86_32" ]]; then
927+
ARCH=$(detect_x86_binary)
928+
local feature_msg
929+
feature_msg=$([[ ${ARCH} == "i686" ]] && echo "SSE2 detected" || echo "legacy/no SSE2")
930+
log_success "Architecture: ${machine} -> ${ARCH} (${feature_msg})"
931+
return 0
932+
fi
841933
log_success "Architecture: ${machine} -> ${ARCH}"
842934
else
843935
die "Unsupported architecture: ${machine}. Supported: ${!ARCH_MAP[*]}" "${EXIT_UNSUPPORTED_ARCH}"

yabb.nimble

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Package
55

6-
version = "0.5.4"
6+
version = "0.5.5"
77
author = "Aryan Ameri"
88
description = "Yet Another BTRFS Backup"
99
license = "MPL 2.0"
@@ -115,13 +115,27 @@ task releaseAmd64, "Build static binary for x86_64 Linux":
115115
" -o:bin/yabb-linux-amd64 src/yabb.nim"
116116
echo "Built: bin/yabb-linux-amd64"
117117

118+
task releaseAmd64V4, "Build static binary for x86_64-v4 Linux (Zen4 optimised)":
119+
exec "nim c " & releaseFlags & " " & zigccFlags & " " &
120+
"--passC:'-target x86_64-linux-musl' " & "--passL:'-target x86_64-linux-musl' " &
121+
"--passC:-march=x86-64-v4 --passC:-mtune=znver4 " & ltoFlags &
122+
" -o:bin/yabb-linux-amd64_v4 src/yabb.nim"
123+
echo "Built: bin/yabb-linux-amd64_v4"
124+
118125
task releaseArm64, "Build static binary for ARM64 Linux":
119126
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:arm64 " &
120127
"--passC:'-target aarch64-linux-musl' " & "--passL:'-target aarch64-linux-musl' " &
121128
"--passC:-march=armv8-a --passC:-mtune=cortex_a72 " & ltoFlags &
122129
" -o:bin/yabb-linux-arm64 src/yabb.nim"
123130
echo "Built: bin/yabb-linux-arm64"
124131

132+
task releaseArm64V9, "Build static binary for ARM64v9 Linux (Neoverse N2 optimised)":
133+
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:arm64 " &
134+
"--passC:'-target aarch64-linux-musl' " & "--passL:'-target aarch64-linux-musl' " &
135+
"--passC:-march=armv9-a+sve2 --passC:-mtune=neoverse_n2 " & ltoFlags &
136+
" -o:bin/yabb-linux-arm64v9 src/yabb.nim"
137+
echo "Built: bin/yabb-linux-arm64v9"
138+
125139
task releaseArmhf, "Build static binary for ARMv7 Linux (armhf)":
126140
# Debian armhf: ARMv7-A + VFPv3 + Thumb-2 + NEON, hard-float EABI
127141
# Note: Zig's musl includes NEON-optimised routines, so NEON is unavoidable
@@ -196,15 +210,37 @@ task releaseMipsel, "Build static binary for MIPS32 LE Linux (ALT Linux mipsel)"
196210
" -o:bin/yabb-linux-mipsel src/yabb.nim"
197211
echo "Built: bin/yabb-linux-mipsel"
198212

213+
task releaseI686, "Build static binary for x86 32-bit Linux (i686/SSE2)":
214+
# Debian i386 multiarch: Pentium 4 baseline with SSE2
215+
# See: https://wiki.debian.org/i386
216+
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:i386 " &
217+
"--passC:'-target x86-linux-musl' " & "--passL:'-target x86-linux-musl' " &
218+
"--passC:-mcpu=pentium4 " & ltoFlags &
219+
" -o:bin/yabb-linux-i686 src/yabb.nim"
220+
echo "Built: bin/yabb-linux-i686"
221+
222+
task releaseI586, "Build static binary for x86 32-bit Linux (i586/legacy)":
223+
# Legacy i586: Pentium baseline, no SSE, no cmov
224+
# For older distros and hardware without SSE2
225+
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:i386 " &
226+
"--passC:'-target x86-linux-musl' " & "--passL:'-target x86-linux-musl' " &
227+
"--passC:-mcpu=i586 " & ltoFlags &
228+
" -o:bin/yabb-linux-i586 src/yabb.nim"
229+
echo "Built: bin/yabb-linux-i586"
230+
199231
task releaseAll, "Build static binaries for all Linux architectures":
200232
exec "nimble releaseAmd64"
233+
exec "nimble releaseAmd64V4"
201234
exec "nimble releaseArm64"
235+
exec "nimble releaseArm64V9"
202236
exec "nimble releaseArmhf"
203237
exec "nimble releaseRiscv64"
204238
exec "nimble releasePpc64el"
205239
exec "nimble releaseLoong64"
206240
exec "nimble releaseMips64el"
207241
exec "nimble releaseMipsel"
242+
exec "nimble releaseI686"
243+
exec "nimble releaseI586"
208244
echo ""
209245
echo "All architectures built:"
210246
exec "ls -lh bin/yabb-linux-*"

0 commit comments

Comments
 (0)