Skip to content

[Do Not Merge]CHEF-36043: Enable macOS Habitat package build for aarch64-darwin#1079

Draft
sanghinitin wants to merge 1 commit into
mainfrom
CHEF-36043_mac_hab_pkg
Draft

[Do Not Merge]CHEF-36043: Enable macOS Habitat package build for aarch64-darwin#1079
sanghinitin wants to merge 1 commit into
mainfrom
CHEF-36043_mac_hab_pkg

Conversation

@sanghinitin

@sanghinitin sanghinitin commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
Summary: Updated habitat/aarch64-darwin/plan.sh to enable native Habitat package builds for macOS (aarch64-darwin) systems. The previous plan was copied from Chef Client and referenced non-existent scripts and build dependencies. This update aligns the Darwin plan with the proven cookstyle root Habitat plan while fixing critical build issues.



Jira: CHEF-34639



Changes:

  • Cookstyle-specific build flow: Replaced Chef Client-specific steps (chef-official-distribution, multiple gem binstubs, omnibus/chef-bin packages) with cookstyle-only packaging logic
  • Fixed directory context: Added proper cd to HAB_CACHE_SRC_PATH/$pkg_dirname in do_unpack(), do_build(), and do_install() phases to work within Habitat cache instead of accessing host filesystem
  • Native extension support: Added core/clang compiler and autotools (core/autoconf, core/automake, core/libtool, core/pkg-config) build dependencies, with CC/CXX environment exports for gem compilation (e.g., prism native extension)
  • RubyGems isolation: Hardened do_install() phase by setting HOME and GEM_SPEC_CACHE to writable Habitat locations, and using gem install --local --ignore-dependencies to prevent access to host filesystem paths
  • Bundle configuration: Configured Bundler to exclude non-essential gem groups and build cookstyle.gemspec during build phase
  • Cleanup: Preserved cleanup logic to remove .github directories and stray Gemfile.lock files from vendored gems


Testing Performed:

  • Validated shell syntax with bash -n on updated plan.sh
  • Successfully resolved bundler gemspec loading errors by clearing cache and reinstalling dependencies
  • Verified native gem compilation support (prism gem) works with clang toolchain
  • Tested RubyGems isolation to prevent host filesystem access errors during Habitat build
  • Build phases now proceed past dependency installation and reach gem binstub generation


Files Modified:

  • habitat/aarch64-darwin/plan.sh (updated from Chef Client template to cookstyle-native macOS build plan)


Evidence:

  • Plan syntax validated: bash -n habitat/aarch64-darwin/plan.sh ✓
  • Build progresses successfully through dependency resolution, gem building, and binstub generation phases
  • Native extensions (prism 1.9.0) compile with clang without errors
  • Habitat cache directory isolation prevents /Users filesystem access errors

Signed-off-by: nitin sanghi <nsanghi@progress.com>
@sanghinitin sanghinitin requested review from a team and jaymzh as code owners June 22, 2026 10:29
@sanghinitin sanghinitin changed the title CHEF-36043: Enable macOS Habitat package build for aarch64-darwin [Do Not Merge]CHEF-36043: Enable macOS Habitat package build for aarch64-darwin Jun 22, 2026
@sanghinitin sanghinitin marked this pull request as draft June 23, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant