Skip to content

Add ARM64/Apple Silicon support #23

@saidatom

Description

@saidatom

Problem

The library only works on Linux x86-64 and fails on ARM64 systems including:

  • Apple Silicon Macs (M1/M2/M3/M4)
  • ARM-based Docker/DDEV containers
  • ARM64 Linux servers

Error

Failed to load publiccode-parser library

Root Cause

Only one binary is shipped: lib/libpubliccode-parser.so (x86-64 Linux)

The library needs binaries for:

  • Linux ARM64
  • macOS Intel (x86-64)
  • macOS Apple Silicon (ARM64)

Solution Needed

  1. Build binaries for all architectures in CI
  2. Update src/Parser.php to detect platform and load correct binary
  3. Ship all binaries with the package
  4. Update README to reflect multi-platform support

Files to Modify

  • Makefile - add cross-compilation targets
  • src/Parser.php:150-169 - add platform detection
  • .github/workflows/packagist.yml - build all architectures
  • README.md:13 - update supported platforms

Related

The Go library already supports cross-compilation, so this is mainly a build/distribution issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions