Handle case where ruby needs an upgrade, but openssl also needs to be upgraded, and other M106 fixes. (#9912)

* handle case where ruby needs an upgrade, but openssl also needs to be upgraded

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update gcc_dev package for older glibc versions

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update libssp

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update py3_packaging

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* rerun upgrade on openssl upgrade too

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fixup pip for older ruby versions

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup pip logic

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* do not break rubocop install with older ruby

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix json gem breakage during ruby upgrade

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* py3_pip => 24.0

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add comment

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-06-06 01:58:13 -04:00
committed by GitHub
parent f93d19bdee
commit 7ef6d70736
8 changed files with 26 additions and 9 deletions

View File

@@ -1,7 +1,14 @@
#!/usr/bin/env ruby
require 'uri'
require 'digest/sha2'
require 'json'
begin
require 'json'
rescue LoadError
# The json gem can break when upgrading from a much older version of ruby.
puts ' -> install gem json'
Gem.install('json')
require 'json'
end
require 'fileutils'
require 'tmpdir'
begin
@@ -360,13 +367,20 @@ def upgrade(*pkgs, build_from_source: false)
# Upgrade OpenSSL first if OpenSSL is in the upgrade list, as other
# package upgrades, especially their postinstalls, may break until the
# new version of OpenSSL is installed.
to_be_upgraded.insert(0, to_be_upgraded.delete('openssl')) if to_be_upgraded.include?('openssl')
if to_be_upgraded.include?('openssl')
to_be_upgraded.insert(0, to_be_upgraded.delete('openssl'))
rerun_upgrade = true
end
# Only upgrade ruby if ruby is in the upgrade list, as other
# package upgrades may break until crew is rerun with the new
# version of ruby.
if to_be_upgraded.include?('ruby')
to_be_upgraded = ['ruby']
if to_be_upgraded.include?('openssl')
to_be_upgraded.delete('ruby')
else
to_be_upgraded = ['ruby']
end
rerun_upgrade = true
end

View File

@@ -37,7 +37,9 @@ class Pip < Package
@pip_files_lines = @pip_files[/(?<=Files:\n)[\W|\w]*/, 0].split
@pip_files_lines.each do |pip_file|
@pip_path = File.expand_path("#{@pip_files_base}#{pip_file}")
@destpath = "#{CREW_DEST_DIR.chomp('/')}#{@pip_path}"
@destpath = File.join(CREW_DEST_DIR, @pip_path)
# Handle older FileUtils from older ruby versions.
FileUtils.mkdir_p File.dirname(@destpath) if Gem::Version.new(RUBY_VERSION.to_s) < Gem::Version.new('3.3')
FileUtils.install @pip_path, @destpath
end
eval @pip_install_extras if @pip_install_extras

View File

@@ -2,7 +2,7 @@
# Defines common constants used in different parts of crew
require 'etc'
CREW_VERSION = '1.48.6'
CREW_VERSION = '1.48.7'
# kernel architecture
KERN_ARCH = Etc.uname[:machine]

View File

@@ -17,7 +17,7 @@ class Gcc_dev < Package
binary_sha256({
i686: '68823c2d372559b5ba9e304529bd01f24ccf7c0a71a14824d048b2d323643257'
})
when '2.27', '2.35'
when '2.27', '2.32', '2.33', '2.35'
binary_sha256({
aarch64: 'f649c41a0d2fbfb5077068319d6dd8cca84b4047d409213b8f32623dff4e2bbd',
armv7l: 'f649c41a0d2fbfb5077068319d6dd8cca84b4047d409213b8f32623dff4e2bbd',

View File

@@ -18,7 +18,7 @@ class Libssp < Package
binary_sha256({
i686: 'f1e548a41f577f4865675e8b280fb949c7a10459980b652d24b80d7f86e673a5'
})
when '2.27', '2.35'
when '2.27', '2.32', '2.33', '2.35'
binary_sha256({
aarch64: '2b8d8b39ae8ad8e4ec938279b4a23468e7dc7f56c8c3f692f700a0d49f557855',
armv7l: '2b8d8b39ae8ad8e4ec938279b4a23468e7dc7f56c8c3f692f700a0d49f557855',

View File

@@ -3,7 +3,7 @@ require 'buildsystems/pip'
class Py3_packaging < Pip
description 'Packaging provides core utilities for Python packages'
homepage 'https://packaging.pypa.io/'
@_ver = '23.2'
@_ver = '24.0'
version "#{@_ver}-py3.12"
license 'BSD-2 or Apache-2.0'
compatibility 'all'

View File

@@ -3,7 +3,7 @@ require 'buildsystems/python'
class Py3_pip < Python
description 'Pip is the python package manager from the Python Packaging Authority.'
homepage 'https://pip.pypa.io/'
@_ver = '23.3.1'
@_ver = '24.0'
version "#{@_ver}-py3.12"
license 'MIT'
compatibility 'all'

View File

@@ -20,6 +20,7 @@ class Ruby_rubocop < RUBY
no_fhs
ruby_install_extras <<~EOF
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/.config/rubocop/" if Gem::Version.new(RUBY_VERSION.to_s) < Gem::Version.new('3.3')
FileUtils.install '.rubocop.yml', "#{CREW_DEST_PREFIX}/.config/rubocop/config.yml", mode: 0o644
EOF