Soar is a Fast, Modern, Bloat-Free Distro-Independent Package Manager that Just Works
Supports Static Binaries, AppImages, and other Portable formats on any *Unix-based Distro
This repo, scrapes Go Packages from variety of sources & builds them as Statically Linked relocatable binaries for aarch64-Linux, loongarch64-Linux, riscv64-Linux & x86_64-Linux.
The build script uses Zig to compile the packages on Github Actions & then uploads the artifacts to ghcr.io using Oras.
All of which are downloadable & installable with soar by adding pkgforge-go as an external repo.
Blog: https://blog.pkgforge.dev/cross-compiling-10000-go-cli-packages-statically
- Must have a source published publicly, preferably
Github - Must be CLI (No library)
- Statically Linked
- CGO:
CGO_ENABLED=1 CGO_CFLAGS=-O2 -flto=auto -fPIE -fpie -static -w -pipe - Buildmode PIE:
-buildmode=pie - Stripped:
-extldflags -s -w -static-pie -Wl,--build-id=none - Updated: Packages older than last year i.e
date -d 'last year' '+%Y-01-01'are dropped. - Little/No Dependency on system libraries: Crates depending on system libraries will simply fail.
==> CC: zig cc -target ${target_triplet}
==> CGO_CFLAGS: -O2 -flto=auto -fPIE -fpie -static -w -pipe
==> CGO_ENABLED: 1
==> CXX: zig c++ -target ${target_triplet}
==> GOARCH: $(uname -m)
==> GOOS: linux
==> LDFLAGS: -s -w -buildid= -linkmode=external
==> EXT_LDFLAGS: -s -w -static-pie -Wl,--build-id=none
==> GO_TAGS: netgo,osusergo
==> GO_BUILD: go build -a -v -x -trimpath -buildmode="pie" -buildvcs="false"๐ค HOST_TRIPLET |
๐น GO_TARGET |
|---|---|
aarch64-Linux |
linux/arm64 |
loongarch64-Linux |
linux/loong64 |
riscv64-Linux |
linux/riscv64 |
x86_64-Linux |
linux/amd64 |
Note
- โน๏ธ It is usual for most workflow run to
failsince it's rare a package builds for ALLhosts - ๐๏ธ Table of Packages (Sorted by Rank): https://github.com/pkgforge-go/builder/blob/main/data/PKG_INFO.md
- ๐ List of Packages (Tried Building): https://github.com/pkgforge-go/builder/blob/main/data/QUEUE_LIST.txt
- ๐ List of Packages (Actually Built): https://github.com/pkgforge-go/builder/blob/main/data/CACHE_LIST.txt
- A single Package may provide several
executables, i.e they are counted individually perhost
| Source ๐๏ธ | Total Packages ๐ฆ |
|---|---|
๐น Packages (Total Scraped) |
|
๐น Packages (CLI Only) |
|
๐น Packages (Built) |
|
๐น Packages (Queued) |
|
๐น Packages (aarch64-Linux) |
|
๐น Packages (loongarch64-Linux) |
|
๐น Packages (riscv64-Linux) |
|
๐น Packages (x86_64-Linux) |
|
๐น Packages (Success Rate) |
% |
๐น Packages (Total Built) |
- Package Sources are recorded & embedded in metadata.
- CI/CD run on Github Actions
- Build Logs are viewable using
soar log ${PKG_NAME} - Build Src is downloadable by downloading:
{GHCR_PKG}-srcbuild-${BUILD_ID} - Artifact Attestation & Build Provenance are created/updated per build.
graph TD
A[Scraper] -->|PKGS_LIST| B[PKGS_DUMP.json]
B --> C[GitHub Repository<br/>pkgforge-go/builder]
C --> D[Build Script<br/>builder.sh]
D --> E[Go+Zig]
E --> F1[aarch64-Linux<br/>Static Binary]
E --> F2[loongarch64-Linux<br/>Static Binary]
E --> F3[riscv64-Linux<br/>Static Binary]
E --> F4[x86_64-Linux<br/>Static Binary]
F1 --> G[GitHub Actions<br/>Build Pipeline]
F2 --> G
F3 --> G
F4 --> G
G --> H[Oras Tool]
H --> I[ghcr.io<br/>Container Registry]
I --> J[External Repository<br/>pkgforge-go]
J --> K[Soar Package Manager]
K --> L[End Users]
style A fill:#ff6b6b,stroke:#333,stroke-width:2px,color:#fff
style I fill:#4ecdc4,stroke:#333,stroke-width:2px,color:#fff
style K fill:#45b7d1,stroke:#333,stroke-width:2px,color:#fff
style L fill:#96ceb4,stroke:#333,stroke-width:2px,color:#fff
classDef buildProcess fill:#ffd93d,stroke:#333,stroke-width:2px
class D,E,G,H buildProcess
classDef binary fill:#ff8fab,stroke:#333,stroke-width:2px,color:#fff
class F1,F2,F3,F4 binary
