Skip to content

Conversation

@corylanou
Copy link
Collaborator

@corylanou corylanou commented Nov 26, 2025

Summary

  • Add VFS (SQLite loadable extension) builds to the release workflow
  • Build for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64
  • VFS artifacts uploaded to same GitHub release as main binaries

Changes

Makefile

Added platform-specific VFS build targets:

  • vfs-linux-amd64 - Native build on Linux x86_64
  • vfs-linux-arm64 - Cross-compile using gcc-aarch64-linux-gnu
  • vfs-darwin-amd64 - Native build on macOS Intel
  • vfs-darwin-arm64 - Native build on macOS Apple Silicon

.github/workflows/release.yml

Added two new jobs that run after GoReleaser:

  • vfs-build-linux - Matrix build for Linux (amd64, arm64)
  • vfs-build-darwin - Matrix build for macOS (amd64 on macos-13, arm64 on macos-14)

Both jobs:

  1. Wait for goreleaser job to complete
  2. Build VFS extension using Makefile targets
  3. Create tar.gz archive
  4. Upload to existing release via gh release upload --clobber

.goreleaser.yml

Updated release notes header to document VFS extension availability.

Artifact Naming

litestream-vfs-{version}-{os}-{arch}.tar.gz

Contents:

  • Linux: litestream-vfs-linux-{arch}.so
  • macOS: litestream-vfs-darwin-{arch}.dylib

Test Plan

  • Tested make vfs-darwin-arm64 locally - builds successfully
  • Tested make vfs-darwin-amd64 locally - cross-compile works
  • Linux builds will be verified in CI when a test release is created

Closes #863

corylanou and others added 5 commits November 26, 2025 14:50
Add VFS (SQLite loadable extension) builds to the release workflow for:
- linux/amd64 (native)
- linux/arm64 (cross-compiled)
- darwin/amd64 (native Intel)
- darwin/arm64 (native M1)

The VFS jobs run after GoReleaser completes and upload artifacts to the
same release. This makes VFS extensions available to users without
requiring manual compilation.

Closes #863

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Use ubuntu-20.04 for Linux builds (glibc 2.31) for broader compatibility
- Add smoke tests to verify .so/.dylib can be loaded by SQLite
- Fix release notes to use GoReleaser templating for version

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Generate SHA256 checksums for all VFS artifacts (.sha256 files)
- Add readelf validation for cross-compiled arm64 Linux builds
- Upload checksums alongside tarballs to release

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Set MACOSX_MIN_VERSION=11.0 to ensure VFS dylibs are compatible with
macOS Big Sur and later, rather than being locked to the CI runner's
macOS version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@corylanou
Copy link
Collaborator Author

Local Testing Instructions

To verify the VFS builds locally, you can build all 4 platforms:

macOS Builds (native)

# Build macOS Intel (x86_64)
make vfs-darwin-amd64

# Build macOS Apple Silicon (arm64)
make vfs-darwin-arm64

Linux Builds (via Docker)

# Build both Linux architectures in Docker
docker run --rm --platform linux/amd64 -v $(pwd):/src -w /src golang:1.25rc1 bash -c "
  apt-get update && apt-get install -y gcc-aarch64-linux-gnu &&
  make vfs-linux-amd64 &&
  make vfs-linux-arm64
"

Note: The --platform linux/amd64 flag is required on Apple Silicon Macs to ensure the container runs in x86_64 mode with proper cross-compilation support.

Verify Build Artifacts

# Check all built artifacts
ls -la dist/litestream-vfs-*
file dist/litestream-vfs-*.so dist/litestream-vfs-*.dylib

Expected output:

Platform File Type
Linux x86_64 litestream-vfs-linux-amd64.so ELF 64-bit LSB shared object, x86-64
Linux ARM64 litestream-vfs-linux-arm64.so ELF 64-bit LSB shared object, ARM aarch64
macOS Intel litestream-vfs-darwin-amd64.dylib Mach-O 64-bit x86_64
macOS Apple Silicon litestream-vfs-darwin-arm64.dylib Mach-O 64-bit arm64

Copy link
Owner

@benbjohnson benbjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That all looks good. The one change I'd make is to name the file in the tarball as litestream-vfs.so regardless of what platform it's built for.

Also, I think we should probably rename litestream-vfs.so to just litestream.so since the VFS is registered as "litestream" but we can do that in a separate PR.

Rename files inside tarballs to litestream-vfs.so (Linux) and
litestream-vfs.dylib (macOS) regardless of build architecture.
This provides a consistent filename for users regardless of platform.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add automated VFS builds to releases

3 participants