Package: release.debian.org Severity: normal Tags: buster User: release.debian....@packages.debian.org Usertags: pu
rust-rustyline fails to build in buster due to a change of behaviour in rustc, this has been fixed in bullseye/sid for some time and I was able to locate the upstream commit that fixes the failure by bisecting and then apply it to the package from buster. I have tested the patched package builds and I have also run the upstream testsuite (which passed). rust-rustyline does not appear to have any reverse dependencies.
diff -Nru rust-rustyline-3.0.0/debian/changelog rust-rustyline-3.0.0/debian/changelog --- rust-rustyline-3.0.0/debian/changelog 2019-02-03 20:19:06.000000000 +0000 +++ rust-rustyline-3.0.0/debian/changelog 2021-05-04 09:27:11.000000000 +0000 @@ -1,3 +1,11 @@ +rust-rustyline (3.0.0-2+deb10u1) buster; urgency=medium + + * Team upload. + * Apply upstream patch to fix build with newer rustc. + (Closes: 988025) + + -- Peter Michael Green <plugw...@debian.org> Tue, 04 May 2021 09:27:11 +0000 + rust-rustyline (3.0.0-2) unstable; urgency=medium * Package rustyline 3.0.0 from crates.io using debcargo 2.2.10 diff -Nru rust-rustyline-3.0.0/debian/patches/newer-rustc.patch rust-rustyline-3.0.0/debian/patches/newer-rustc.patch --- rust-rustyline-3.0.0/debian/patches/newer-rustc.patch 1970-01-01 00:00:00.000000000 +0000 +++ rust-rustyline-3.0.0/debian/patches/newer-rustc.patch 2021-05-04 09:26:41.000000000 +0000 @@ -0,0 +1,49 @@ +commit e383956f3fc9f313d8cf979f1a9772bea9eb1eb8 +Author: gwenn <gtregu...@gmail.com> +Date: Fri May 17 19:20:14 2019 +0200 + + Try to fix nightly build + + See #217 + +diff --git a/examples/example.rs b/examples/example.rs +index 8bb2e7e..204791f 100644 +--- a/examples/example.rs ++++ b/examples/example.rs +@@ -80,8 +80,8 @@ fn main() { + loop { + let readline = rl.readline(PROMPT); + match readline { +- Ok(line) => { +- rl.add_history_entry(line.as_ref()); ++ Ok(ref line) => { ++ rl.add_history_entry(line); + println!("Line: {}", line); + } + Err(ReadlineError::Interrupted) => { +diff --git a/src/history.rs b/src/history.rs +index b1cb596..b7cc317 100644 +--- a/src/history.rs ++++ b/src/history.rs +@@ -148,7 +148,7 @@ impl History { + let file = File::open(&path)?; + let rdr = BufReader::new(file); + for line in rdr.lines() { +- self.add(line?.as_ref()); // TODO truncate to MAX_LINE ++ self.add(line?); // TODO truncate to MAX_LINE + } + Ok(()) + } +diff --git a/src/lib.rs b/src/lib.rs +index 4f6162b..54672fb 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -624,7 +624,7 @@ fn readline_raw<H: Helper>( + let user_input = readline_edit(prompt, initial, editor, &original_mode); + if editor.config.auto_add_history() { + if let Ok(ref line) = user_input { +- editor.add_history_entry(line.as_ref()); ++ editor.add_history_entry(line); + } + } + drop(guard); // disable_raw_mode(original_mode)?; diff -Nru rust-rustyline-3.0.0/debian/patches/series rust-rustyline-3.0.0/debian/patches/series --- rust-rustyline-3.0.0/debian/patches/series 2019-02-03 20:19:06.000000000 +0000 +++ rust-rustyline-3.0.0/debian/patches/series 2021-05-04 09:27:05.000000000 +0000 @@ -1 +1,2 @@ relax-dep-version.patch +newer-rustc.patch