Added Appbundler support in linux hab pkg#168
Merged
Conversation
Signed-off-by: nitin sanghi <nsanghi@progress.com>
Signed-off-by: nitin sanghi <nsanghi@progress.com>
ashiqueps
reviewed
Jun 2, 2026
Signed-off-by: nitin sanghi <nsanghi@progress.com>
nikhil2611
approved these changes
Jun 3, 2026
sanjain-progress
approved these changes
Jun 3, 2026
muthuja
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the hand-rolled
wrap_ruby_knife/wrap_bin_with_rubypattern inhabitat/plan.shwith the standard appbundler gem approach, following the same patterns adopted in This will also fix https://progresssoftware.atlassian.net/browse/CHEF-33638What changed and why
wrap_bin_with_rubyto appbundler – The old wrapper hardcoded a gem path that could drift as gem versions changed and did not pin dependency versions at startup. Appbundler readsGemfile.lockand emitsgem "name", "= VERSION"activation calls for every pinned dep, eliminating "ambiguous specs" warnings and ensuring reproducible load-time behaviour.binstub_patch.rb– Injected into every appbundler-generated binstub viasedat build time. SetsAPPBUNDLER_ALLOW_RVM=true(prevents appbundler from clearing the carefully constructed Habitat runtimeGEM_PATH) and prepends the vendor path so the binstub is runnable directly without the wrapper.bundle install(with--local path vendor/) places Gemfile deps undervendor/ruby/3.4.0/(bundler subdirectory);gem install knife-*.gemwith--ignore-dependenciesplaces knife itself undervendor/(flat GEM_HOME). The libexec wrapper setsGEM_HOME=vendor/ruby/3.4.0andGEM_PATH=vendor/so both stores are visible.do_prepare(creates/usr/bin/envsymlink),do_after(removes.github/dirs from vendored gems),do_strip(no-op to prevent Habitat stripping Ruby binaries),do_end(cleans up symlink).artifact.habitat.test.ps1; now uses the always-latest standard install script.Files / paths touched
habitat/plan.sh– Complete rework ofdo_setup_environment,do_install; removedwrap_ruby_knife/wrap_bin_with_ruby; added appbundler workflow with libexec wrapper; addedcore/sedto build deps; addeddo_prepare,do_after,do_strip,do_end.binstub_patch.rb– New file at repo root; patched into binstubs bydo_install..expeditor/buildkite/artifact.habitat.test.ps1– Simplified Install-Habitat function; removed$HabitatVersionpin; removed verbose debug logging.Evidence
Before / After
wrap_bin_with_rubybash wrapper with hardcoded$GEM_PATHgem "x","= VERSION"activation + libexec wrapperGEM_PATHresolved at runtimeKernel.load--ignore-dependencies+ dual-store separation$HOME/.hab/knife/ruby/(unresolvable in Habitat context)APPBUNDLER_ALLOW_RVM=truepreservesGEM_PATHTests / logs
Delegation checklist
Risk & Rollback
11857c2