Skip to content

Commit 90ec1f9

Browse files
committed
added support for loongarch64 ISA to the build pipeline
1 parent 3ff32fc commit 90ec1f9

File tree

5 files changed

+34
-11
lines changed

5 files changed

+34
-11
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ENV NIM_VERSION=${NIM_VERSION}
1919
ENV ZIG_VERSION=${ZIG_VERSION}
2020
ENV RISCSTAR_VERSION=${RISCSTAR_VERSION}
2121
ENV PATH="/home/vscode/riscv64-toolchain/bin:/home/vscode/nim-${NIM_VERSION}/bin:/home/vscode/.nimble/bin:/home/vscode/zig:${PATH}"
22+
ENV SHELL=/bin/zsh
2223

2324
# Install system dependencies
2425
# NOTE: musl-tools and musl-dev REMOVED - Zig provides musl
@@ -54,7 +55,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5455
entr \
5556
# Clean up
5657
&& apt-get clean \
57-
&& rm -rf /var/lib/apt/lists/*
58+
&& rm -rf /var/lib/apt/lists/* \
59+
# Use bash for /bin/sh (dash causes issues with some VS Code extensions)
60+
&& ln -sf /bin/bash /bin/sh
5861

5962
# Switch to vscode user for Nim/Zig installation
6063
USER vscode

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
target: powerpc64le-linux-musl
4242
nimcpu: "--cpu:powerpc64"
4343
march: "-mcpu=pwr8 -mtune=pwr9"
44+
- arch: loong64
45+
target: loongarch64-linux-musl
46+
nimcpu: "--cpu:loongarch64"
47+
march: "-march=loongarch64"
4448

4549
steps:
4650
- name: Checkout code

justfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ release: && _clean-cache
149149
aarch64) nimble releaseArm64 && cp bin/yabb-linux-arm64 bin/yabb ;;
150150
riscv64) nimble releaseRiscv64 && cp bin/yabb-linux-riscv64 bin/yabb ;;
151151
ppc64le) nimble releasePpc64le && cp bin/yabb-linux-ppc64le bin/yabb ;;
152+
loongarch64) nimble releaseLoong64 && cp bin/yabb-linux-loong64 bin/yabb ;;
152153
*) echo "Unsupported architecture: $ARCH" && exit 1 ;;
153154
esac
154155
echo "Release build: bin/yabb (musl static, optimised, stripped)"
@@ -182,8 +183,13 @@ build-ppc64le:
182183
@echo "Cross-compiling for PPC64LE..."
183184
nimble releasePpc64le
184185

185-
# Build all Linux architectures (amd64, arm64, riscv64, ppc64le)
186-
build-all: build-amd64 build-arm64 build-riscv64 build-ppc64le
186+
# Build for LoongArch64 Linux (static musl)
187+
build-loong64:
188+
@echo "Cross-compiling for LoongArch64..."
189+
nimble releaseLoong64
190+
191+
# Build all Linux architectures (amd64, arm64, riscv64, ppc64le, loong64)
192+
build-all: build-amd64 build-arm64 build-riscv64 build-ppc64le build-loong64
187193
@echo ""
188194
@echo "All architectures built:"
189195
@ls -lh bin/yabb-linux-* 2>/dev/null || echo "No binaries found"
@@ -372,12 +378,12 @@ watch-test:
372378
binary-info:
373379
@echo "Binary information:"
374380
@for bin in bin/yabb bin/yabb-linux-*; do \
375-
if [ -f "$$bin" ]; then \
381+
if [ -f "$bin" ]; then \
376382
echo ""; \
377-
echo "=== $$bin ==="; \
378-
file "$$bin"; \
379-
ls -lh "$$bin"; \
380-
ldd "$$bin" 2>&1 | head -3 || true; \
383+
echo "=== $bin ==="; \
384+
file "$bin"; \
385+
ls -lh "$bin"; \
386+
ldd "$bin" 2>&1 | head -3 || true; \
381387
fi; \
382388
done
383389
@if [ ! -f bin/yabb ] && [ ! -f bin/yabb-linux-amd64 ]; then \

scripts/install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# REQUIREMENTS:
1010
# Bash 5.2+
11-
# Linux (x86_64, aarch64, riscv64, or ppc64le)
11+
# Linux (x86_64, aarch64, riscv64, ppc64le, or loongarch64)
1212
# curl, tar, zstd, sha256sum
1313
#
1414
# USAGE:
@@ -119,6 +119,7 @@ declare -rA ARCH_MAP=(
119119
[aarch64]="arm64"
120120
[riscv64]="riscv64"
121121
[ppc64le]="ppc64le"
122+
[loongarch64]="loong64"
122123
)
123124

124125
#-------------------------------------------------------------------------------
@@ -865,7 +866,7 @@ USAGE:
865866
866867
DESCRIPTION:
867868
Download and install YABB (Yet Another BTRFS Backup) from GitHub releases.
868-
Automatically detects architecture (x86_64/aarch64/riscv64/ppc64le) and verifies checksums.
869+
Automatically detects architecture (x86_64/aarch64/riscv64/ppc64le/loongarch64) and verifies checksums.
869870
870871
INSTALLATION OPTIONS:
871872
-d, --dir PATH Install directory (default: ${DEFAULT_INSTALL_DIR})

yabb.nimble

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "0.4.7"
3+
version = "0.4.8"
44
author = "Aryan Ameri"
55
description = "Yet Another BTRFS Backup"
66
license = "MPL 2.0"
@@ -141,11 +141,20 @@ task releasePpc64le, "Build static binary for PowerPC 64-bit LE Linux":
141141
exec "llvm-strip -s bin/yabb-linux-ppc64le"
142142
echo "Built: bin/yabb-linux-ppc64le"
143143

144+
task releaseLoong64, "Build static binary for LoongArch64 Linux":
145+
exec "nim c " & releaseFlags & " " & zigccFlags & " " & "--cpu:loongarch64 " &
146+
"--passC:'-target loongarch64-linux-musl' " & "--passL:'-target loongarch64-linux-musl' " &
147+
"--passC:-march=loongarch64 " & ltoFlags &
148+
" -o:bin/yabb-linux-loong64 src/yabb.nim"
149+
exec "llvm-strip -s bin/yabb-linux-loong64"
150+
echo "Built: bin/yabb-linux-loong64"
151+
144152
task releaseAll, "Build static binaries for all Linux architectures":
145153
exec "nimble releaseAmd64"
146154
exec "nimble releaseArm64"
147155
exec "nimble releaseRiscv64"
148156
exec "nimble releasePpc64le"
157+
exec "nimble releaseLoong64"
149158
echo ""
150159
echo "All architectures built:"
151160
exec "ls -lh bin/yabb-linux-*"

0 commit comments

Comments
 (0)