celeste: fix rustc 1.85.0 errors (#461968)

This commit is contained in:
Aleksana
2025-11-16 14:14:30 +00:00
committed by GitHub
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
From 96ec13b49ee2fcb2869f87b1f9e8c6cfc92275df Mon Sep 17 00:00:00 2001
From: Tom van Dijk <18gatenmaker6@gmail.com>
Date: Fri, 14 Nov 2025 18:55:40 +0100
Subject: [PATCH] rust 2024 fixes
---
src/main.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
index 127f649..5ef526e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -103,7 +103,7 @@ fn main() {
}
} else {
// Set `RUST_BACKTRACE` so we get a better backtrace for reporting.
- env::set_var("RUST_BACKTRACE", "1");
+ unsafe { env::set_var("RUST_BACKTRACE", "1"); }
// Run the command and get the stderr, checking for a backtrace.
let mut args = vec!["run-gui"];
--
2.51.0

View File

@@ -31,6 +31,9 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-OBGDnhpVLOPdYhofWfeaueklt7KBkLhM02JNvuvUQ2Q=";
# rust 2024 requires that you put an unsafe block around std::env::set_var
patches = [ ./missing-unsafe-block.patch ];
postPatch = ''
pushd $cargoDepsCopy/librclone-sys-*
oldHash=$(sha256sum build.rs | cut -d " " -f 1)
@@ -45,6 +48,10 @@ rustPlatform.buildRustPackage rec {
--replace "{{ env_var('DESTDIR') }}/usr" "${placeholder "out"}"
# buildRustPackage takes care of installing the binary
sed -i "#/bin/celeste#d" justfile
# fix: as of rust 1.85, it is required that you specify edition 2024 for let chains
substituteInPlace Cargo.toml \
--replace-warn 'edition = "2021"' 'edition = "2024"'
'';
RUSTC_BOOTSTRAP = 1;