celeste: fix rustc 1.85.0 errors (#461968)
This commit is contained in:
25
pkgs/by-name/ce/celeste/missing-unsafe-block.patch
Normal file
25
pkgs/by-name/ce/celeste/missing-unsafe-block.patch
Normal 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
|
||||||
|
|
||||||
@@ -31,6 +31,9 @@ rustPlatform.buildRustPackage rec {
|
|||||||
|
|
||||||
cargoHash = "sha256-OBGDnhpVLOPdYhofWfeaueklt7KBkLhM02JNvuvUQ2Q=";
|
cargoHash = "sha256-OBGDnhpVLOPdYhofWfeaueklt7KBkLhM02JNvuvUQ2Q=";
|
||||||
|
|
||||||
|
# rust 2024 requires that you put an unsafe block around std::env::set_var
|
||||||
|
patches = [ ./missing-unsafe-block.patch ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
pushd $cargoDepsCopy/librclone-sys-*
|
pushd $cargoDepsCopy/librclone-sys-*
|
||||||
oldHash=$(sha256sum build.rs | cut -d " " -f 1)
|
oldHash=$(sha256sum build.rs | cut -d " " -f 1)
|
||||||
@@ -45,6 +48,10 @@ rustPlatform.buildRustPackage rec {
|
|||||||
--replace "{{ env_var('DESTDIR') }}/usr" "${placeholder "out"}"
|
--replace "{{ env_var('DESTDIR') }}/usr" "${placeholder "out"}"
|
||||||
# buildRustPackage takes care of installing the binary
|
# buildRustPackage takes care of installing the binary
|
||||||
sed -i "#/bin/celeste#d" justfile
|
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;
|
RUSTC_BOOTSTRAP = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user