Aleksei Bavshin: 2 deps: update tokio to 1.0 deps: update nix and other dependencies 11 files changed, 18 insertions(+), 18 deletions(-)
greetd/patches: FAILED in 59s [deps: update tokio to 1.0][0] from [Aleksei Bavshin][1] [0]: https://lists.sr.ht/~kennylevinsen/greetd-devel/patches/19574 [1]: mailto:alebastr89@gmail.com ✗ #397238 FAILED greetd/patches/alpine.yml https://builds.sr.ht/~kennylevinsen/job/397238 ✗ #397239 FAILED greetd/patches/archlinux.yml https://builds.sr.ht/~kennylevinsen/job/397239
Applied, thanks!
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.sr.ht/~kennylevinsen/greetd-devel/patches/19574/mbox | git am -3Learn more about email & git
--- fakegreet/Cargo.toml | 2 +- fakegreet/src/main.rs | 10 +++++----- greetd/Cargo.toml | 2 +- greetd/src/context.rs | 4 ++-- greetd/src/main.rs | 2 +- greetd/src/server.rs | 2 +- greetd_ipc/Cargo.toml | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fakegreet/Cargo.toml b/fakegreet/Cargo.toml index 6325823..cb5bc5c 100644 --- a/fakegreet/Cargo.toml +++ b/fakegreet/Cargo.toml @@ -10,5 +10,5 @@ repository = "https://git.sr.ht/~kennylevinsen/greetd/" [dependencies] serde = { version = "1.0", features = ["derive"] } greetd_ipc = { path = "../greetd_ipc", features = ["tokio-codec"] } -tokio = { version = "0.2", features = ["process"] } +tokio = { version = "1.0", features = ["process"] } thiserror = "1.0" diff --git a/fakegreet/src/main.rs b/fakegreet/src/main.rs index a8f400a..0a23c77 100644 --- a/fakegreet/src/main.rs +++ b/fakegreet/src/main.rs @@ -6,7 +6,7 @@ use tokio::{ net::{UnixListener, UnixStream}, process::Command, task, - time::delay_for, + time::sleep, }; use crate::error::Error; @@ -82,7 +82,7 @@ impl Context { || s.password != Some("password".to_string()) || response != Some("9".to_string()) { - delay_for(Duration::from_millis(2000)).await; + sleep(Duration::from_millis(2000)).await; return Err(Error::AuthError("nope".to_string())); } s.ok = true; @@ -94,7 +94,7 @@ impl Context { if !self.inner.borrow().ok { return Err(Error::Error("not yet dammit".to_string())); } - delay_for(Duration::from_millis(5000)).await; + sleep(Duration::from_millis(5000)).await; Ok(()) } @@ -151,7 +151,7 @@ pub async fn server() -> Result<(), Error> { std::env::set_var("GREETD_SOCK", path); let _ = std::fs::remove_file(path); - let mut listener = + let listener = UnixListener::bind(path).map_err(|e| format!("unable to open listener: {}", e))?; let arg = env::args().nth(1).expect("need argument"); @@ -174,7 +174,7 @@ pub async fn server() -> Result<(), Error> { } } -#[tokio::main] +#[tokio::main(flavor = "current_thread")] async fn main() { let res = task::LocalSet::new() .run_until(async move { server().await }) diff --git a/greetd/Cargo.toml b/greetd/Cargo.toml index af2b0d9..abf842a 100644 --- a/greetd/Cargo.toml +++ b/greetd/Cargo.toml @@ -19,7 +19,7 @@ serde_json = "1.0" greetd_ipc = { path = "../greetd_ipc", features = ["tokio-codec"] } inish = { path = "../inish" } libc = "0.2" -tokio = { version = "0.2", features = ["net", "sync", "macros", "signal", "rt-util", "io-util", "time"] } +tokio = { version = "1.0", features = ["net", "sync", "macros", "signal", "rt", "io-util", "time"] } getopts = "0.2" thiserror = "1.0" async-trait = "0.1" diff --git a/greetd/src/context.rs b/greetd/src/context.rs index a12f9e1..0d7fe97 100644 --- a/greetd/src/context.rs +++ b/greetd/src/context.rs @@ -4,7 +4,7 @@ use nix::{ sys::wait::{waitpid, WaitPidFlag, WaitStatus}, unistd::alarm, }; -use tokio::{sync::RwLock, time::delay_for}; +use tokio::{sync::RwLock, time::sleep}; use crate::{ error::Error, @@ -341,7 +341,7 @@ impl Context { return Err("greeter exited without creating a session".into()); } if sesion_length < Duration::from_secs(1) { - delay_for(Duration::from_secs(1)).await; + sleep(Duration::from_secs(1)).await; } inner.current = Some(SessionChildSet { child: self.start_greeter().await?, diff --git a/greetd/src/main.rs b/greetd/src/main.rs index aecfa7d..b88c6dc 100644 --- a/greetd/src/main.rs +++ b/greetd/src/main.rs @@ -29,7 +29,7 @@ async fn session_worker_main(config: config::Config) -> Result<(), Error> { worker::main(&sock) } -#[tokio::main] +#[tokio::main(flavor = "current_thread")] async fn main() { let config = match config::read_config() { Ok(config) => config, diff --git a/greetd/src/server.rs b/greetd/src/server.rs index b094ced..9ad1a4f 100644 --- a/greetd/src/server.rs +++ b/greetd/src/server.rs @@ -211,7 +211,7 @@ pub async fn main(config: Config) -> Result<(), Error> { let uid = Uid::from_raw(u.uid()); let gid = Gid::from_raw(u.primary_group_id()); - let mut listener = Listener::create(uid, gid)?; + let listener = Listener::create(uid, gid)?; let term_mode = get_tty(&config)?; diff --git a/greetd_ipc/Cargo.toml b/greetd_ipc/Cargo.toml index e25265b..0f11817 100644 --- a/greetd_ipc/Cargo.toml +++ b/greetd_ipc/Cargo.toml @@ -20,6 +20,6 @@ tokio-codec = ["codec", "tokio", "async-trait"] [dependencies] serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tokio = { version = "0.2", features = ["io-util"], optional = true } +tokio = { version = "1.0", features = ["io-util"], optional = true } async-trait = { version = "0.1", optional = true } thiserror = { version = "1.0", optional = true } -- 2.29.2
`fork` is now marked as unsafe (nix-rust/nix#1030) --- agreety/Cargo.toml | 4 ++-- greetd/Cargo.toml | 4 ++-- greetd/src/session/interface.rs | 2 +- greetd/src/session/worker.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/agreety/Cargo.toml b/agreety/Cargo.toml index b29428a..e56f8d3 100644 --- a/agreety/Cargo.toml +++ b/agreety/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://git.sr.ht/~kennylevinsen/greetd/" [dependencies] greetd_ipc = { path = "../greetd_ipc", features = ["sync-codec"]} inish = { path = "../inish"} -rpassword = "4.0" +rpassword = "5.0" getopts = "0.2" enquote = "1.0.3" -nix = "0.17" \ No newline at end of file +nix = "0.19" \ No newline at end of file diff --git a/greetd/Cargo.toml b/greetd/Cargo.toml index abf842a..a35b0ee 100644 --- a/greetd/Cargo.toml +++ b/greetd/Cargo.toml @@ -11,9 +11,9 @@ repository = "https://git.sr.ht/~kennylevinsen/greetd/" debug = [] [dependencies] -nix = "0.17" +nix = "0.19" pam-sys = "0.5.6" -users = "0.9.1" +users = "0.11.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" greetd_ipc = { path = "../greetd_ipc", features = ["tokio-codec"] } diff --git a/greetd/src/session/interface.rs b/greetd/src/session/interface.rs index 7614de0..805f07a 100644 --- a/greetd/src/session/interface.rs +++ b/greetd/src/session/interface.rs @@ -105,7 +105,7 @@ impl Session { let cur_exe = std::env::current_exe()?; let bin = CString::new(cur_exe.to_str().expect("unable to get current exe name"))?; - let child = match fork().map_err(|e| format!("unable to fork: {}", e))? { + let child = match unsafe { fork() }.map_err(|e| format!("unable to fork: {}", e))? { ForkResult::Parent { child, .. } => child, ForkResult::Child => { execv( diff --git a/greetd/src/session/worker.rs b/greetd/src/session/worker.rs index 8b87ac8..f968968 100644 --- a/greetd/src/session/worker.rs +++ b/greetd/src/session/worker.rs @@ -225,7 +225,7 @@ fn worker(sock: &UnixDatagram) -> Result<(), Error> { // PAM is weird and gets upset if you exec from the process that opened // the session, registering it automatically as a log-out. Thus, we must // exec in a new child. - let child = match fork().map_err(|e| format!("unable to fork: {}", e))? { + let child = match unsafe { fork() }.map_err(|e| format!("unable to fork: {}", e))? { ForkResult::Parent { child, .. } => child, ForkResult::Child => { // It is important that we do *not* return from here by -- 2.29.2
builds.sr.htgreetd/patches: FAILED in 59s [deps: update tokio to 1.0][0] from [Aleksei Bavshin][1] [0]: https://lists.sr.ht/~kennylevinsen/greetd-devel/patches/19574 [1]: mailto:alebastr89@gmail.com ✗ #397238 FAILED greetd/patches/alpine.yml https://builds.sr.ht/~kennylevinsen/job/397238 ✗ #397239 FAILED greetd/patches/archlinux.yml https://builds.sr.ht/~kennylevinsen/job/397239
Applied, thanks!