diff --git a/0001-update_agent-adapt-to-actix-0.10-API-changes.patch b/0001-update_agent-adapt-to-actix-0.10-API-changes.patch new file mode 100644 index 0000000..cbd49b6 --- /dev/null +++ b/0001-update_agent-adapt-to-actix-0.10-API-changes.patch @@ -0,0 +1,121 @@ +From 231d7cba7fb42924f85f21743923bd404eef9d1a Mon Sep 17 00:00:00 2001 +From: Luca BRUNO +Date: Tue, 29 Sep 2020 07:24:03 +0000 +Subject: [PATCH] update_agent: adapt to actix-0.10 API changes + +--- + src/update_agent/actor.rs | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/update_agent/actor.rs b/src/update_agent/actor.rs +index ed51db2..65a2891 100644 +--- a/src/update_agent/actor.rs ++++ b/src/update_agent/actor.rs +@@ -99,7 +99,7 @@ impl Handler for UpdateAgent { + // Process state machine refresh ticks sequentially. + ctx.wait(update_machine); + +- Box::new(actix::fut::ok(())) ++ Box::pin(actix::fut::ok(())) + } + } + +@@ -164,7 +164,7 @@ impl UpdateAgent { + Ok(()) + }); + +- Box::new(initialization) ++ Box::pin(initialization) + } + + /// Try to report steady state. +@@ -181,7 +181,7 @@ impl UpdateAgent { + Ok(()) + }); + +- Box::new(state_change) ++ Box::pin(state_change) + } + + /// Try to check for updates. +@@ -210,7 +210,7 @@ impl UpdateAgent { + Ok(()) + }); + +- Box::new(state_change) ++ Box::pin(state_change) + } + + /// Try to stage an update. +@@ -227,7 +227,7 @@ impl UpdateAgent { + Ok(()) + }); + +- Box::new(state_change) ++ Box::pin(state_change) + } + + /// Try to finalize an update. +@@ -242,7 +242,7 @@ impl UpdateAgent { + .then(|can_finalize, actor, _ctx| actor.finalize_deployment(can_finalize, release)) + .map(|res, actor, _ctx| res.map(|release| actor.state.update_finalized(release))); + +- Box::new(state_change) ++ Box::pin(state_change) + } + + /// Actor job is done. +@@ -253,7 +253,7 @@ impl UpdateAgent { + Ok(()) + }); + +- Box::new(state_change) ++ Box::pin(state_change) + } + + /// Fetch and stage an update, in finalization-locked mode. +@@ -273,7 +273,7 @@ impl UpdateAgent { + .map_err(|e| log::error!("failed to stage deployment: {}", e)) + .into_actor(self); + +- Box::new(upgrade) ++ Box::pin(upgrade) + } + + /// Record a failed deploy attempt. +@@ -304,7 +304,7 @@ impl UpdateAgent { + }) + .into_actor(self); + +- Box::new(depls) ++ Box::pin(depls) + } + + /// Finalize a deployment (unlock and reboot). +@@ -314,7 +314,7 @@ impl UpdateAgent { + release: Release, + ) -> ResponseActFuture> { + if !can_finalize { +- return Box::new(actix::fut::err(())); ++ return Box::pin(actix::fut::err(())); + } + + log::info!( +@@ -329,12 +329,12 @@ impl UpdateAgent { + .map_err(|e| log::error!("failed to finalize deployment: {}", e)) + .into_actor(self); + +- Box::new(upgrade) ++ Box::pin(upgrade) + } + + /// Do nothing, without errors. + fn nop(&mut self) -> ResponseActFuture> { + let nop = actix::fut::ok(()); +- Box::new(nop) ++ Box::pin(nop) + } + } +-- +2.28.0 + diff --git a/rust-zincati.spec b/rust-zincati.spec index 8435d71..09eb285 100644 --- a/rust-zincati.spec +++ b/rust-zincati.spec @@ -16,6 +16,9 @@ Source: %{crates_source} # Initial patched metadata # - Update actix from ^0.9 to 0.10.0 Patch0: zincati-fix-metadata.diff +# Port to the new actix. Can drop after next upstream release. +# https://github.com/coreos/zincati/commit/231d7cb +Patch1: 0001-update_agent-adapt-to-actix-0.10-API-changes.patch ExclusiveArch: %{rust_arches} @@ -79,9 +82,6 @@ License: ASL 2.0 and BSD and MIT and MPLv2.0 and zlib %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 -# Port to the new actix -# No longer needed after https://github.com/coreos/zincati/pull/359 -sed -i -e "s/Box::new/Box::pin/g" src/update_agent/actor.rs %cargo_prep %generate_buildrequires