Jira (PUP-10954) .gemspec doesn't fulfill its stated goal

4 views
Skip to first unread message

David Schmitt (Jira)

unread,
Mar 5, 2021, 8:20:01 AM3/5/21
to puppe...@googlegroups.com
David Schmitt created an issue
 
Puppet / Bug PUP-10954
.gemspec doesn't fulfill its stated goal
Issue Type: Bug Bug
Affects Versions: PUP 6.21.1, PUP 7.4.0
Assignee: Unassigned
Created: 2021/03/05 5:19 AM
Priority: Normal Normal
Reporter: David Schmitt

Puppet Version: git repo, main and 6.x branch

The .gemspec file claims it is "intended for use with bundler when Puppet is a dependency of another project", but is not reflecting the correct gem dependencies as uploaded to rubygems.

Desired Behavior:

Referencing the puppet repository in a Gemfile pulls all gems required by puppet and packaged in the agent.

Actual Behavior:

Referencing the puppet repository in a Gemfile doesn't pull in the win32-* dependencies that https://rubygems.org/gems/puppet/versions/6.21.1-x64-mingw32 has.

Context:

This was found during the analysis of MODULES-10963.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 8, 2021, 3:14:02 PM3/8/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10954
 
Re: .gemspec doesn't fulfill its stated goal

I have a project https://github.com/joshcooper/puppetdeps that has a runtime dependency on puppet '~> 6.0'. When I do bundle install on windows, puppet's transitive dependencies are resolved correctly and I get ffi & win32* gems:

PS C:\Users\josh\projects\puppetdeps> bundle --version
Bundler version 2.1.4
PS C:\Users\josh\projects\puppetdeps> bundle install --path .bundle
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '.bundle'`, and stop using this flag
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Fetching rake 13.0.3
Installing rake 13.0.3
Using bundler 2.1.4
Fetching concurrent-ruby 1.1.8
Installing concurrent-ruby 1.1.8
Fetching deep_merge 1.2.1
Installing deep_merge 1.2.1
Fetching hocon 1.3.1
Installing hocon 1.3.1
Fetching thor 1.1.0
Installing thor 1.1.0
Fetching facter 4.0.51
Installing facter 4.0.51
Fetching fast_gettext 1.8.0
Installing fast_gettext 1.8.0
Fetching ffi 1.15.0 (x64-mingw32)
Installing ffi 1.15.0 (x64-mingw32)
Fetching hiera 3.6.0
Installing hiera 3.6.0
Fetching httpclient 2.8.3
Installing httpclient 2.8.3
Fetching locale 2.1.3
Installing locale 2.1.3
Fetching minitar 0.9
Installing minitar 0.9
Fetching minitest 5.14.4
Installing minitest 5.14.4
Fetching multi_json 1.15.0
Installing multi_json 1.15.0
Fetching puppet-resource_api 1.8.13
Installing puppet-resource_api 1.8.13
Fetching semantic_puppet 1.0.3
Installing semantic_puppet 1.0.3
Fetching win32-dir 0.4.9
Installing win32-dir 0.4.9
Fetching win32-process 0.7.5
Installing win32-process 0.7.5
Fetching win32-security 0.2.5
Installing win32-security 0.2.5
Fetching win32-service 0.8.8
Installing win32-service 0.8.8
Fetching puppet 6.21.1 (x64-mingw32)
Installing puppet 6.21.1 (x64-mingw32)
Using puppetdeps 0.1.0 from source at `.`
Bundle complete! 3 Gemfile dependencies, 23 gems now installed.
Bundled gems are installed into `./.bundle`
Post-install message from minitar:
The `minitar` executable is no longer bundled with `minitar`. If you are
expecting this executable, make sure you also install `minitar-cli`.

When I install on macOS, I get the universal-darwin version of puppet:

$ bundle --version
Bundler version 2.2.4
$ bundle install --path .bundle
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '.bundle'`, and stop using this flag
Fetching gem metadata from https://rubygems.org/........
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching CFPropertyList 2.3.6
Using bundler 2.2.4
Fetching thor 1.1.0
Fetching locale 2.1.3
Fetching concurrent-ruby 1.1.8
Fetching fast_gettext 1.8.0
Fetching hocon 1.3.1
Fetching httpclient 2.8.3
Fetching hiera 3.6.0
Fetching multi_json 1.15.0
Fetching deep_merge 1.2.1
Fetching minitest 5.14.4
Fetching semantic_puppet 1.0.3
Installing CFPropertyList 2.3.6
Installing multi_json 1.15.0
Installing deep_merge 1.2.1
Installing fast_gettext 1.8.0
Installing semantic_puppet 1.0.3
Installing hiera 3.6.0
Installing thor 1.1.0
Installing locale 2.1.3
Installing minitest 5.14.4
Installing hocon 1.3.1
Installing concurrent-ruby 1.1.8
Installing httpclient 2.8.3
Fetching puppet-resource_api 1.8.13
Fetching facter 4.0.51
Installing puppet-resource_api 1.8.13
Installing facter 4.0.51
Fetching puppet 6.21.1 (universal-darwin)
Installing puppet 6.21.1 (universal-darwin)
Using puppetdeps 0.1.0 from source at `.`
Bundle complete! 3 Gemfile dependencies, 18 gems now installed.
Bundled gems are installed into `./.bundle`

Using a local checkout of puppet also works:

PS C:\Users\josh\projects\puppetdeps> git diff
diff --git a/Gemfile b/Gemfile
index 2b74691..b231c7f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,6 +5,8 @@ source "https://rubygems.org"
 # Specify your gem's dependencies in puppetdeps.gemspec
 gemspec
 
