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

v0.5.3 has a broken dependency chain in PDK docker image #154

Closed
sgnn7 opened this issue Nov 17, 2020 · 3 comments
Closed

v0.5.3 has a broken dependency chain in PDK docker image #154

sgnn7 opened this issue Nov 17, 2020 · 3 comments
Labels

Comments

@sgnn7
Copy link

sgnn7 commented Nov 17, 2020

Describe the Bug

We're having issues running pdk tests in puppet/pdk container with the following gem definition in the Gemfile of our module:

group :development do
  gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4',     require: false, platforms: [:ruby]
end

This results in:

13:08:46  An error occurred while installing http-parser (1.2.2), and Bundler cannot
13:08:46  continue.
13:08:46  Make sure that `gem install http-parser -v '1.2.2' --source
13:08:46  'https://rubygems.org/'` succeeds before bundling.
13:08:46  
13:08:46  In Gemfile:
13:08:46    puppet-module-posix-dev-r2.5 was resolved to 0.5.3, which depends on
13:08:46      puppet_litmus was resolved to 0.18.4, which depends on
13:08:46        rspec_honeycomb_formatter was resolved to 0.2.1, which depends on
13:08:46          honeycomb-beeline was resolved to 2.3.0, which depends on
13:08:46            libhoney was resolved to 1.15.0, which depends on
13:08:46              http was resolved to 4.4.1, which depends on
13:08:46                http-parser

I am guessing that it's a problem with the dependencies or the image itself.

Earliest working gem version that passes this point is puppet-module-posix-dev-r2.5 v0.5.0

Expected Behavior

No problems running tests

Steps to Reproduce

Steps to reproduce the behavior:

Easy reproduction:

  1. Clone our project: https://github.com/cyberark/conjur-puppet
  2. You must have a clean checkout of this repo - problem is cache related
  3. Run ./scripts/test.sh

Minimal reproduction

  • Gemfile
source 'https://rubygems.org'

group :development do
  gem "puppet-module-posix-dev-r2.5", '0.5.3',      require: false, platforms: [:ruby]
end
  • metadata.json
{
  "name": "cyberark-conjur",
  "version": "3.1.0",
  "dependencies": [
    {
      "name": "puppetlabs/registry",
      "version_requirement": ">= 3.1.0 < 4.0.0"
    }
  ],
  "operatingsystem_support": [
    {
      "operatingsystem": "Ubuntu",
      "operatingsystemrelease": [
        "20.04"
      ]
    }
  ],
  "requirements": [
    {
      "name": "puppet",
      "version_requirement": ">= 6.0.0 < 7.0.0"
    }
  ],
  "pdk-version": "1.18.1",
  "template-url": "pdk-default#1.18.1",
  "template-ref": "tags/1.18.1-0-g3d2e75c"
}
  • Run docker run --rm -it -w /root -v $(pwd)/Gemfile:/root/Gemfile -v $(pwd)/metadata.json:/root/metadata.json puppet/pdk test unit

Environment

pdk (INFO): Using Ruby 2.5.8
pdk (INFO): Using Puppet 6.17.0
  • Version v0.5.3
  • Platform: puppet/pdk DockerHub container

Additional Context

Add any other context about the problem here.

@sgnn7 sgnn7 added the bug label Nov 17, 2020
sgnn7 added a commit to cyberark/conjur-puppet that referenced this issue Nov 20, 2020
Upstream pdk gem is haing issues with PDK dependencies so we need this
temporary fix for it.

Upstream: puppetlabs/puppet-module-gems#154

**This fix should be removed once upstream fix is merged**
sgnn7 added a commit to cyberark/conjur-puppet that referenced this issue Nov 20, 2020
Upstream pdk gem is haing issues with PDK dependencies so we need this
temporary fix for it.

Upstream: puppetlabs/puppet-module-gems#154

**This fix should be removed once upstream fix is merged**
sgnn7 added a commit to cyberark/conjur-puppet that referenced this issue Nov 20, 2020
Upstream pdk gem is haing issues with PDK dependencies so we need this
temporary fix for it.

Upstream: puppetlabs/puppet-module-gems#154

**This fix should be removed once upstream fix is merged**
@sgnn7
Copy link
Author

sgnn7 commented Nov 20, 2020

The problem here afaict (and I don't know where to file it) turns out that:

  • As soon as we have a gem that's not baked into the puppet/pdk image gem cache triggers a bundle install
  • puppet-module-posix-dev-r2.5 gem through cascading dependency chain ends up depending on http-parser = 1.2.2
  • http-parser is a native extension and as such requires build tooling in the VM (specifically the gcc and make packages)
  • puppet/pdk does not have those packages installed
  • Build breaks

@sgnn7
Copy link
Author

sgnn7 commented Nov 20, 2020

Problem also seems to occur only on the first run of the pdk image invocation on a real repo so it is definitely gem cache related.

@sgnn7
Copy link
Author

sgnn7 commented Nov 23, 2020

Closing this issue now that the real cause has been pinpointed and a replacement issue filed in the appropriate repo.

@sgnn7 sgnn7 closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant