[PDK-1073] PATH setup seems to be incomplete for `pdk bundle exec` Created: 2018/07/12  Updated: 2018/07/26  Resolved: 2018/07/16

Status: Closed
Project: Puppet Development Kit
Component/s: None
Affects Version/s: PDK 1.6.0
Fix Version/s: PDK 1.6.1

Type: Bug Priority: Normal
Reporter: Jesse Scott Assignee: Jesse Scott
Resolution: Fixed Votes: 0
Labels: resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Packaged installation of PDK


Template:
Acceptance Criteria:
  • `pdk bundle exec` invocations can access binaries from the PDK shared gem cache
Team: Puppet Developer Experience
Method Found: Customer Feedback
Release Notes: Bug Fix
Release Notes Summary: Fixed an issue where PDK subprocesses did not have the correct PATH environment. This issue would manifest as a "command not found" error when trying to use `pdk bundle exec` to run a command from a PDK-bundled Ruby gem such as `rspec`.
QA Risk Assessment: Needs Assessment

 Description   

When running `pdk bundle exec` the PATH in the resulting execution environment does not correctly point to the "bin" directory of the PDK shared gem cache:

$ pdk bundle exec env
...snip...
PATH=/root/.pdk/cache/ruby/2.4.0/bin:/opt/puppetlabs/pdk/private/ruby/2.4.4/bin:/opt/puppetlabs/pdk/private/ruby/2.4.4/lib/ruby/gems/2.4.0:/opt/puppetlabs/pdk/share/cache/ruby/2.4.0:/opt/puppetlabs/pdk/private/puppet/ruby/2.4.0/bin:/opt/puppetlabs/pdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/puppetlabs/pdk/private/git/bin

Specifically it appears that "/opt/puppetlabs/pdk/share/cache/ruby/2.4.0" should be "/opt/puppetlabs/pdk/share/cache/ruby/2.4.0*/bin*".

This results in not being able to `pdk bundle exec` things that are included in the shared PDK gem cache:

$ pdk bundle exec rspec
pdk (INFO): Using Ruby 2.4.4
pdk (INFO): Using Puppet 5.5.2
bundler: command not found: rspec
Install missing gem executables with `bundle install`

See also https://github.com/puppetlabs/pdk/issues/535


Generated at Wed Oct 16 03:39:20 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.