From fa8c56b8c40a6628772371ba45cbc00a30b46145 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Sat, 31 Dec 2022 11:41:31 -0800 Subject: [PATCH] Bump Ruby checkout to 3.0 (#400) * Bump checkout to 3.0 * Fix build * Fix Ruby initialization * Update now-invalid fixture * Rollback gc change --- fixtures/small/nested_destructuring_actual.rb | 2 +- .../small/nested_destructuring_expected.rb | 2 +- librubyfmt/build.rs | 6 ++-- librubyfmt/ruby_checkout | 2 +- librubyfmt/rubyfmt_lib.rb | 34 +++++++++---------- librubyfmt/src/lib.rs | 2 ++ 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/fixtures/small/nested_destructuring_actual.rb b/fixtures/small/nested_destructuring_actual.rb index 290bd308..362464b6 100644 --- a/fixtures/small/nested_destructuring_actual.rb +++ b/fixtures/small/nested_destructuring_actual.rb @@ -1 +1 @@ -_1, (_2, _3) = [] +_a, (_b, _c) = [] diff --git a/fixtures/small/nested_destructuring_expected.rb b/fixtures/small/nested_destructuring_expected.rb index 290bd308..362464b6 100644 --- a/fixtures/small/nested_destructuring_expected.rb +++ b/fixtures/small/nested_destructuring_expected.rb @@ -1 +1 @@ -_1, (_2, _3) = [] +_a, (_b, _c) = [] diff --git a/librubyfmt/build.rs b/librubyfmt/build.rs index ef94c098..e00752f6 100644 --- a/librubyfmt/build.rs +++ b/librubyfmt/build.rs @@ -10,11 +10,11 @@ fn main() -> Output { #[cfg(target_os = "linux")] let libname = "ruby-static"; #[cfg(target_os = "macos")] - let libname = "ruby.2.7-static"; + let libname = "ruby.3.0-static"; #[cfg(all(target_arch = "x86_64", windows))] - let libname = "x64-vcruntime140-ruby270-static"; + let libname = "x64-vcruntime140-ruby300-static"; #[cfg(all(target_arch = "x86", windows))] - let libname = "vcruntime140-ruby270-static"; + let libname = "vcruntime140-ruby300-static"; #[cfg(all(target_env = "gnu", windows))] compile_error!("rubyfmt on Windows is currently only supported with msvc"); diff --git a/librubyfmt/ruby_checkout b/librubyfmt/ruby_checkout index 7b413c1d..a0a99185 160000 --- a/librubyfmt/ruby_checkout +++ b/librubyfmt/ruby_checkout @@ -1 +1 @@ -Subproject commit 7b413c1db3e65909c6899e1d3be4d16c3e76149c +Subproject commit a0a99185577794b1915eba0dc5154f09cc95e81d diff --git a/librubyfmt/rubyfmt_lib.rb b/librubyfmt/rubyfmt_lib.rb index 13f7dbee..94e282da 100644 --- a/librubyfmt/rubyfmt_lib.rb +++ b/librubyfmt/rubyfmt_lib.rb @@ -146,25 +146,25 @@ def escape_percent_array_paren_content(part, pattern) define_method(:"on_#{event}_add") do |parts, part| delim = parts[1][0][1] - parts.tap do |node| - unless delim.end_with?('[') - delim_start = delim[-1] - delim_close = DELIM_CLOSE_PAREN[delim_start] - pattern = if delim_close - /(?); @@ -193,6 +194,7 @@ unsafe fn load_ripper() -> Result<(), ()> { "../ruby_checkout/ext/ripper/lib/ripper/sexp.rb" ))?; + rb_gc_disable(); Ok(()) }