Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PDK-446) Fix pathing on Debian/Ubuntu #69

Merged
merged 3 commits into from Aug 31, 2017

Conversation

james-stocks
Copy link

Move the PDK exe from /opt/puppetlabs/bin to /opt/puppetlabs/pdk/bin
On Debian/Ubuntu add a symlink from /opt/puppetlabs/pdk/bin/pdk to /usr/local/bin/pdk

Removes binaries left in /opt/puppetlabs/pdk/bin by the curl and openssl components

pkg.install_file('./50-pdk', '/etc/paths.d/50-pdk')
elsif platform.is_deb?
pkg.link File.join(settings[:prefix], 'bin', 'pdk'), File.join(settings[:main_bin], 'pdk')
Copy link
Author

Choose a reason for hiding this comment

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

We could just do this on all posix platforms and not bother with the /etc/profile.d/pdk.sh file to change PATH?

Copy link
Contributor

Choose a reason for hiding this comment

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

That would make the code easier to follow. We can still go back on this if it turns out to have some unforeseen consequences.

Copy link
Author

Choose a reason for hiding this comment

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

Testing...

Copy link
Contributor

Choose a reason for hiding this comment

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

Did we decide this was better than just including the script in both profile.d and Xsession.d?

Copy link
Author

Choose a reason for hiding this comment

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

See comments on puppetlabs/pdk#272 - the symlink should work on all platforms and shells

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, seems like /usr/local/bin is a reasonable approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think we could just do this on all linux platforms at least.

james-stocks added 2 commits August 30, 2017 14:06
pdk/bin should only contain pdk itself and not dependencies like curl.
Move pdk from /opt/puppetlabs/bin to /opt/puppetlabs/pdk/bin
Fix adding pdk to PATH on debian|ubuntu
["#{platform[:make]} #{install_prefix} install",
"rm -f #{settings[:prefix]}/bin/openssl",
"rm -f #{settings[:prefix]}/bin/c_rehash",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs careful testing because I seem to remember things breaking when I tried to get rid of these before. But I could be wrong. :)

Copy link
Author

Choose a reason for hiding this comment

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

On EL7, Ubuntu 16.04 and Windows 2012 R2 it passes our beaker tests. I'm getting an error trying to build OSX 12.10
Is there anything outside our existing beaker tests (install the package, create a new module, and validate it) that might not work? If so, such cases are probably high priority to add to the beaker tests

Copy link
Contributor

@scotje scotje Aug 30, 2017

Choose a reason for hiding this comment

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

My main concern would be places where Ruby needs to go out and download something new (particularly over HTTPS) and I think with the level of vendoring we do now, the default use case doesn't go out to the network anymore. Easy fix would be to add a test which adds a new gem to a generated module Gemfile and then tries to run pdk validate or whatever.

Copy link
Contributor

Choose a reason for hiding this comment

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

Built packages for latest macOS and Ubuntu and everything seems to work fine even when you add new dependencies to the Gemfile.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @scotje ! The remaining part of the ticket is to update the beaker code; so I can add that new test at the same time. I think it would be enough of an ongoing concern to warrant adding a beaker test for.

pkg.install_file('./50-pdk', '/etc/paths.d/50-pdk')
elsif platform.is_deb?
pkg.link File.join(settings[:prefix], 'bin', 'pdk'), File.join(settings[:main_bin], 'pdk')
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we decide this was better than just including the script in both profile.d and Xsession.d?

@james-stocks
Copy link
Author

@scotje @DavidS - PR updated to use the /usr/local/bin/pdk symlink on all Linux variants.
As per comment above; I also need to make a beaker test code change for this ticket; and while doing that I will add a new test case to ensure that a new gem can be added to a module's Gemfile after module generation.

@DavidS
Copy link
Contributor

DavidS commented Aug 31, 2017

LGTM, are the test changes a pre-req for this to get merged, or is this good to go?

@james-stocks
Copy link
Author

@DavidS It's good to go - the beaker change will be to stop beaker using a full path to pdk and instead rely on it being on the path.
I will probably also add a "pdk is on the path" beaker test so we get an explicit pass/fail on that in future package builds.

@DavidS DavidS merged commit bc9fbbf into puppetlabs:master Aug 31, 2017
@DavidS DavidS deleted the PDK-446 branch August 31, 2017 14:33
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.

None yet

3 participants