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

Pin rubygems-update for Ruby 2.7 #2448

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
ruby-version: 2.7
- name: Update rubygems and install gems
run: |
gem update --system --silent --no-document
gem update --system 3.4.22 --silent --no-document
bundle install --jobs 4 --retry 3
- run: bundle exec rake ${{ matrix.check }}
7 changes: 5 additions & 2 deletions acceptance/tests/validate_vendored_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setup_build_environment(agent)
# We add `--enable-system-libraries` to use system libsqlite3
gem_install_sqlite3 = "env GEM_HOME=/opt/puppetlabs/puppet/lib/ruby/vendor_gems " + gem_command(agent) + " install sqlite3 -- --enable-system-libraries"
install_package_on_agent = package_installer(agent)
on(agent, "#{gem_command(agent)} update --system")
on(agent, "#{gem_command(agent)} update --system 3.4.22")

case agent['platform']
when /aix/
Expand Down Expand Up @@ -189,11 +189,14 @@ def install_dependencies(agent)
end
end

# rubygems-update >= 3.5.0 drops compatibility with Ruby 2.7, which
# puppet-agent 7.x uses. We pin to the last version that supports Ruby 2.7,
# rubygems-update 3.4.22.
step "'gem update --system' keeps vendor_gems still in path" do
agents_to_skip = select_hosts({:platform => [/windows/, /cisco/, /eos/, /cumulus/]}, agents)
agents_to_test = agents - agents_to_skip
agents_to_test.each do |agent|
on(agent, "/opt/puppetlabs/puppet/bin/gem update --system")
on(agent, "/opt/puppetlabs/puppet/bin/gem update --system 3.4.22")
list_env = on(agent, "/opt/puppetlabs/puppet/bin/gem env").stdout.chomp
unless list_env.include?("/opt/puppetlabs/puppet/lib/ruby/vendor_gems")
fail_test("Failed to keep vendor_gems directory in GEM_PATH!")
Expand Down