From 15e7db81d77932977488436a696d4c4454d037ad Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Tue, 21 Jun 2022 10:26:03 +0200 Subject: [PATCH] Strip 'Cargo.toml' from workspace path for patches (#1391) --- cumulus/test/relay-validation-worker-provider/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cumulus/test/relay-validation-worker-provider/build.rs b/cumulus/test/relay-validation-worker-provider/build.rs index 6b2f482a7d..9b5247bcbe 100644 --- a/cumulus/test/relay-validation-worker-provider/build.rs +++ b/cumulus/test/relay-validation-worker-provider/build.rs @@ -120,6 +120,9 @@ fn add_patches(project_toml: &mut Table) { ) .expect("Workspace root `Cargo.toml` is a valid toml file; qed"); + let mut workspace_path = workspace_toml_path; + workspace_path.pop(); + while let Some(mut patch) = workspace_toml.remove("patch").and_then(|p| p.try_into::().ok()) { @@ -134,7 +137,7 @@ fn add_patches(project_toml: &mut Table) { p.iter_mut().filter(|(k, _)| k == &"path").for_each(|(_, v)| { if let Some(path) = v.as_str().map(PathBuf::from) { if path.is_relative() { - *v = workspace_toml_path.join(path).display().to_string().into(); + *v = workspace_path.join(path).display().to_string().into(); } } })