diff --git a/Cargo.lock b/Cargo.lock index 7eda1b8e..cdfcc510 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -115,7 +115,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.52", + "syn 2.0.117", ] [[package]] @@ -225,7 +225,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.117", ] [[package]] @@ -864,11 +864,10 @@ dependencies = [ [[package]] name = "rmp-serde" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" dependencies = [ - "byteorder", "rmp", "serde", ] @@ -922,22 +921,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.117", ] [[package]] @@ -1107,9 +1115,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -1212,7 +1220,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.117", ] [[package]] @@ -1355,7 +1363,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.117", "wasm-bindgen-shared", ] @@ -1377,7 +1385,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.117", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1567,5 +1575,5 @@ checksum = "8a616990af1a287837c4fe6596ad77ef57948f787e46ce28e166facc0cc1cb75" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.117", ] diff --git a/HACKING.md b/HACKING.md index 21bdd1ea..fa688d0f 100644 --- a/HACKING.md +++ b/HACKING.md @@ -19,7 +19,7 @@ send patches you don't understand. ### Install a rust toolchain If you have not already done so, install a rust toolchain. -The minimum rust version for shpool is `1.74.0`, so make sure that +The minimum rust version for shpool is `1.85.0`, so make sure that `cargo --version` reports that version or higher before attempting to build shpool. The easiest way to install an up to date rust toolchain is with [`rustup`](https://rustup.rs/), diff --git a/libshpool/Cargo.toml b/libshpool/Cargo.toml index 69e0bd1f..7b76c112 100644 --- a/libshpool/Cargo.toml +++ b/libshpool/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libshpool" version = "0.9.4" -edition = "2021" +edition = "2024" repository = "https://github.com/shell-pool/shpool" authors = ["Ethan Pailes "] readme = "README.md" @@ -13,7 +13,7 @@ disconnects. ''' license = "Apache-2.0" keywords = ["tmux", "tty", "terminal", "shell", "persistence"] -rust-version = "1.74" +rust-version = "1.85" [features] test_hooks = [] # for internal testing only, don't enable this feature diff --git a/libshpool/src/daemon/mod.rs b/libshpool/src/daemon/mod.rs index 1f014db6..7b52ec71 100644 --- a/libshpool/src/daemon/mod.rs +++ b/libshpool/src/daemon/mod.rs @@ -45,7 +45,12 @@ pub fn run( ) -> anyhow::Result<()> { if let Ok(daemonize) = env::var(consts::AUTODAEMONIZE_VAR) { if daemonize == "true" { - env::remove_var(consts::AUTODAEMONIZE_VAR); // avoid looping + // Safety: this is executing before we have forked any threads, + // so we are still in single-threaded mode, therefore it is safe + // to mutate the global env. + unsafe { + env::remove_var(consts::AUTODAEMONIZE_VAR); // avoid looping + } let pid_file = socket.with_file_name("daemonized-shpool.pid"); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7f4f8aea..5ce4b2d0 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.74.0" +channel = "1.85.0" components = ["rust-docs", "rust-src", "rust-analyzer"] profile = "minimal" diff --git a/shpool-protocol/Cargo.toml b/shpool-protocol/Cargo.toml index 19d1d86c..cd8b9816 100644 --- a/shpool-protocol/Cargo.toml +++ b/shpool-protocol/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "shpool-protocol" version = "0.3.3" -edition = "2021" +edition = "2024" authors = ["Ethan Pailes "] repository = "https://github.com/shell-pool/shpool" readme = "../README.md" @@ -11,7 +11,7 @@ You almost certainly don't need to use it directly. ''' license = "Apache-2.0" keywords = ["tmux", "tty", "terminal", "shell", "persistence"] -rust-version = "1.74" +rust-version = "1.85" [dependencies] anyhow = "1" diff --git a/shpool/Cargo.toml b/shpool/Cargo.toml index 466c96e1..72f152c3 100644 --- a/shpool/Cargo.toml +++ b/shpool/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "shpool" version = "0.9.4" -edition = "2021" +edition = "2024" authors = ["Ethan Pailes "] repository = "https://github.com/shell-pool/shpool" readme = "../README.md" @@ -11,7 +11,7 @@ sessions to gracefully handle network disconnects. ''' license = "Apache-2.0" keywords = ["tmux", "tty", "terminal", "shell", "persistence"] -rust-version = "1.74" +rust-version = "1.85" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/shpool/tests/kill.rs b/shpool/tests/kill.rs index 6e0fc6b0..b3b94ff9 100644 --- a/shpool/tests/kill.rs +++ b/shpool/tests/kill.rs @@ -37,7 +37,12 @@ fn empty() -> anyhow::Result<()> { ) .context("starting daemon proc")?; - env::remove_var("SHPOOL_SESSION_NAME"); + // Safety: I think this is actually wrong because tests can run + // in parallel. It hasn't ever caused a problem in practice though, + // and this is just a test, so I think it's fine. + unsafe { + env::remove_var("SHPOOL_SESSION_NAME"); + } let out = daemon_proc.kill(vec![])?; assert!(!out.status.success());