Skip to content

feat: Add Habitat plan for macOS aarch64-darwin (Apple Silicon) - #1960

Merged
rishichawda merged 5 commits into
mainfrom
CHEF-34741-mac-hab-pkg
Jul 21, 2026
Merged

feat: Add Habitat plan for macOS aarch64-darwin (Apple Silicon)#1960
rishichawda merged 5 commits into
mainfrom
CHEF-34741-mac-hab-pkg

Conversation

@sanghinitin

@sanghinitin sanghinitin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Habitat package plan for macOS aarch64-darwin (Apple Silicon), enabling hab pkg build on ARM-based Macs.

Changes Made

  • Created habitat/aarch64-darwin/plan.sh — full Habitat plan for building ohai on macOS Apple Silicon
  • Uses core/clang instead of core/gcc for native gem compilation (gcc unavailable on aarch64-darwin)
  • Exports CC/CXX pointing to clang for native extension builds
  • Uses DYLD_LIBRARY_PATH (macOS) instead of LD_LIBRARY_PATH (Linux) in the runtime wrapper
  • Sets HOME and GEM_SPEC_CACHE to writable Habitat cache paths to avoid touching host user directories in Studio
  • Explicitly installs racc gem into the vendor directory — required at runtime by tomlrb (uses require "racc/parser") but not declared as a gem dependency; Ruby 3.4 bundles racc in its own gem path which is hidden by the wrapper GEM_PATH
  • Mirrors the existing Linux plan structure: appbundler binstubs, binstub_patch.rb injection, libexec wrapper pattern

Evidence / Validation

  • bash -n habitat/aarch64-darwin/plan.sh — syntax check passes
  • hab pkg build . — completed successfully on aarch64-darwin
  • hab pkg install results/*.hart — installed without errors
  • hab pkg exec sanghinitin/ohai ohai -v — returns correct version
  • hab pkg exec sanghinitin/ohai ohai — full system detection runs without LoadError
  • Verified racc/parser.rb LoadError resolved by explicit racc install in vendor

Root Cause of racc Issue

tomlrb internally does require "racc/parser" but does not declare racc as a gem dependency. In Ruby 3.4, racc is a bundled gem living in Ruby's own gem path. The ohai runtime wrapper sets GEM_PATH exclusively to the vendor directory, hiding Ruby's bundled gems. Explicitly installing racc into the vendor dir resolves this.

Related Issue

CHEF-34741

CHEF-34742

AI Assistance

This work was completed with AI assistance following Progress AI policies.

Signed-off-by: nitin sanghi <nsanghi@progress.com>
@sanghinitin
sanghinitin requested review from a team and jaymzh as code owners June 25, 2026 11:50
@sanghinitin sanghinitin self-assigned this Jun 25, 2026
@sanghinitin sanghinitin added the ai-assisted Work completed with AI assistance following Progress AI policies label Jun 25, 2026
Signed-off-by: nitin sanghi <nsanghi@progress.com>
@sanghinitin
sanghinitin force-pushed the CHEF-34741-mac-hab-pkg branch from 11f433c to 88ecc05 Compare July 3, 2026 07:52
@sanghinitin
sanghinitin marked this pull request as draft July 3, 2026 07:55
Signed-off-by: nitin sanghi <nsanghi@progress.com>
@sanghinitin
sanghinitin marked this pull request as ready for review July 16, 2026 10:12
Comment thread .github/workflows/habitat-build-darwin.yml
… they now use pull_request_target

Signed-off-by: nitin sanghi <nsanghi@progress.com>
@sanghinitin
sanghinitin force-pushed the CHEF-34741-mac-hab-pkg branch from 3f83fcd to ff54964 Compare July 20, 2026 06:11
Signed-off-by: nitin sanghi <nsanghi@progress.com>

@neha-p6 neha-p6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rishichawda rishichawda added the Expeditor: Skip All Used to skip all merge_actions. label Jul 21, 2026
@rishichawda
rishichawda merged commit f08ff1f into main Jul 21, 2026
75 of 78 checks passed
@rishichawda
rishichawda deleted the CHEF-34741-mac-hab-pkg branch July 21, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Work completed with AI assistance following Progress AI policies Expeditor: Skip All Used to skip all merge_actions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants