Add gem binary build functionality and also refactor upload to use regex in lieu of sed (#10494)

* Add initial plumbing for ruby gem-compiler use.

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

* Add binary gem building to ruby buildsystem.

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

* Refactor upload to avoid sed.

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

* Add gem binary build plumbing to crew.

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

* Add binary_compression to gems.

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

* Add ruby gem binaries.

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

* Move ruby_ruby_libversion to core.

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

* Ruby gem update check should account for local versions.

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

* Remove unused update_sha256 function.

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

* Add no_compile_needed to ruby_rubocop.rb

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

* Remove ruby_gem_compiler from buildessential.

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-09-19 12:52:39 -04:00
committed by GitHub
parent 60a54a3441
commit 24cda80f45
20 changed files with 229 additions and 123 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
# update_ruby_gem_packages version 1.2 (for Chromebrew)
# update_ruby_gem_packages version 1.3 (for Chromebrew)
# Author: Satadru Pramanik (satmandu) satadru at gmail dot com
# Usage in root of cloned chromebrew repo:
# tools/update_ruby_gem_packages.rb
@@ -41,7 +41,7 @@ relevant_gem_packages.each_with_index do |package, index|
pool.post do
gem_name = package.gsub('.rb', '').sub('ruby_', '').gsub('_', '-').gsub('packages/', '')
puts "[#{(index + 1).to_s.rjust(numlength)}/#{total_files_to_check}] Checking rubygems for updates to #{gem_name}...".orange
pkg_version = `sed -n -e 's/^\ \ version //p' #{package}`.chomp.delete("'").delete('"').gsub(ruby_ver_string, '')
pkg_version = `sed -n -e 's/^\ \ version //p' #{package}`.chomp.delete("'").delete('"').gsub(ruby_ver_string, '').split('-').first
gem_version = Gem.latest_spec_for(gem_name).version.to_s
next package if gem_version.blank?
if Gem::Version.new(gem_version) > Gem::Version.new(pkg_version)