Skip to content

Instantly share code, notes, and snippets.

View aalkhodiry's full-sized avatar

Abdulrhman Alkhodiry aalkhodiry

View GitHub Profile
@aalkhodiry
aalkhodiry / cargo-zigbuild-musl-cross-compile.md
Created February 16, 2026 17:03
Cross-Compiling Rust to Static musl Binaries with cargo-zigbuild on GitHub Actions (amd64 + arm64)

Cross-Compiling Rust to Static musl Binaries with cargo-zigbuild on GitHub Actions

Build fully static amd64 + arm64 Linux binaries for Rust projects with vendored OpenSSL and ring -- no flaky toolchain servers needed.

Why cargo-zigbuild?

Cross-compiling Rust to aarch64-unknown-linux-musl on x86_64 GitHub Actions runners is painful:

Approach Problem
@aalkhodiry
aalkhodiry / rust-aarch64-musl-cross-compile.md
Created February 16, 2026 16:28
Cross-Compiling Rust for aarch64-unknown-linux-musl on GitHub Actions (with vendored OpenSSL + ring)

Cross-Compiling Rust for aarch64-unknown-linux-musl on GitHub Actions

With vendored OpenSSL + ring (rustls) -- a complete working guide.

The Problem

Cross-compiling Rust projects targeting aarch64-unknown-linux-musl on x86_64 GitHub Actions runners fails when:

  1. Using gcc-aarch64-linux-gnu (glibc cross-compiler) with musl target -- vendored OpenSSL gets compiled against glibc headers, introducing symbols like __memcpy_chk, __memset_chk, __vfprintf_chk that don't exist in musl.
@aalkhodiry
aalkhodiry / hls.sh
Created November 8, 2024 23:05 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then