From b3f9795da8bf2a4de45a9e8944163102e2dea817 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Thu, 29 Dec 2022 21:55:27 -0600 Subject: [PATCH 1/5] Bump checkout to 3.0 --- librubyfmt/ruby_checkout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From dc89759baaa6ed8080e43439c9c9b62b3001e797 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Thu, 29 Dec 2022 21:55:40 -0600 Subject: [PATCH 2/5] Fix build --- librubyfmt/build.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/librubyfmt/build.rs b/librubyfmt/build.rs index ef94c098..f4764f36 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"); @@ -51,6 +51,7 @@ fn main() -> Output { cc::Build::new() .file("src/rubyfmt.c") .object(ruby_checkout_path.join(&ripper)) + .object(ruby_checkout_path.join("gc.o")) .include(ruby_checkout_path.join("include")) .include(ruby_checkout_path.join(".ext/include/arm64-darwin20")) .include(ruby_checkout_path.join(".ext/include/arm64-darwin21")) From a9f01706c3d3e143b4f1afbcbee504f14f327323 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Thu, 29 Dec 2022 22:06:06 -0600 Subject: [PATCH 3/5] Fix Ruby initialization --- librubyfmt/rubyfmt_lib.rb | 34 ++++++++++++++++------------------ librubyfmt/src/lib.rs | 2 ++ 2 files changed, 18 insertions(+), 18 deletions(-) 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(()) } From 5e0b0514419329d8c03de2d7ef349cf344106ad6 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Thu, 29 Dec 2022 22:06:18 -0600 Subject: [PATCH 4/5] Update now-invalid fixture --- fixtures/small/nested_destructuring_actual.rb | 2 +- fixtures/small/nested_destructuring_expected.rb | 2 +- 2 files changed, 2 insertions(+), 2 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) = [] From 7b3c833affac0cbd5e42a84155cfab2c5e60a4f7 Mon Sep 17 00:00:00 2001 From: Reese Williams Date: Thu, 29 Dec 2022 22:59:21 -0800 Subject: [PATCH 5/5] Rollback gc change --- librubyfmt/build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/librubyfmt/build.rs b/librubyfmt/build.rs index f4764f36..e00752f6 100644 --- a/librubyfmt/build.rs +++ b/librubyfmt/build.rs @@ -51,7 +51,6 @@ fn main() -> Output { cc::Build::new() .file("src/rubyfmt.c") .object(ruby_checkout_path.join(&ripper)) - .object(ruby_checkout_path.join("gc.o")) .include(ruby_checkout_path.join("include")) .include(ruby_checkout_path.join(".ext/include/arm64-darwin20")) .include(ruby_checkout_path.join(".ext/include/arm64-darwin21"))