Skip to content

CHEF-37332: add Linux ARM Habitat validation in Expeditor pipeline - #193

Open
sanjain-progress wants to merge 5 commits into
mainfrom
sanjain/CHEF-37332/test_hab_pipeline
Open

CHEF-37332: add Linux ARM Habitat validation in Expeditor pipeline#193
sanjain-progress wants to merge 5 commits into
mainfrom
sanjain/CHEF-37332/test_hab_pipeline

Conversation

@sanjain-progress

@sanjain-progress sanjain-progress commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Linux ARM64 (aarch64) Habitat build validation to the Knife Expeditor/Buildkite pipeline, and fixes the Habitat plan to build correctly when invoked from the new ARM target directory.

What Changed

  • Added a new ":linux: Arm64 Validate Habitat Builds of Knife" step to .expeditor/habitat-test.pipeline.yml
    • Runs on Buildkite queue default-privileged-aarch64
    • Uses the docker#v3.5.0 plugin with image ruby:3.4.2-bullseye, privileged: true, propagate-environment: true
    • Sets BUILD_PKG_TARGET: "aarch64-linux"
    • Keeps HAB_AUTH_TOKEN propagated via the environment, consistent with the existing Linux/Windows steps
  • Introduced habitat/aarch64-linux/plan.sh, sourcing the existing habitat/plan.sh to reuse the default Linux build logic for aarch64 (ARM) targets
  • Fixed habitat/plan.sh so the build works correctly regardless of which directory depth the plan is invoked from (habitat/ for the default target vs. habitat/aarch64-linux/ for the new ARM target):
    • pkg_version() now reads $SRC_PATH/VERSION instead of the relative ../VERSION, which resolved to the wrong file when invoked from the ARM plan
    • Added a _repo_root() helper that resolves the repository root via git rev-parse --show-toplevel
    • do_unpack() now copies the full repository root (via _repo_root()) into the Habitat build cache, instead of a fixed $PLAN_CONTEXT/.., which previously copied too shallow a tree and caused the build to fail with Could not locate Gemfile
    • The NOTICE copy and binstub_patch.rb injection in do_install() also use _repo_root() for the same reason
    • _repo_root() marks all directories as git-safe first, since the Habitat build sandbox mounts the source tree with different ownership, which otherwise causes git to fail with a "dubious ownership" error

Result

Habitat package builds for Knife are now validated on Linux ARM64 via Buildkite/Expeditor, in addition to the existing Linux (x86_64) and Windows validation steps, and the Habitat plan builds successfully on both the default and ARM targets.

Jira

CHEF-37332

Add an Arm64 Habitat validation step to .expeditor/habitat-test.pipeline.yml using Buildkite queue default-privileged-aarch64, docker plugin (ruby:3.4), and BUILD_PKG_TARGET=aarch64-linux, keeping HAB_AUTH_TOKEN propagation consistent with existing Linux/Windows steps. Also introduce habitat/aarch64-linux/plan.sh, sourcing the existing habitat/plan.sh to reuse the default Linux build logic for aarch64 (ARM) targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
@sanjain-progress
sanjain-progress marked this pull request as ready for review July 31, 2026 08:42
@sanjain-progress
sanjain-progress requested review from a team and jaymzh as code owners July 31, 2026 08:42
@sanjain-progress sanjain-progress added the ai-assisted Work completed with AI assistance following Progress AI policies label Jul 31, 2026
Sachin Jain and others added 4 commits July 31, 2026 15:07
Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
Use $SRC_PATH/VERSION instead of the relative ../VERSION path so
pkg_version() resolves correctly regardless of which directory depth
the plan is invoked from.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
do_unpack, the NOTICE copy, and the binstub_patch.rb injection all
assumed the plan is always invoked one directory below the repository
root. Resolve the actual repository root via git instead, so these
steps work correctly no matter which directory depth invokes the plan.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
The Habitat build sandbox mounts the source tree with different
ownership, causing git to refuse operations with a 'dubious ownership'
error. Mark directories as safe before invoking git rev-parse so
_repo_root resolves correctly inside the sandbox.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants