From 4c05749d02550a3c57f2cbfd508005c5169468fe Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Fri, 6 Jun 2025 19:22:09 -0500 Subject: [PATCH] Rediff patches Add 0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch: Add 0001-Rust-edition-downgrade-to-2021.patch: --- .../0001-Rust-edition-downgrade-to-2021.patch | 23 ++++++++++++++ ...ust-1.81-compatible-file-exists-test.patch | 31 +++++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 56 insertions(+) create mode 100644 debian/patches/0001-Rust-edition-downgrade-to-2021.patch create mode 100644 debian/patches/0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch create mode 100644 debian/patches/series diff --git a/debian/patches/0001-Rust-edition-downgrade-to-2021.patch b/debian/patches/0001-Rust-edition-downgrade-to-2021.patch new file mode 100644 index 0000000..1a47ba4 --- /dev/null +++ b/debian/patches/0001-Rust-edition-downgrade-to-2021.patch @@ -0,0 +1,23 @@ +From: Robert Garrett +Date: Sun, 1 Jun 2025 17:59:20 -0500 +Subject: Rust edition downgrade to 2021 + +Debian Bookworm uses Rust 1.64 which only supports up to the 2021 +edition. +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index febccc4..cf52754 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -1,7 +1,7 @@ + [package] + name = "gt-tool" + version = "1.0.0" +-edition = "2024" ++edition = "2021" + + [dependencies] + clap = { version = "4.0.7", features = ["derive", "env"] } diff --git a/debian/patches/0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch b/debian/patches/0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch new file mode 100644 index 0000000..0083f7e --- /dev/null +++ b/debian/patches/0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch @@ -0,0 +1,31 @@ +From: Robert Garrett +Date: Sun, 1 Jun 2025 18:01:21 -0500 +Subject: Use pre Rust 1.81 compatible file-exists test + +The function `std::fs::exists(...)` was stabilized in Rust 1.81, which +means it can't be used in the Debian Bookworm build. This patch swaps to +a compatible implementation leaning on the std::path::Path struct. +--- + src/api/release_attachment.rs | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/api/release_attachment.rs b/src/api/release_attachment.rs +index 9af71bf..8a0c798 100644 +--- a/src/api/release_attachment.rs ++++ b/src/api/release_attachment.rs +@@ -1,4 +1,4 @@ +-use std::fs; ++use std::{fs, path}; + + pub fn check_release_match_repo() {} + pub fn get_release_attachment() {} +@@ -16,7 +16,8 @@ pub async fn create_release_attachment( + + // Ensure all files exists before starting the uploads + for file in &files { +- match fs::exists(file) { ++ let path = path::Path::new(file); ++ match path.try_exists() { + Ok(true) => continue, + Ok(false) => return Err(crate::Error::NoSuchFile), + Err(e) => { diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..5e36914 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +0001-Rust-edition-downgrade-to-2021.patch +0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch