Skip to content

Add macOS Apple Silicon (M1/M2/M3) Support #681

@sangwaboi

Description

@sangwaboi

Expected Behavior

Hyperledger Cello should build and run correctly on macOS with Apple Silicon (M1/M2/M3) processors using the standard setup instructions.

Current Behavior

The build process fails on Apple Silicon Macs with architecture-related errors. Services fail to start properly due to platform compatibility issues between ARM64 architecture and the default amd64/x86_64 Docker images.

Possible Solution

Implement architecture-specific configurations and build options to properly support ARM64-based systems. This includes modifying Docker configurations to specify platform requirements and creating ARM64-specific Dockerfiles where needed.-

Steps to Reproduce

  1. Clone the Hyperledger Cello repository on a Mac with Apple Silicon
  2. Follow standard setup instructions in the documentation
  3. Run make docker to build images
  4. Execute make start to start the services
  5. Observe platform/architecture-related errors in the logs

Context (Environment)

  • OS: macOS Ventura/Sonoma (13.x/14.x)
  • Architecture: arm64 (Apple Silicon)
  • Docker version: 24.0.6
  • Docker compose version: v2.23.0-desktop.1
  • Kubernetes version: N/A (using Docker Compose)

Detailed Description and log

When attempting to set up Hyperledger Cello on Apple Silicon Macs, multiple architecture compatibility issues arise:

  1. Image Build Failures:
    failed to solve: process "/bin/sh -c apt-get update && apt-get install -y ..." did not complete successfully: exit code: 1
  2. Runtime Platform Errors:
    standard_init_linux.go:228: exec user process caused: exec format error
  3. Application Crashes:
    Illegal instruction: 4
    These errors occur because the current Docker images are built for amd64/x86_64 architecture and run through Rosetta 2 emulation on Apple Silicon, causing compatibility issues.

Possible Implementation

Our implementation adds ARM64 support through separate configuration files that won't affect existing AMD64 users:

  1. Architecture-specific Docker Files:
  • Create docker-compose.arm64.yml with platform specifications
  • Add Dockerfile.arm64 variants for services requiring ARM64-specific builds
  1. Dedicated Build Process:
  • Implement build_arm64.sh script for Apple Silicon users
  • Add architecture detection to suggest correct commands based on CPU
  1. Documentation:
  • Add a dedicated "Apple Silicon Setup" section to the documentation
  • Create clear guides for macOS users without changing instructions for other platforms

This approach ensures:

  1. No disruption to existing AMD64/x86_64 users
  2. Clean path for Apple Silicon users
  3. Easy maintenance as each architecture has isolated configuration files

With the growing adoption of Apple Silicon in the developer community, this addition will remove a significant barrier to entry for macOS users wanting to contribute to Hyperledger Cello.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions