From d10f797e2fd2de6cf44717754b1e15b9fc53a347 Mon Sep 17 00:00:00 2001 From: Rustin170506 Date: Thu, 2 Jan 2025 23:13:29 +0800 Subject: [PATCH] feat: use full URL for embedded script paths Signed-off-by: Rustin170506 --- src/cargo/core/workspace.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/workspace.rs b/src/cargo/core/workspace.rs index a81c6b9304e..55db0e913a8 100644 --- a/src/cargo/core/workspace.rs +++ b/src/cargo/core/workspace.rs @@ -1800,7 +1800,10 @@ impl<'gctx> Packages<'gctx> { match self.packages.entry(key.to_path_buf()) { Entry::Occupied(e) => Ok(e.into_mut()), Entry::Vacant(v) => { - let source_id = SourceId::for_path(key)?; + let source_id = match crate::util::toml::is_embedded(manifest_path) { + true => SourceId::for_path(manifest_path)?, + false => SourceId::for_path(key)?, + }; let manifest = read_manifest(manifest_path, source_id, self.gctx)?; Ok(v.insert(match manifest { EitherManifest::Real(manifest) => {