You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to use a customized git dependency of a crate in a repository, which have more than one Rust crates and the workspace in not in the root of repository.
If we can use git and path at the same time, everything will be straight forward for developers. wasmedge-sys = { git = "wasmedge_git_url", path = "/bindings/rust/wasmedge-sys"}
You can check out the following closed issue, people still there and request this feature. #1462
Proposed Solution
We need to modify the following structure, and allow using path with git, also the path will be transformed to absolute path before using, such that we can make sure the path will not go out of the resource.
src/cargo/core/source/source_id.rs
#[derive(Eq,Clone,Debug)]structSourceIdInner{/// The source URL.url:Url,/// The canonical version of the above urlcanonical_url:CanonicalUrl,/// The source kind.kind:SourceKind,/// For example, the exact Git revision of the specified branch for a Git Source.precise:Option<String>,/// Name of the registry source for alternative registries/// WARNING: this is not always set for alt-registries when the name is/// not known.name:Option<String>,/// The portion of resource
+ /// For example, the folder for a Git source
+ portion:Option<String>,}
src/cargo/sources/config.rs
structSourceConfigDef{/// Indicates this source should be replaced with another of the given name.replace_with:OptValue<String>,/// A directory source.directory:Option<ConfigRelativePath>,/// A registry source. Value is a URL.registry:OptValue<String>,/// A local registry source.local_registry:Option<ConfigRelativePath>,/// A git source. Value is a URL.git:OptValue<String>,/// The git branch.branch:OptValue<String>,/// The git tag.tag:OptValue<String>,/// The git revision.rev:OptValue<String>,
+ /// The porton of the Source,
+ /// for example the folder of git resoutce
+ portion:Option<String>,}
Notes
No response
The text was updated successfully, but these errors were encountered:
yanganto
added
the
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
label
Dec 3, 2021
Can you say more about why you would like to specify the path within the git repository? Cargo already searches for the package by name, so unless you have two packages with the exact same name, this should not be necessary.
Problem
We want to use a customized git dependency of a crate in a repository, which have more than one Rust crates and the workspace in not in the root of repository.
Following is a real example from WasmEdge
If we can use
git
andpath
at the same time, everything will be straight forward for developers.wasmedge-sys = { git = "wasmedge_git_url", path = "/bindings/rust/wasmedge-sys"}
You can check out the following closed issue, people still there and request this feature.
#1462
Proposed Solution
We need to modify the following structure, and allow using
path
withgit
, also thepath
will be transformed to absolute path before using, such that we can make sure the path will not go out of the resource.src/cargo/core/source/source_id.rs
src/cargo/sources/config.rs
Notes
No response
The text was updated successfully, but these errors were encountered: