From 9a98aa66bea65ed47a309466a8e92806b8ff4fdcfb2c002917045d896420cfd4 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Wed, 30 Aug 2023 12:29:22 +0000 Subject: [PATCH 1/7] - Limit rust+cargo version >=1.65 and < 1.71 OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=74 --- helix.changes | 5 +++++ helix.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/helix.changes b/helix.changes index 4bca771..2cb7ca3 100644 --- a/helix.changes +++ b/helix.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 30 12:28:07 UTC 2023 - Soc Virnyl Estela + +- Limit rust+cargo version >=1.65 and < 1.71 + ------------------------------------------------------------------- Thu Jun 22 11:33:28 UTC 2023 - Eyad Issa diff --git a/helix.spec b/helix.spec index 06b7a85..afb93d3 100644 --- a/helix.spec +++ b/helix.spec @@ -37,6 +37,8 @@ Source4: helix-rpmlintrc BuildRequires: c++_compiler BuildRequires: c_compiler BuildRequires: cargo-packaging +BuildRequires: rust+cargo < 1.71 +BuildRequires: rust+cargo >= 1.65 BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files Recommends: %{name}-runtime = %{version} From 4da4475663f0f7614adf1136ff7cb83be041f36a87f0328cd8e2f58e4457ca8f Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Wed, 30 Aug 2023 12:36:30 +0000 Subject: [PATCH 2/7] - Rpm weirdness. So I set rust+cargo to 1.65 OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=75 --- helix.changes | 5 +++++ helix.spec | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helix.changes b/helix.changes index 2cb7ca3..1b27c4e 100644 --- a/helix.changes +++ b/helix.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 30 12:34:13 UTC 2023 - Soc Virnyl Estela + +- Rpm weirdness. So I set rust+cargo to 1.65 + ------------------------------------------------------------------- Wed Aug 30 12:28:07 UTC 2023 - Soc Virnyl Estela diff --git a/helix.spec b/helix.spec index afb93d3..404d8f6 100644 --- a/helix.spec +++ b/helix.spec @@ -37,8 +37,7 @@ Source4: helix-rpmlintrc BuildRequires: c++_compiler BuildRequires: c_compiler BuildRequires: cargo-packaging -BuildRequires: rust+cargo < 1.71 -BuildRequires: rust+cargo >= 1.65 +BuildRequires: rust+cargo = 1.65 BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files Recommends: %{name}-runtime = %{version} From 61e5c16b04d58a48bfaf60b4b1025fe8508094163354b0bc1116fa6e18d3bed2 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Wed, 30 Aug 2023 12:39:41 +0000 Subject: [PATCH 3/7] OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=76 --- helix.changes | 7 +------ helix.spec | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/helix.changes b/helix.changes index 1b27c4e..ceb2846 100644 --- a/helix.changes +++ b/helix.changes @@ -1,12 +1,7 @@ ------------------------------------------------------------------- Wed Aug 30 12:34:13 UTC 2023 - Soc Virnyl Estela -- Rpm weirdness. So I set rust+cargo to 1.65 - -------------------------------------------------------------------- -Wed Aug 30 12:28:07 UTC 2023 - Soc Virnyl Estela - -- Limit rust+cargo version >=1.65 and < 1.71 +- Limit cargo version >=1.65 and < 1.71 ------------------------------------------------------------------- Thu Jun 22 11:33:28 UTC 2023 - Eyad Issa diff --git a/helix.spec b/helix.spec index 404d8f6..04fce74 100644 --- a/helix.spec +++ b/helix.spec @@ -37,7 +37,8 @@ Source4: helix-rpmlintrc BuildRequires: c++_compiler BuildRequires: c_compiler BuildRequires: cargo-packaging -BuildRequires: rust+cargo = 1.65 +BuildRequires: cargo < 1.71 +BuildRequires: cargo > 1.65 BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files Recommends: %{name}-runtime = %{version} From d24acd35520b9e083ddbd64e810b8e828c1d2c18423c9d0f7661a9d84f8a3ad3 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Wed, 30 Aug 2023 12:42:43 +0000 Subject: [PATCH 4/7] OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=77 --- helix.changes | 2 +- helix.spec | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/helix.changes b/helix.changes index ceb2846..a665a3b 100644 --- a/helix.changes +++ b/helix.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Wed Aug 30 12:34:13 UTC 2023 - Soc Virnyl Estela -- Limit cargo version >=1.65 and < 1.71 +- Limit cargo version = 1.66 ------------------------------------------------------------------- Thu Jun 22 11:33:28 UTC 2023 - Eyad Issa diff --git a/helix.spec b/helix.spec index 04fce74..6d5c6bf 100644 --- a/helix.spec +++ b/helix.spec @@ -37,8 +37,7 @@ Source4: helix-rpmlintrc BuildRequires: c++_compiler BuildRequires: c_compiler BuildRequires: cargo-packaging -BuildRequires: cargo < 1.71 -BuildRequires: cargo > 1.65 +BuildRequires: rust+cargo 1.66 BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files Recommends: %{name}-runtime = %{version} From 0dcf9de743d5f3b223b46a4f63a5e3050e471ee0ca3449a91e90fa4b91eeea77 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Wed, 30 Aug 2023 12:45:54 +0000 Subject: [PATCH 5/7] OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=78 --- helix.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix.spec b/helix.spec index 6d5c6bf..6c42f53 100644 --- a/helix.spec +++ b/helix.spec @@ -37,7 +37,7 @@ Source4: helix-rpmlintrc BuildRequires: c++_compiler BuildRequires: c_compiler BuildRequires: cargo-packaging -BuildRequires: rust+cargo 1.66 +BuildRequires: cargo1.66 BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files Recommends: %{name}-runtime = %{version} From 6cf1e49dbbcc6372c6cf0f7fdbfbd79f2416b399286c714695c102d6806f4ac5 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Wed, 30 Aug 2023 12:52:08 +0000 Subject: [PATCH 6/7] OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=79 --- helix.changes | 5 +++++ helix.spec | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/helix.changes b/helix.changes index a665a3b..9a82538 100644 --- a/helix.changes +++ b/helix.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 30 12:51:00 UTC 2023 - Soc Virnyl Estela + +- Disable usage of cargo-packaging macros + ------------------------------------------------------------------- Wed Aug 30 12:34:13 UTC 2023 - Soc Virnyl Estela diff --git a/helix.spec b/helix.spec index 6c42f53..f6f3c88 100644 --- a/helix.spec +++ b/helix.spec @@ -36,7 +36,8 @@ Source3: README-suse-maint.md Source4: helix-rpmlintrc BuildRequires: c++_compiler BuildRequires: c_compiler -BuildRequires: cargo-packaging +# Cargo packaging seems to only want the latest version of rust+cargo +# BuildRequires: cargo-packaging BuildRequires: cargo1.66 BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files @@ -96,8 +97,8 @@ sed -e '/^\#\!\/usr\/bin\/env .*/d' -i contrib/completion/hx.* %build export HELIX_DISABLE_AUTO_GRAMMAR_BUILD=true export TARGET="%_arch" -%{cargo_build} -cargo run --release -- --grammar build +cargo build --release --offline +cargo run --release --offline -- --grammar build # Shell completions sed -i "s|hx|helix|g" contrib/completion/hx.* From 2aafa4f410490b55cb99bb56f2f13d1bf2d14dfa194980a6a63b203b8a09fc15 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Thu, 31 Aug 2023 23:44:52 +0000 Subject: [PATCH 7/7] - Add 0001-fix-ub-in-diff-gutter.patch. * This fixes issues when building helix with Rust >1.71. In the future, This will be removed once a fix lands on the `ropey` crate which was the cause of the issue. - Reenable usage of cargo-packaging macros - Remove explicit dependency declaration of cargo1.66 to use latest Rust. OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=80 --- 0001-fix-ub-in-diff-gutter.patch | 68 ++++++++++++++++++++++++++++++++ helix.changes | 10 +++++ helix.spec | 7 ++-- 3 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 0001-fix-ub-in-diff-gutter.patch diff --git a/0001-fix-ub-in-diff-gutter.patch b/0001-fix-ub-in-diff-gutter.patch new file mode 100644 index 0000000..2bad1e2 --- /dev/null +++ b/0001-fix-ub-in-diff-gutter.patch @@ -0,0 +1,68 @@ +From 269f637847140ddb9537efde4968bd92c91c9e1e Mon Sep 17 00:00:00 2001 +From: Pascal Kuthe +Date: Sun, 4 Jun 2023 16:59:01 +0200 +Subject: [PATCH] fix UB in diff gutter + +--- + helix-vcs/src/diff/line_cache.rs | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/helix-vcs/src/diff/line_cache.rs b/helix-vcs/src/diff/line_cache.rs +index 8e48250f157e..460a2065e8ed 100644 +--- a/helix-vcs/src/diff/line_cache.rs ++++ b/helix-vcs/src/diff/line_cache.rs +@@ -20,8 +20,8 @@ use super::{MAX_DIFF_BYTES, MAX_DIFF_LINES}; + /// A cache that stores the `lines` of a rope as a vector. + /// It allows safely reusing the allocation of the vec when updating the rope + pub(crate) struct InternedRopeLines { +- diff_base: Rope, +- doc: Rope, ++ diff_base: Box, ++ doc: Box, + num_tokens_diff_base: u32, + interned: InternedInput>, + } +@@ -34,8 +34,8 @@ impl InternedRopeLines { + after: Vec::with_capacity(doc.len_lines()), + interner: Interner::new(diff_base.len_lines() + doc.len_lines()), + }, +- diff_base, +- doc, ++ diff_base: Box::new(diff_base), ++ doc: Box::new(doc), + // will be populated by update_diff_base_impl + num_tokens_diff_base: 0, + }; +@@ -44,19 +44,19 @@ impl InternedRopeLines { + } + + pub fn doc(&self) -> Rope { +- self.doc.clone() ++ Rope::clone(&*self.doc) + } + + pub fn diff_base(&self) -> Rope { +- self.diff_base.clone() ++ Rope::clone(&*self.diff_base) + } + + /// Updates the `diff_base` and optionally the document if `doc` is not None + pub fn update_diff_base(&mut self, diff_base: Rope, doc: Option) { + self.interned.clear(); +- self.diff_base = diff_base; ++ self.diff_base = Box::new(diff_base); + if let Some(doc) = doc { +- self.doc = doc ++ self.doc = Box::new(doc) + } + if !self.is_too_large() { + self.update_diff_base_impl(); +@@ -74,7 +74,7 @@ impl InternedRopeLines { + .interner + .erase_tokens_after(self.num_tokens_diff_base.into()); + +- self.doc = doc; ++ self.doc = Box::new(doc); + if self.is_too_large() { + self.interned.after.clear(); + } else { diff --git a/helix.changes b/helix.changes index 9a82538..877bb91 100644 --- a/helix.changes +++ b/helix.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Aug 31 23:40:52 UTC 2023 - Soc Virnyl Estela + +- Add 0001-fix-ub-in-diff-gutter.patch. + * This fixes issues when building helix with Rust >1.71. In the future, + This will be removed once a fix lands on the `ropey` crate which was the + cause of the issue. +- Reenable usage of cargo-packaging macros +- Remove explicit dependency declaration of cargo1.66 to use latest Rust. + ------------------------------------------------------------------- Wed Aug 30 12:51:00 UTC 2023 - Soc Virnyl Estela diff --git a/helix.spec b/helix.spec index f6f3c88..9aa1fe1 100644 --- a/helix.spec +++ b/helix.spec @@ -34,11 +34,10 @@ Source1: vendor.tar.xz Source2: cargo_config Source3: README-suse-maint.md Source4: helix-rpmlintrc +Patch1: https://github.com/helix-editor/helix/pull/7227.patch#/0001-fix-ub-in-diff-gutter.patch BuildRequires: c++_compiler BuildRequires: c_compiler -# Cargo packaging seems to only want the latest version of rust+cargo -# BuildRequires: cargo-packaging -BuildRequires: cargo1.66 +BuildRequires: cargo-packaging BuildRequires: hicolor-icon-theme BuildRequires: update-desktop-files Recommends: %{name}-runtime = %{version} @@ -97,7 +96,7 @@ sed -e '/^\#\!\/usr\/bin\/env .*/d' -i contrib/completion/hx.* %build export HELIX_DISABLE_AUTO_GRAMMAR_BUILD=true export TARGET="%_arch" -cargo build --release --offline +%{cargo_build} cargo run --release --offline -- --grammar build # Shell completions