From d7e239a8f567a33accfc9a571620310a046718a6 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Fri, 17 Nov 2023 00:02:25 -0800 Subject: [PATCH] deps: Audit 11/16 (#1188) * First pass. * Update traversal. * Fix changelog. --- Cargo.lock | 148 +++++++++++----------- Cargo.toml | 20 +-- crates/node/tool/src/bun_tool.rs | 5 +- crates/node/tool/src/npm_tool.rs | 6 +- crates/node/tool/src/pnpm_tool.rs | 6 +- crates/node/tool/src/yarn_tool.rs | 4 +- crates/rust/platform/src/lib.rs | 4 +- crates/rust/platform/src/rust_platform.rs | 9 +- nextgen/workspace/src/workspace.rs | 7 +- packages/cli/CHANGELOG.md | 8 +- 10 files changed, 118 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5670687fe4b..08edeeaf4c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,7 +316,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -360,7 +360,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -631,7 +631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" dependencies = [ "serde", - "toml 0.8.6", + "toml 0.8.8", ] [[package]] @@ -761,9 +761,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", @@ -771,9 +771,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -788,7 +788,7 @@ version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" dependencies = [ - "clap 4.4.7", + "clap 4.4.8", ] [[package]] @@ -800,7 +800,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1289,7 +1289,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1311,7 +1311,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1834,7 +1834,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1891,9 +1891,9 @@ dependencies = [ [[package]] name = "garde" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94320acdd9159591d0f8079eb347fb52c2ffbe206b5214f6f4d482f2866e4d91" +checksum = "93476a1d00b9a3a72c886af12323f9f2ec59b5cf5260519306f77b062f49a06c" dependencies = [ "compact_str", "garde_derive", @@ -1912,7 +1912,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2356,9 +2356,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.2", @@ -2625,9 +2625,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" @@ -2846,7 +2846,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2906,14 +2906,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2954,7 +2953,7 @@ dependencies = [ name = "moon_action_context" version = "0.1.0" dependencies = [ - "clap 4.4.7", + "clap 4.4.8", "moon_common", "moon_target", "rustc-hash", @@ -3139,7 +3138,7 @@ version = "1.16.2" dependencies = [ "bytes", "ci_env", - "clap 4.4.7", + "clap 4.4.8", "clap_complete", "clap_lex 0.6.0", "console", @@ -4148,9 +4147,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "once_map" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3388ad2ab0b17d90355995011856a3337e0a98147950f076ee9a73ad5d4a553e" +checksum = "becc4929f041378e06ad8160893582559aee8dd75ef6f284e4473ac3604d8692" dependencies = [ "ahash 0.8.3", "hashbrown 0.14.2", @@ -4350,7 +4349,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -4371,7 +4370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_derive", ] @@ -4976,9 +4975,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" dependencies = [ "dyn-clone", "serde", @@ -4987,12 +4986,12 @@ dependencies = [ [[package]] name = "schematic" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08761c5bd6339c7da88d9076553af0415df49a538111e2fcc92ebe808c5fee79" +checksum = "ca989126cfccad7f637f2bb609445b07aab446d2e559552252a62c3ecc1212a7" dependencies = [ "garde", - "indexmap 2.0.2", + "indexmap 2.1.0", "miette", "reqwest", "schemars", @@ -5009,15 +5008,15 @@ dependencies = [ [[package]] name = "schematic_macros" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42afd7352a9915f20bdce3e1bfb63030dedefce9d371db7b7b54a4960618797" +checksum = "417806a27d5f35bf427c0283e7c94593b4130abca4d18363d2c48d7ba4c02dfd" dependencies = [ "convert_case", "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5112,7 +5111,7 @@ checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5121,7 +5120,7 @@ version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -5186,7 +5185,7 @@ version = "0.9.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -5215,7 +5214,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5343,9 +5342,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -5371,9 +5370,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "starbase" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d78e172dba2a6c0e98c4b45fd8f245efe7b4c9c6e08981705f03bffdb00288" +checksum = "e7fbfce6b8c392aeda6a5acdb6b4e90c7bb6658f0dc957032471672cf5538001" dependencies = [ "async-trait", "chrono", @@ -5424,14 +5423,14 @@ dependencies = [ [[package]] name = "starbase_macros" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70da3be1ac772cd1cf5b71a725988b64829da92664b8fc362be765462c28638c" +checksum = "3ed281d2657820727914b0ef0bac484a822e66cc783e0b614a4703492f5381da" dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5465,9 +5464,9 @@ dependencies = [ [[package]] name = "starbase_utils" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d948dcd63f1dd11f2b7a9ab15c53e7866faa11ccd31377dca1625c106d40fcee" +checksum = "6db5c15177ddbb9ddef8751911d8b75c02b5a9ea11d9a24a44951de97bd8a722" dependencies = [ "dirs 5.0.1", "ec4rs", @@ -5483,7 +5482,7 @@ dependencies = [ "starbase_styles", "thiserror", "tokio", - "toml 0.8.6", + "toml 0.8.8", "tracing", "wax", ] @@ -5573,9 +5572,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -5772,7 +5771,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5870,9 +5869,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -5882,7 +5881,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.5", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -5890,13 +5889,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -5956,14 +5955,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.7", + "toml_edit 0.21.0", ] [[package]] @@ -5981,7 +5980,7 @@ version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -5990,11 +5989,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -6021,11 +6020,12 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", + "thiserror", "time", "tracing-subscriber", ] @@ -6038,7 +6038,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -6084,9 +6084,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "once_cell", @@ -6573,7 +6573,7 @@ version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e986b010f47fcce49cf8ea5d5f9e5d2737832f12b53ae8ae785bbe895d0877bf" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "semver", ] diff --git a/Cargo.toml b/Cargo.toml index 87a09763695..151fe4ac190 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,16 +24,16 @@ default-members = ["crates/cli"] [workspace.dependencies] async-trait = "0.1.74" -cached = "0.46.0" +cached = "0.46.1" chrono = { version = "0.4.31", features = ["serde"] } cd_env = "0.1.2" ci_env = "0.2.1" -clap = { version = "4.4.7", features = ["derive", "env", "wrap_help"] } +clap = { version = "4.4.8", features = ["derive", "env", "wrap_help"] } clap_complete = "4.4.4" console = "0.15.7" miette = "5.10.0" once_cell = "1.18.0" -once_map = "0.4.10" +once_map = "0.4.11" pathdiff = "0.2.1" petgraph = { version = "0.6.4", default-features = false, features = [ "serde-1", @@ -47,7 +47,7 @@ reqwest = { version = "0.11.22", default-features = false, features = [ "native-tls-vendored", ] } rustc-hash = "1.1.0" -schematic = { version = "0.12.7", default-features = false, features = [ +schematic = { version = "0.12.8", default-features = false, features = [ "config", "schema", "url", @@ -57,27 +57,27 @@ schematic = { version = "0.12.7", default-features = false, features = [ "type_warpgate", ] } semver = "1.0.20" -serde = { version = "1.0.190", features = ["derive", "rc"] } -serde_json = "1.0.107" +serde = { version = "1.0.192", features = ["derive", "rc"] } +serde_json = "1.0.108" serde_yaml = "0.9.27" -starbase = "0.2.9" +starbase = "0.2.10" starbase_archive = { version = "0.2.4", default-features = false, features = [ "tar-gz", ] } starbase_events = { version = "0.2.2" } starbase_sandbox = "0.1.12" starbase_styles = { version = "0.1.16", features = ["relative-path"] } -starbase_utils = { version = "0.3.7", default-features = false, features = [ +starbase_utils = { version = "0.3.8", default-features = false, features = [ "editor-config", "glob", "json", "toml", "yaml", ] } -system_env = "0.1.2" +system_env = "0.1.4" tera = { version = "1.19.1", features = ["preserve_order"] } thiserror = "1.0.50" -tokio = { version = "1.33.0", default-features = false, features = [ +tokio = { version = "1.34.0", default-features = false, features = [ "macros", "process", "rt-multi-thread", diff --git a/crates/node/tool/src/bun_tool.rs b/crates/node/tool/src/bun_tool.rs index f7daba04813..065950485c3 100644 --- a/crates/node/tool/src/bun_tool.rs +++ b/crates/node/tool/src/bun_tool.rs @@ -8,6 +8,7 @@ use moon_tool::{ async_trait, load_tool_plugin, prepend_path_env_var, use_global_tool_on_path, DependencyManager, Tool, }; +use moon_utils::get_workspace_root; use proto_core::{Id, ProtoEnvironment, Tool as ProtoTool, UnresolvedVersionSpec}; use rustc_hash::FxHashMap; use starbase_utils::fs; @@ -160,7 +161,9 @@ impl DependencyManager for BunTool { &self, project_root: &Path, ) -> miette::Result { - let Some(lockfile_path) = fs::find_upwards(BUN.lockfile, project_root) else { + let Some(lockfile_path) = + fs::find_upwards_until(BUN.lockfile, project_root, get_workspace_root()) + else { return Ok(FxHashMap::default()); }; diff --git a/crates/node/tool/src/npm_tool.rs b/crates/node/tool/src/npm_tool.rs index 4fec3bac988..2b995c6d6cb 100644 --- a/crates/node/tool/src/npm_tool.rs +++ b/crates/node/tool/src/npm_tool.rs @@ -8,7 +8,7 @@ use moon_tool::{ async_trait, load_tool_plugin, prepend_path_env_var, use_global_tool_on_path, DependencyManager, Tool, }; -use moon_utils::is_ci; +use moon_utils::{get_workspace_root, is_ci}; use proto_core::{Id, ProtoEnvironment, Tool as ProtoTool, UnresolvedVersionSpec}; use rustc_hash::FxHashMap; use starbase_utils::fs; @@ -167,7 +167,9 @@ impl DependencyManager for NpmTool { &self, project_root: &Path, ) -> miette::Result { - let Some(lockfile_path) = fs::find_upwards(NPM.lockfile, project_root) else { + let Some(lockfile_path) = + fs::find_upwards_until(NPM.lockfile, project_root, get_workspace_root()) + else { return Ok(FxHashMap::default()); }; diff --git a/crates/node/tool/src/pnpm_tool.rs b/crates/node/tool/src/pnpm_tool.rs index e23b88a0028..e4c63e82015 100644 --- a/crates/node/tool/src/pnpm_tool.rs +++ b/crates/node/tool/src/pnpm_tool.rs @@ -8,7 +8,7 @@ use moon_tool::{ async_trait, load_tool_plugin, prepend_path_env_var, use_global_tool_on_path, DependencyManager, Tool, }; -use moon_utils::is_ci; +use moon_utils::{get_workspace_root, is_ci}; use proto_core::{ Id, ProtoEnvironment, Tool as ProtoTool, UnresolvedVersionSpec, VersionReq, VersionSpec, }; @@ -197,7 +197,9 @@ impl DependencyManager for PnpmTool { &self, project_root: &Path, ) -> miette::Result { - let Some(lockfile_path) = fs::find_upwards(PNPM.lockfile, project_root) else { + let Some(lockfile_path) = + fs::find_upwards_until(PNPM.lockfile, project_root, get_workspace_root()) + else { return Ok(FxHashMap::default()); }; diff --git a/crates/node/tool/src/yarn_tool.rs b/crates/node/tool/src/yarn_tool.rs index 6ee7094d1c0..af44817cc9e 100644 --- a/crates/node/tool/src/yarn_tool.rs +++ b/crates/node/tool/src/yarn_tool.rs @@ -255,7 +255,9 @@ impl DependencyManager for YarnTool { &self, project_root: &Path, ) -> miette::Result { - let Some(lockfile_path) = fs::find_upwards(YARN.lockfile, project_root) else { + let Some(lockfile_path) = + fs::find_upwards_until(YARN.lockfile, project_root, get_workspace_root()) + else { return Ok(FxHashMap::default()); }; diff --git a/crates/rust/platform/src/lib.rs b/crates/rust/platform/src/lib.rs index ca90a0c6651..e2b4bad8cf5 100644 --- a/crates/rust/platform/src/lib.rs +++ b/crates/rust/platform/src/lib.rs @@ -10,8 +10,8 @@ use starbase_utils::{dirs, fs}; use std::env; use std::path::{Path, PathBuf}; -fn find_cargo_lock(starting_dir: &Path) -> Option { - fs::find_upwards(CARGO.lockfile, starting_dir) +fn find_cargo_lock(starting_dir: &Path, workspace_root: &Path) -> Option { + fs::find_upwards_until(CARGO.lockfile, starting_dir, workspace_root) } fn get_cargo_home() -> PathBuf { diff --git a/crates/rust/platform/src/rust_platform.rs b/crates/rust/platform/src/rust_platform.rs index e4753b2fa64..90634aa591f 100644 --- a/crates/rust/platform/src/rust_platform.rs +++ b/crates/rust/platform/src/rust_platform.rs @@ -116,7 +116,10 @@ impl Platform for RustPlatform { // PROJECT GRAPH fn is_project_in_dependency_workspace(&self, project_source: &str) -> miette::Result { - let Some(lockfile_path) = find_cargo_lock(&self.workspace_root.join(project_source)) else { + let Some(lockfile_path) = find_cargo_lock( + &self.workspace_root.join(project_source), + &self.workspace_root, + ) else { return Ok(false); }; @@ -267,7 +270,7 @@ impl Platform for RustPlatform { tool.exec_rustup(args, working_dir).await?; } - if find_cargo_lock(working_dir).is_none() { + if find_cargo_lock(working_dir, &self.workspace_root).is_none() { print_checkpoint("cargo generate-lockfile", Checkpoint::Setup); tool.exec_cargo(["generate-lockfile"], working_dir).await?; @@ -330,7 +333,7 @@ impl Platform for RustPlatform { ) -> miette::Result { let mut mutated_files = false; - let lockfile_path = find_cargo_lock(&project.root); + let lockfile_path = find_cargo_lock(&project.root, &self.workspace_root); let cargo_root = match lockfile_path { Some(path) => path.parent().unwrap().to_owned(), None => project.root.to_owned(), diff --git a/nextgen/workspace/src/workspace.rs b/nextgen/workspace/src/workspace.rs index 3c27d2329c4..8ddac2ea638 100644 --- a/nextgen/workspace/src/workspace.rs +++ b/nextgen/workspace/src/workspace.rs @@ -24,19 +24,20 @@ fn find_workspace_root>(working_dir: P) -> miette::Result