+gem "puppet", path: "/Users/josh/projects/puppet"
+
 gem "rake", "~> 13.0"
 
 gem "minitest", "~> 5.0"
PS C:\Users\josh\projects\puppetdeps> Remove-Item .\.bundle -Recurse -Force                                                                              PS C:\Users\josh\projects\puppetdeps> Remove-Item Gemfile.lock
PS C:\Users\josh\projects\puppetdeps> bundle install --path .bundle
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '.bundle'`, and stop using this flag
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching CFPropertyList 2.3.6
Installing CFPropertyList 2.3.6
Using bundler 2.1.4
Fetching concurrent-ruby 1.1.8
Installing concurrent-ruby 1.1.8
Fetching deep_merge 1.2.1
Installing deep_merge 1.2.1
Fetching hocon 1.3.1
Installing hocon 1.3.1
Fetching thor 1.1.0
Installing thor 1.1.0
Fetching facter 4.0.51
Installing facter 4.0.51
Fetching fast_gettext 1.8.0
Installing fast_gettext 1.8.0
Fetching ffi 1.15.0 (x64-mingw32)
Installing ffi 1.15.0 (x64-mingw32)
Fetching hiera 3.6.0
Installing hiera 3.6.0
Fetching httpclient 2.8.3
Installing httpclient 2.8.3
Fetching locale 2.1.3
Installing locale 2.1.3
Fetching minitar 0.9
Installing minitar 0.9
Fetching minitest 5.14.4
Installing minitest 5.14.4
Fetching multi_json 1.15.0
Installing multi_json 1.15.0
Fetching semantic_puppet 1.0.3
Installing semantic_puppet 1.0.3
Fetching win32-dir 0.4.9
Installing win32-dir 0.4.9
Fetching win32-process 0.7.5
Installing win32-process 0.7.5
Fetching win32-security 0.2.5
Installing win32-security 0.2.5
Fetching win32-service 0.8.8
Installing win32-service 0.8.8
Using puppet 6.22.0 from source at `C:/Users/josh/projects/puppet`
Using puppetdeps 0.1.0 from source at `.`
Bundle complete! 4 Gemfile dependencies, 23 gems now installed.
Bundled gems are installed into `./.bundle`
Post-install message from minitar:
The `minitar` executable is no longer bundled with `minitar`. If you are
expecting this executable, make sure you also install `minitar-cli`.

As does using a git source and branch:

PS C:\Users\josh\projects\puppetdeps> git diff
diff --git a/Gemfile b/Gemfile
index 2b74691..120984b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,6 +5,8 @@ source "https://rubygems.org"
 # Specify your gem's dependencies in puppetdeps.gemspec
 gemspec
 
+gem "puppet", git: "https://github.com/puppetlabs/puppet", branch: "6.x"
+
 gem "rake", "~> 13.0"
 
 gem "minitest", "~> 5.0"
PS C:\Users\josh\projects\puppetdeps> Remove-Item .\.bundle -Recurse -Force
PS C:\Users\josh\projects\puppetdeps> Remove-Item Gemfile.lock
PS C:\Users\josh\projects\puppetdeps> bundle install --path .bundle
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '.bundle'`, and stop using this flag
Fetching https://github.com/puppetlabs/puppet
Fetching gem metadata from https://rubygems.org/.......
Resolving dependencies...
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching CFPropertyList 2.3.6
Installing CFPropertyList 2.3.6
Using bundler 2.1.4
Fetching concurrent-ruby 1.1.8
Installing concurrent-ruby 1.1.8
Fetching deep_merge 1.2.1
Installing deep_merge 1.2.1
Fetching hocon 1.3.1
Installing hocon 1.3.1
Fetching thor 1.1.0
Installing thor 1.1.0
Fetching facter 4.0.51
Installing facter 4.0.51
Fetching fast_gettext 1.8.0
Installing fast_gettext 1.8.0
Fetching ffi 1.15.0 (x64-mingw32)
Installing ffi 1.15.0 (x64-mingw32)
Fetching hiera 3.6.0
Installing hiera 3.6.0
Fetching httpclient 2.8.3
Installing httpclient 2.8.3
Fetching locale 2.1.3
Installing locale 2.1.3
Fetching minitar 0.9
Installing minitar 0.9
Fetching minitest 5.14.4
Installing minitest 5.14.4
Fetching multi_json 1.15.0
Installing multi_json 1.15.0
Fetching semantic_puppet 1.0.3
Installing semantic_puppet 1.0.3
Fetching win32-dir 0.4.9
Installing win32-dir 0.4.9
Fetching win32-process 0.7.5
Installing win32-process 0.7.5
Fetching win32-security 0.2.5
Installing win32-security 0.2.5
Fetching win32-service 0.8.8
Installing win32-service 0.8.8
Using puppet 6.22.0 from https://github.com/puppetlabs/puppet (at 6.x@72955cc)
Using puppetdeps 0.1.0 from source at `.`
Bundle complete! 4 Gemfile dependencies, 23 gems now installed.
Bundled gems are installed into `./.bundle`
Post-install message from minitar:
The `minitar` executable is no longer bundled with `minitar`. If you are
expecting this executable, make sure you also install `minitar-cli`.

Bundler/Rubygem's handling of platform specific gems has been spotty over the years, so perhaps you're using an older ruby and/or bundler version?

Reply all
Reply to author
Forward
0 new messages