Skip to content
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
ruby: "3.4"
build: false
jobs: "--only --rubocop"
- os: ubuntu-latest
ruby: "4.0"
build: true
jobs: "--only --test"
- os: ubuntu-latest
ruby: "4.0"
build: false
jobs: "--only --rubocop"
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .toys/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def run_test
next
end
end
result = exec_separate_tool ["test"], name: "Tests in #{dir}"
result = exec_separate_tool ["test", "--minitest-mock"], name: "Tests in #{dir}"
if result.success?
puts "PASSED: #{name}", :bold, :green
else
Expand Down
44 changes: 22 additions & 22 deletions gas/.toys/gas/.preload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Gas
##
# Ruby versions to build if no versions are specified on the command line
#
DEFAULT_RUBIES = ["3.1", "3.2", "3.3", "3.4"]
DEFAULT_RUBIES = ["3.1", "3.2", "3.3", "3.4", "4.0"]

##
# Version of the Gems gem to install
Expand All @@ -47,20 +47,20 @@ module Gas
##
# Version of Rake to install
#
RAKE_VERSION = "13.2.1"
RAKE_VERSION = "13.3.1"

##
# Version of Rake-compiler to install
#
RAKE_COMPILER_VERSION = "1.2.9"
RAKE_COMPILER_VERSION = "1.3.1"

##
# Version of Rake-compiler-dock to install
#
RAKE_COMPILER_DOCK_VERSION = "1.9.1"
RAKE_COMPILER_DOCK_VERSION = "1.11.1"

