Skip to content

CHEF-34737: Add Habitat plan for aarch64-darwin (macOS Apple Silicon)#105

Open
sanghinitin wants to merge 1 commit into
mainfrom
CHEF-34737-mac-hab-pkg
Open

CHEF-34737: Add Habitat plan for aarch64-darwin (macOS Apple Silicon)#105
sanghinitin wants to merge 1 commit into
mainfrom
CHEF-34737-mac-hab-pkg

Conversation

@sanghinitin

@sanghinitin sanghinitin commented Jun 26, 2026

Copy link
Copy Markdown

Summary

Adds a Habitat build plan for the aarch64-darwin target (macOS Apple Silicon), enabling native Habitat package builds for fauxhai on Apple Silicon Macs.

Jira Ticket

CHEF-34737

Changes

  • Added habitat/aarch64-darwin/plan.sh — a new Habitat plan targeting macOS aarch64

Key Differences from Linux plan.sh

AspectLinux planaarch64-darwin plan
Compilercore/gcccore/clang + core/cmake
Runtime depscore/coreutilscore/coreutils + core/libarchive
Dynamic linkerLD_LIBRARY_PATH (implicit)DYLD_LIBRARY_PATH (explicit in wrapper)
Binstub handlingDirect patchingPatch + verification + runtime wrapper script
Plan contextPLAN_CONTEXT/..PLAN_CONTEXT/../.. (nested one level deeper)

Testing Performed

  • Ran hab pkg build . on macOS aarch64 Habitat Studio
  • Verified plan loads without syntax errors (fixed quoting issues with sed and shell parsing)
  • Confirmed binstub patch injection succeeds
  • Confirmed the built package installs and the fauxhai binary executes correctly

Evidence of Fixes During Development

  • Fix 1: Changed sed -i '''''' (BSD syntax) to sed -i (GNU syntax) — Habitat Studio uses GNU sed from core/sed
  • Fix 2: Simplified sed regex pattern from /require ['''"''']rubygems['''"''']/ to /require "rubygems"/ to avoid shell quoting issues that caused EOF parsing errors

Files Modified

  • habitat/aarch64-darwin/plan.sh (new file)

Add habitat/aarch64-darwin/plan.sh to support building the fauxhai
Habitat package on macOS aarch64 (Apple Silicon).

Key changes from the Linux plan:
- Uses core/clang and core/cmake instead of core/gcc for native extensions
- Adds core/libarchive as a runtime dependency
- Sets CC/CXX to clang in do_prepare and do_build
- Uses DYLD_LIBRARY_PATH (macOS dynamic linker) in the wrapper script
- Creates a runtime wrapper script for the fauxhai binstub
- Adds binstub patch injection verification
- References PLAN_CONTEXT/../.. since plan is nested one level deeper

Signed-off-by: nitin sanghi <nsanghi@progress.com>
@sanghinitin sanghinitin requested review from a team and jaymzh as code owners June 26, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant