From ded05a502d7d3eb9d9432de158f7091bfc662579 Mon Sep 17 00:00:00 2001 From: tuguzT Date: Sun, 21 Sep 2025 22:06:30 +0300 Subject: [PATCH] Replace `tempdir` with `tempfile` by RUSTSEC-2018-0017 --- Cargo.lock | 113 +++++++++++++++++++-------------------- Cargo.toml | 2 +- crates/xtask/Cargo.toml | 2 +- crates/xtask/src/main.rs | 2 +- 4 files changed, 59 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64a9410..d42db12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -431,6 +431,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + [[package]] name = "fnv" version = "1.0.7" @@ -456,20 +462,26 @@ dependencies = [ ] [[package]] -name = "fuchsia-cprng" -version = "0.1.1" +name = "getrandom" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] [[package]] name = "getrandom" -version = "0.2.16" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi", + "r-efi", + "wasi 0.14.7+wasi-0.2.4", ] [[package]] @@ -762,7 +774,7 @@ checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -914,32 +926,10 @@ dependencies = [ ] [[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_core" -version = "0.3.1" +name = "r-efi" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "raw-string" @@ -947,15 +937,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0501e134c6905fee1f10fed25b0a7e1261bf676cffac9543a7d0730dec01af2" -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.5.11" @@ -971,7 +952,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom", + "getrandom 0.2.16", "libredox", "thiserror", ] @@ -1029,15 +1010,6 @@ dependencies = [ "serde", ] -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rspirv" version = "0.12.0+sdk-1.3.268.0" @@ -1293,13 +1265,16 @@ dependencies = [ ] [[package]] -name = "tempdir" -version = "0.3.7" +name = "tempfile" +version = "3.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +checksum = "84fa4d11fadde498443cca10fd3ac23c951f0dc59e080e9f4b93d4df4e4eea53" dependencies = [ - "rand", - "remove_dir_all", + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.60.2", ] [[package]] @@ -1561,6 +1536,24 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1756,6 +1749,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + [[package]] name = "writeable" version = "0.6.1" @@ -1770,7 +1769,7 @@ dependencies = [ "clap", "env_logger", "log", - "tempdir", + "tempfile", "toml 0.9.2", ] diff --git a/Cargo.toml b/Cargo.toml index 656c071..62ca2ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ relative-path = "2.0.1" serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.141" toml = "0.9.2" -tempdir = "0.3.7" +tempfile = "3.22" test-log = "0.2.18" cargo_metadata = "0.21.0" cargo-util-schemas = "0.8.2" diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml index 0573d57..afe0178 100644 --- a/crates/xtask/Cargo.toml +++ b/crates/xtask/Cargo.toml @@ -8,7 +8,7 @@ anyhow.workspace = true clap.workspace = true env_logger.workspace = true log.workspace = true -tempdir.workspace = true +tempfile.workspace = true toml.workspace = true [lints] diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index d767a2c..8eec0be 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -152,7 +152,7 @@ fn main() { cmd(["cargo", "install", "--path", "crates/cargo-gpu"]).unwrap(); log::info!("setup project"); - let dir = tempdir::TempDir::new("test-shader-output").unwrap(); + let dir = tempfile::TempDir::with_prefix("test-shader-output").unwrap(); let mut overwriter = ShaderCrateTemplateCargoTomlWriter::new(); overwriter.replace_output_dir(dir.path()).unwrap();