##
# RCD images with pinned hashes, for 1.9.1-mri, keyed by platform.
# RCD images with pinned hashes, for 1.11.1-mri, keyed by platform.
#
# Any platform that _could_ be requested, should have a corresponding image
# even if it's a duplicate. e.g. x86_64-linux and x86_64-linux-gnu are
Expand All @@ -71,22 +71,22 @@ module Gas
# https://github.com/rake-compiler/rake-compiler-dock/pkgs/container/rake-compiler-dock-image
#
RAKE_COMPILER_DOCK_IMAGE = {
"aarch64-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:69c2a064731d037f94f587cdfc4b37ec426874d7c8a5c207b6b3b921649aa1ac",
"aarch64-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:69c2a064731d037f94f587cdfc4b37ec426874d7c8a5c207b6b3b921649aa1ac",
"aarch64-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:8a42843df1b4515b73baf14740fc09665e6777e107a4a5df8cc101e090364d5d",
"arm-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:e84dd09e113e7caf86b7efc94f2b56333f95bcb3cfb853fe003c8f9026874a25",
"arm-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:e84dd09e113e7caf86b7efc94f2b56333f95bcb3cfb853fe003c8f9026874a25",
"arm-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:c71a3ef81655461705f2faf8f92271f13eb04dc85e191f669fd47e66880f3fdc",
"arm64-darwin" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:263789090e83ea52d59adbfcb333238a75944707e77cc891b80b848721956a5f",
"x64-mingw-ucrt" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:93d31a629f80afb1c04c46a711444fe850623204788d615d1164233f514f55f6",
"x64-mingw32" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:bdd23784091050f8bbffc729a3c8739d4cd60e95d24bf49e6b0b6ef22d752f32",
"x86-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:b0d45d75a5caa83108ee871bc62efa4be1455ccc551b88f9bf1034bd14fb9092",
"x86-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:b0d45d75a5caa83108ee871bc62efa4be1455ccc551b88f9bf1034bd14fb9092",
"x86-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:a1965e5b4a5e62fee9cd5e888496c12755ab6b9ecb20a5476e19e57a47961999",
"x86-mingw32" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:02482994cd88c078b9ab5fc68b57d71270024c8a162d52a55a6a2d0ba9e6758d",
"x86_64-darwin" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:a8798226c8b05d9d9e9777858d626316a07940d2f2847e17e6c96bd38c7f809c",
"x86_64-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:e25669c5d40fb48b5b6447050e47e40d9c0e00796e11dcc58e65253162cc2d1d",
"x86_64-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:e25669c5d40fb48b5b6447050e47e40d9c0e00796e11dcc58e65253162cc2d1d",
"x86_64-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:c6f5a2d3bef675af799fecd0c7f01dc49aa5b04b71607eca39c6e23a2e457496"
"aarch64-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:622413680d8c73a7c3fb5f37f9312aa26ed9b77b6d6d6e9b84e31387bbb9f618",
"aarch64-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:622413680d8c73a7c3fb5f37f9312aa26ed9b77b6d6d6e9b84e31387bbb9f618",
"aarch64-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:fc4b52173a4683ded5a39424093aca0ec7a3a2793371d0f1e0e3e7d03423cab8",
"aarch64-mingw-ucrt" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:116ac59f8eaf970384d8a9b8ac06f2369a428be40cbf9ba4d57e13f337ff23e1",
"arm-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:ea1f972e09a67cb91266f64c1fb073953710dbc68151ce45ba90955588fad860",
"arm-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:ea1f972e09a67cb91266f64c1fb073953710dbc68151ce45ba90955588fad860",
"arm-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:73ef2c62e3cd994928b4566cec6f8c5d4a7e59fda2fb1340df9e780eb82f0b27",
"arm64-darwin" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:5f087b280675e43271370a95261a0000c79a0bc7456f87c313efbc07ba1b0a76",
"x64-mingw-ucrt" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:dd80a6d33dfe7019af63b47711aeb9b87c860e71b6dff319149fff3499af86e1",
"x86-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:b9500afe101f57327690483de0cc40552033a0d54a83e0b6f7f61f8c3dc46003",
"x86-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:b9500afe101f57327690483de0cc40552033a0d54a83e0b6f7f61f8c3dc46003",
"x86-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:6749f76336959623fe3bfe6167eaf3e33ff799dbad6eb07a9ce957523d0905cb",
"x86-mingw32" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:1663491d3d07c2a06eda34dfe9a97ce4739a162ea137cd9714900f6e7a5192cc",
"x86_64-darwin" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:e9ec271a0eb24c6910618e85764b5e85c3e9b255225c1a359c8eabbb4a0065e3",
"x86_64-linux" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:56b7870f3195b5689f1403d35a94aa6ef58205ceb50792d5a06f32a09a070bef",
"x86_64-linux-gnu" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:56b7870f3195b5689f1403d35a94aa6ef58205ceb50792d5a06f32a09a070bef",
"x86_64-linux-musl" => "ghcr.io/rake-compiler/rake-compiler-dock-image@sha256:48ebcc90a31acf63baebce3828e95a8565f85a6f0cb1bb861f1947529cfda49e"
}
end
35 changes: 16 additions & 19 deletions gas/.toys/gas/.test/test_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,16 @@
]
}
let(:darwin_platforms) { ["x86_64-darwin", "arm64-darwin"] }
# TODO: Remove `x64-mingw32` when Ruby 3.0 support is completely dropped
let(:windows_platforms) { ["x86-mingw32", "x64-mingw32", "x64-mingw-ucrt"] }
let(:windows_platforms) { ["x86-mingw32", "x64-mingw-ucrt"] }
let(:all_platforms) { linux_platforms_without_variants + linux_platforms_with_variants + darwin_platforms + windows_platforms }
let(:exec_service) { Toys::Utils::Exec.new }
let(:windows_ruby_versions) { ["3.0", "3.4"] }
# Per rake-compiler-dock instructions:
# `x64-mingw-ucrt` should be used for Ruby 3.1 and later on windows.
# `x64-mingw32` should be used for Ruby 3.0 and earlier. This is to match the
# changed platform of RubyInstaller-3.1.
let(:excluded_combinations) { [["x64-mingw32", "3.4"], ["x64-mingw-ucrt", "3.0"]] }
# See https://github.com/rake-compiler/rake-compiler-dock/issues/189 for details about the issue with
# this platform and Ruby version combination:
let(:excluded_combinations) { [["x86-mingw32", "4.0"]] }
let(:windows_ruby_versions) { ["3.1", "4.0"] }
let(:host_platform) { "#{`uname -m`.strip}-#{`uname -s`.strip.downcase}" }
let(:host_ruby_version) { RUBY_VERSION.sub(/^(\d+\.\d+).*$/, "\\1") }
let(:multi_rubies) { ["3.1", "3.2", "3.3", "3.4" ]}
let(:multi_rubies) { ["3.1", "3.2", "3.3", "3.4", "4.0" ]}
let(:gem_version_for_multi_rubies) { "4.29.2" }
let(:platform_for_multi_rubies) { "x86_64-linux-gnu" }

Expand Down Expand Up @@ -93,11 +90,11 @@ def quiet_build platforms, rubies
@gem_version_override = gem_version_for_multi_rubies
quiet_build platform_for_multi_rubies, multi_rubies
Dir.chdir "#{workspace_dir}/#{gem_and_version}/pkg/" do
assert File.exist? "#{gem_and_version}-#{platform_for_multi_rubies}.gem"
assert_path_exists "#{gem_and_version}-#{platform_for_multi_rubies}.gem"
FileUtils.rm_r "#{gem_and_version}-#{platform_for_multi_rubies}"
exec_service.exec ["gem", "unpack", "#{gem_and_version}-#{platform_for_multi_rubies}.gem"], out: :null
multi_rubies.each do |ruby|
assert File.exist? "#{gem_and_version}-#{platform_for_multi_rubies}/lib/google/#{ruby}/protobuf_c.so"
assert_path_exists "#{gem_and_version}-#{platform_for_multi_rubies}/lib/google/#{ruby}/protobuf_c.so"
end
end
end
Expand All @@ -106,10 +103,10 @@ def quiet_build platforms, rubies
quiet_build linux_platforms_without_variants, host_ruby_version
Dir.chdir "#{workspace_dir}/#{gem_and_version}/pkg/" do
linux_platforms_without_variants.each do |platform|
assert File.exist? "#{gem_and_version}-#{platform}.gem"
assert_path_exists "#{gem_and_version}-#{platform}.gem"
FileUtils.rm_r "#{gem_and_version}-#{platform}"
exec_service.exec ["gem", "unpack", "#{gem_and_version}-#{platform}.gem"], out: :null
assert File.exist? "#{gem_and_version}-#{platform}/lib/google/protobuf_c.so"
assert_path_exists "#{gem_and_version}-#{platform}/lib/google/protobuf_c.so"
end
end
end
Expand All @@ -118,10 +115,10 @@ def quiet_build platforms, rubies
quiet_build linux_platforms_with_variants, host_ruby_version
Dir.chdir "#{workspace_dir}/#{gem_and_version}/pkg/" do
linux_platforms_with_variants.each do |platform|
assert File.exist? "#{gem_and_version}-#{platform}.gem"
assert_path_exists "#{gem_and_version}-#{platform}.gem"
FileUtils.rm_r "#{gem_and_version}-#{platform}"
exec_service.exec ["gem", "unpack", "#{gem_and_version}-#{platform}.gem"], out: :null
assert File.exist? "#{gem_and_version}-#{platform}/lib/google/protobuf_c.so"
assert_path_exists "#{gem_and_version}-#{platform}/lib/google/protobuf_c.so"
end
end
end
Expand All @@ -130,10 +127,10 @@ def quiet_build platforms, rubies
quiet_build darwin_platforms, host_ruby_version
Dir.chdir "#{workspace_dir}/#{gem_and_version}/pkg/" do
darwin_platforms.each do |platform|
assert File.exist? "#{gem_and_version}-#{platform}.gem"
assert_path_exists "#{gem_and_version}-#{platform}.gem"
FileUtils.rm_r "#{gem_and_version}-#{platform}"
exec_service.exec ["gem", "unpack", "#{gem_and_version}-#{platform}.gem"], out: :null
assert File.exist? "#{gem_and_version}-#{platform}/lib/google/protobuf_c.bundle"
assert_path_exists "#{gem_and_version}-#{platform}/lib/google/protobuf_c.bundle"
end
end
end
Expand All @@ -142,12 +139,12 @@ def quiet_build platforms, rubies
quiet_build windows_platforms, windows_ruby_versions
Dir.chdir "#{workspace_dir}/#{gem_and_version}/pkg/" do
windows_platforms.each do |platform|
assert File.exist? "#{gem_and_version}-#{platform}.gem"
assert_path_exists "#{gem_and_version}-#{platform}.gem"
FileUtils.rm_r "#{gem_and_version}-#{platform}"
exec_service.exec ["gem", "unpack", "#{gem_and_version}-#{platform}.gem"], out: :null
windows_ruby_versions.each do |ruby|
next if excluded_combinations.include? [platform, ruby]
assert File.exist? "#{gem_and_version}-#{platform}/lib/google/#{ruby}/protobuf_c.so"
assert_path_exists "#{gem_and_version}-#{platform}/lib/google/#{ruby}/protobuf_c.so"
end
end
end
Expand Down
14 changes: 6 additions & 8 deletions gas/.toys/gas/.test/test_kokoro_trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@
[
"arm64-darwin",
"x64-mingw-ucrt",
"x64-mingw32",
"x86-linux",
"x86-mingw32",
"x86_64-darwin",
"x86_64-linux"
]
end
let(:ruby_versions) { ["2.7", "3.0", "3.1", "3.2"] }
let(:ruby_versions) { ["3.1", "3.2", "3.3", "3.4", "4.0"] }
let(:gem_and_version) { "google-protobuf-3.25.2" }
let(:protobuf_env) do
{
Expand All @@ -60,8 +59,7 @@
end
let(:excluded_versions) do
{
"x64-mingw32" => ["3.1", "3.2", "3.3", "3.4"],
"x64-mingw-ucrt" => ["2.7", "3.0"]
"x86-mingw32" => ["4.0"],
}
end
let(:fake_gems) { ["fake-gem-1.0.gem", "fake-gem-2.0.gem"] }
Expand Down Expand Up @@ -119,28 +117,28 @@ def quiet_trigger noisy: false
assert_equal "0123456789abcdef", Gems.key

# Make sure we "published" the expected gems
assert_equal 10, found_content.size
assert_equal (gem_platforms.size + fake_gems.size + 1), found_content.size
assert_includes found_content, "fake gem 1.0"
assert_includes found_content, "fake gem 2.0"

# Make sure we built the expected gems
Dir.chdir "#{workspace_dir}/#{gem_and_version}/pkg/" do
gem_platforms.each do |platform|
assert File.exist? "#{gem_and_version}-#{platform}.gem"
assert_path_exists "#{gem_and_version}-#{platform}.gem"
FileUtils.rm_r "#{gem_and_version}-#{platform}"
exec_service.exec ["gem", "unpack", "#{gem_and_version}-#{platform}.gem"], out: :null
suffix = platform.include?("darwin") ? "bundle" : "so"
actual_ruby_versions = ruby_versions - excluded_versions.fetch(platform, [])
actual_ruby_versions.each do |ruby|
assert File.exist? "#{gem_and_version}-#{platform}/lib/google/#{ruby}/protobuf_c.#{suffix}"
assert_path_exists "#{gem_and_version}-#{platform}/lib/google/#{ruby}/protobuf_c.#{suffix}"
end
end
end

# Make sure we copied gems into the artifacts directory
gem_platforms.each do |platform|
artifact_name = "#{gem_and_version}-#{platform}.gem"
assert File.exist? "#{artifacts_dir}/#{artifact_name}"
assert_path_exists "#{artifacts_dir}/#{artifact_name}"
artifact_content = File.read "#{artifacts_dir}/#{artifact_name}"
original_content = File.read "#{workspace_dir}/#{gem_and_version}/pkg/#{artifact_name}"
assert_equal original_content, artifact_content
Expand Down