Skip to content

fix: add missing FORMATS and LIBNAMES entries for musl platforms#33

Merged
ronaldtse merged 2 commits intomainfrom
fix/add-musl-platform-entries
Feb 14, 2026
Merged

fix: add missing FORMATS and LIBNAMES entries for musl platforms#33
ronaldtse merged 2 commits intomainfrom
fix/add-musl-platform-entries

Conversation

@ronaldtse
Copy link
Contributor

Summary

  • Add aarch64-linux-musl to FORMATS for binary verification
  • Add x86_64-linux-musl and aarch64-linux-musl to LIBNAMES
  • Refactor cross_compiler_env to use case/when (RuboCop)

Background

Issue #11 requested support for Alpine Linux on ARM64. Testing revealed that the existing aarch64-linux-musl gem already works on Alpine Linux because:

  1. Ruby on Alpine reports platform as aarch64-linux-musl (not aarch64-alpine-linux-musl)
  2. RubyGems handles platform normalization correctly

However, during investigation, I found that FORMATS and LIBNAMES were missing entries for musl platforms. Without these:

  • verify_lib would skip format verification for musl targets
  • lib_fullpath would return nil for musl targets

Testing

Verified on Alpine Linux ARM64 via Docker:

$ docker run --rm --platform linux/arm64 ruby:3.4-alpine sh -c "..."
Successfully installed ffi-libarchive-binary-0.5.0-aarch64-linux-musl
Archive created: true
SUCCESS: libarchive works on Alpine ARM64!

Closes #11

- Add aarch64-linux-musl to FORMATS for binary verification
- Add x86_64-linux-musl and aarch64-linux-musl to LIBNAMES

Without these entries, verify_lib would skip format verification and
lib_fullpath would return nil for musl targets.

Tested on Alpine Linux ARM64 - the existing aarch64-linux-musl gem
already works correctly due to RubyGems platform normalization.

Closes #11
@ronaldtse ronaldtse force-pushed the fix/add-musl-platform-entries branch from 3a63430 to a84c3da Compare February 13, 2026 10:58
Cache ports/ and tmp/ directories to speed up builds. The cache key is
based on platform and recipe file hashes, so changes to configuration
or build recipes will invalidate the cache.
@ronaldtse ronaldtse force-pushed the fix/add-musl-platform-entries branch from 0de90b5 to b1bc29d Compare February 14, 2026 03:41
@ronaldtse ronaldtse merged commit 8515d2d into main Feb 14, 2026
105 of 107 checks passed
@ronaldtse ronaldtse deleted the fix/add-musl-platform-entries branch February 14, 2026 10:52
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.

Build aarch64-alpine-linux-musl for Alpine Linux on arm64

1 participant