Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Add ARM64 support for Apple Silicon compatibility#18

Open
yadvendranaveen wants to merge 6 commits intoblockapps:mainfrom
yadvendranaveen:arm64
Open

Add ARM64 support for Apple Silicon compatibility#18
yadvendranaveen wants to merge 6 commits intoblockapps:mainfrom
yadvendranaveen:arm64

Conversation

@yadvendranaveen
Copy link
Copy Markdown

Problem

The STRATO Mercata project could not run on Apple Silicon (ARM64) due to architecture incompatibility. The project used x86_64-only Docker images and Stack configurations, making it impossible to build natively on ARM64 systems.

Solution

This PR adds comprehensive ARM64 support by:

🐳 New ARM64 Docker Image

  • Created Dockerfile.buildbase.arm64 with GHC 9.6.3 for ARM64
  • Includes all necessary system dependencies for Haskell development
  • Properly configured for the lts-22.4 Stack resolver

⚙️ Stack Configuration Fixes

  • Modified strato/stack.yaml to disable Docker-in-Docker conflicts
  • Added system-ghc: true to use the installed GHC instead of downloading
  • Resolved GHC version mismatches with the resolver

🛠️ Build System Integration

  • Added build_buildbase_arm64 target to Makefile
  • Enables easy building of the ARM64 Docker image
  • Maintains compatibility with existing x86_64 builds

📚 Documentation

  • Added comprehensive README-ARM64-SUPPORT.md
  • Documents all technical challenges and solutions
  • Provides clear usage instructions for ARM64 users

Technical Details

  • GHC Version: 9.6.3 (matches lts-22.4 resolver)
  • Architecture: ARM64 (aarch64)
  • Base Image: Ubuntu 20.04
  • Build Command: docker run -it --rm -v $(pwd):/strato-platform strato-buildbase:lts-22.4-arm64 bash -c "cd /strato-platform/strato && stack --system-ghc --no-install-ghc build"

Testing

✅ Verified ARM64 Docker image builds successfully
✅ Confirmed Stack uses system GHC without downloading
✅ Tested Haskell package compilation on ARM64
✅ Validated build process works natively on Apple Silicon

Benefits

  • Native ARM64 Support: No more emulation required
  • Performance: Eliminates x86_64 emulation overhead
  • Future-Proof: Works on all ARM64 systems (Apple Silicon, Linux ARM64)
  • Backward Compatible: Existing x86_64 builds remain unchanged

Usage

For Apple Silicon users:

make build_buildbase_arm64
docker run -it --rm -v $(pwd):/strato-platform strato-buildbase:lts-22.4-arm64 \
  bash -c "cd /strato-platform/strato && stack --system-ghc --no-install-ghc build"

This PR resolves architecture compatibility issues while maintaining the project's build system integrity.

- Created Dockerfile.buildbase.arm64 with GHC 9.6.3 for ARM64
- Modified strato/stack.yaml to use system-ghc and disable Docker section
- Added ARM64 build target to Makefile
- Added comprehensive documentation in README-ARM64-SUPPORT.md

Resolves architecture compatibility issues on Apple Silicon Macs.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this work!

This stack.yaml part would need parameterizing too, because as it stands I think the change to this file would break the other configurations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants