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

Clean up Ruby patch release overrides #496

Merged
merged 1 commit into from
Jan 21, 2025
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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ gemspec path: "examples/rust_reverse"
gem "rake", "~> 13.0"
gem "minitest", "5.15.0"
gem "rake-compiler", "~> 1.2.5" # Small bug in 1.2.4 that breaks Ruby 2.5
gem "rake-compiler-dock", "1.9.1" # This should match the versions used in docker/Dockerfile.*
gem "racc", "~> 1.7"
gem "base64", "~> 0.2.0"
gem "yard"
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.aarch64-linux
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-aarch64-linux
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-aarch64-linux

Copy link
Contributor Author

@stanhu stanhu Jan 21, 2025

Choose a reason for hiding this comment

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

Should we template these files?

UPDATE: I see Dependabot is configured to update both the Gemfile and Dockerfiles separately. Perhaps we can just live with merging separate pull requests at the same time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

One downside is that dependabot has a limit of PRs it will open, and it can be hard to know if all dockerfiles were updated properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand your concern correctly: Dependabot now supports grouped updates so you can open one PR for multiple dependencies, rather than one per.

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="aarch64-linux" \
RUST_TARGET="aarch64-unknown-linux-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.aarch64-linux-musl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-aarch64-linux-musl
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-aarch64-linux-musl

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="aarch64-linux-musl" \
RUST_TARGET="aarch64-unknown-linux-musl" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.arm-linux
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-arm-linux
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-arm-linux

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="arm-linux" \
RUST_TARGET="arm-unknown-linux-gnueabihf" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.arm64-darwin
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-arm64-darwin
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-arm64-darwin

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="arm64-darwin" \
RUST_TARGET="aarch64-apple-darwin" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x64-mingw-ucrt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x64-mingw-ucrt
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x64-mingw-ucrt

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x64-mingw-ucrt" \
RUST_TARGET="x86_64-pc-windows-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x64-mingw32
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x64-mingw32
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x64-mingw32

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x64-mingw32" \
RUST_TARGET="x86_64-pc-windows-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x86-linux
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x86-linux
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86-linux

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x86-linux" \
RUST_TARGET="i686-unknown-linux-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x86-mingw32
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x86-mingw32
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86-mingw32

ARG LLVM_MINGW_VERSION=20231128 \
LLVM_MINGW_SHA256=2d532648bfd202bfe5edfa8b7f6c55970f65639779f34115a9a8bfa6f7d87f0b \
LLVM_MINGW_LIBCLANG_VERSION=14.0.0

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x86-mingw32" \
RUST_TARGET="i686-pc-windows-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x86_64-darwin
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x86_64-darwin
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86_64-darwin

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x86_64-darwin" \
RUST_TARGET="x86_64-apple-darwin" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x86_64-linux
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x86_64-linux
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86_64-linux

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x86_64-linux" \
RUST_TARGET="x86_64-unknown-linux-gnu" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.x86_64-linux-musl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.8.0-mri-x86_64-linux-musl
# Ensure this version matches the rack-compiler-version in Gemfile
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.9.1-mri-x86_64-linux-musl

ENV RUBY_CC_VERSION="3.4.1:3.3.5:3.2.6:3.1.6:3.0.7:2.7.8:2.6.10" \
ENV RUBY_CC_VERSION="3.4:3.3:3.2:3.1:3.0:2.7:2.6" \
RUBY_TARGET="x86_64-linux-musl" \
RUST_TARGET="x86_64-unknown-linux-musl" \
RUSTUP_DEFAULT_TOOLCHAIN="stable" \
Expand Down
13 changes: 2 additions & 11 deletions gem/exe/rb-sys-dock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)

require "optparse"
require "open3"
require "rake_compiler_dock"
require "rb_sys/version"
require "rb_sys/toolchain_info"
require "rb_sys/cargo/metadata"
Expand All @@ -17,16 +18,6 @@ OPTIONS = {
directory: Dir.pwd
}

PATCH_RELEASE_OVERRIDES = {
"2.6" => "2.6.10",
"2.7" => "2.7.8",
"3.0" => "3.0.7",
"3.1" => "3.1.6",
"3.2" => "3.2.6",
"3.3" => "3.3.5",
"3.4" => "3.4.1"
}

def cargo_metadata
return @cargo_metadata if defined?(@cargo_metadata)

Expand Down Expand Up @@ -110,7 +101,7 @@ OptionParser.new do |opts|

opts.on("-r", "--ruby-versions LIST", "List all supported Ruby versions") do |arg|
vers = arg.split(/[^0-9.]+/).map do |v|
override = PATCH_RELEASE_OVERRIDES[v]
override = RakeCompilerDock.cross_rubies[v]

next override if override

Expand Down
Loading