Skip to content

v0.6.6 - Ubuntu/glibc Migration

Choose a tag to compare

@tsouche tsouche released this 22 Jan 18:19
· 24 commits to main since this release

Major Migration: Alpine/musl Ubuntu/glibc

This release removes Alpine/musl support and migrates to native Ubuntu/glibc compilation due to Tokio runtime incompatibility with musl libc.


BREAKING CHANGES

  • Alpine/musl support removed: Tokio async runtime has fundamental incompatibility with musl causing segfaults
  • Build target changed: From \x86_64-unknown-linux-musl\ to \x86_64-unknown-linux-gnu\ (native glibc)
  • Deployment target changed: Staging/production environments must use Ubuntu 22.04 (not Alpine)

NEW FEATURES

Ubuntu Test Container

  • Purpose: Simulates hot-swap deployment workflow locally before NAS deployment
  • Base: Ubuntu 22.04 with minimal runtime dependencies (libssl3, curl, ca-certificates)
  • User: testuser (UID 1026, GID 110) matching staging/prod environments
  • Workflow: Copy binary to running container test restart

New Test Scripts

  • test-ubuntu.ps1: PowerShell version for Windows host testing
  • test-ubuntu.sh: Bash version for testing from inside dev container
  • Validates glibc compilation and hot-swap deployment workflow

IMPROVEMENTS

  • Simplified build process: No cross-compilation overhead, native glibc builds
  • Full Tokio support: All async features work correctly with glibc
  • Faster builds: No custom OpenSSL compilation needed
  • Better compatibility: Same libc as staging/prod ensures consistency

TECHNICAL DETAILS

  • Base image: \ souche/rust_dev_container:v0.6.6\
  • Test container: Ubuntu 22.04
  • Build target: \x86_64-unknown-linux-gnu\ (native, default)
  • Binary type: ~30MB dynamically linked with glibc (vs 28MB static musl)
  • Container size: ~60MB Ubuntu (vs ~30MB Alpine)

Removed Components

  • musl-tools and musl-gcc
  • Custom OpenSSL 3.0.13 musl compilation
  • musl environment variables (OPENSSL_*, PKG_CONFIG_ALLOW_CROSS)
  • x86_64-unknown-linux-musl target
  • Cargo musl configuration
  • Alpine test container

MIGRATION GUIDE

For Developers

Build command changes:
\\�ash

OLD (v0.6.5 and earlier)

cargo build --release --target x86_64-unknown-linux-musl

NEW (v0.6.6+)

cargo build --release # No target flag needed
\\

Testing changes:
\\powershell

OLD

.\test-alpine.ps1

NEW

.\test-ubuntu.ps1
\\

For Deployment

Dockerfile changes:
\\dockerfile

OLD - Alpine base

FROM alpine:3.19
RUN apk add --no-cache ca-certificates

NEW - Ubuntu base

FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
ca-certificates curl libssl3 && \
rm -rf /var/lib/apt/lists/*
\\

Runtime dependencies:

  • Alpine: \�pk add ca-certificates\
  • Ubuntu: \�pt-get install ca-certificates curl libssl3\

FILES CHANGED

  • Added: Dockerfile.ubuntu-dev, Dockerfile.ubuntu-test, test-ubuntu.ps1, test-ubuntu.sh
  • Removed: test-alpine.ps1, test-alpine.sh, original Dockerfile
  • Modified: All version references, CHANGELOG, README, deployment scripts

RELATED ISSUES

This migration resolves Tokio runtime segfaults (exit 139) on Alpine Linux with musl libc. The issue is well-documented in the Rust community as a fundamental incompatibility between Tokio's core runtime and musl.


DOCUMENTATION

Full documentation available: