Skip to content

(PUP-9175) Use modern version of Rake gem#7168

Merged
joshcooper merged 1 commit intopuppetlabs:5.5.xfrom
glennsarti:pup-9175-use-modern-rake
Oct 16, 2018
Merged

(PUP-9175) Use modern version of Rake gem#7168
joshcooper merged 1 commit intopuppetlabs:5.5.xfrom
glennsarti:pup-9175-use-modern-rake

Conversation

@glennsarti
Copy link
Contributor

Previously the version of Rake was pinned to an old Ruby 1.9 compatible version
however this is beginning to cause issues with compatibility in other gems,
for example the packaging gem. This commit changes the rake requirement in the
gemfile to use the older version for old versions of Ruby (< 2.0) and uses a
more relaxed pin, protecting on major version, for newer Ruby versions (>= 2.0).

This commit also adds a RAKE_LOCATION environment variable which can be used in
any instance to specify the the version of Rake required, much like the FACTER
and HIERA variables.

@glennsarti glennsarti requested review from branan and mwaggett October 15, 2018 03:47
Previously the version of Rake was pinned to an old Ruby 1.9 compatible version
however this is beginning to cause issues with compatibility in other gems,
for example the packaging gem.  This commit changes the rake requirement in the
gemfile to use the older version for old versions of Ruby (< 2.0) and uses a
more relaxed pin, protecting on major version, for newer Ruby versions (>= 2.0).

This commit also adds a RAKE_LOCATION environment variable which can be used in
any instance to specify the the version of Rake required, much like the FACTER
and HIERA variables.

Note the rubocop disable is needed because rubocop doesn't understand the
conditional statements which ensures only one rake gem is ever actually
specified.
@glennsarti glennsarti force-pushed the pup-9175-use-modern-rake branch from 961b5b0 to 6e88c55 Compare October 15, 2018 03:56
@puppetcla
Copy link

CLA signed by all contributors.

gem "rake", '~> 12.2.1', :require => false
gem "rake", *location_for(ENV['RAKE_LOCATION'] || '~> 12.2.1') if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "rake", *location_for(ENV['RAKE_LOCATION'] || '~> 12.2') if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.0.0') # rubocop:disable Bundler/DuplicatedGem

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good, but in the merge up to 6.0.x, we should delete the < 2.0 case, because puppet requires 2.3 or later in puppet6.

@joshcooper joshcooper merged commit 4562a00 into puppetlabs:5.5.x Oct 16, 2018
@joshcooper
Copy link
Contributor

@glennsarti Can you submit a new PR to 6.0.x to eliminate the < 2.0 case?

@joshcooper
Copy link
Contributor

Due to upcoming release deadlines, I took care of this in #7171

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.

4 participants