-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add cargo pkgid
support for cargo-script
#14961
base: master
Are you sure you want to change the base?
Changes from all commits
5465e6a
feda97d
0c2bb4e
eb043fc
7fcac4e
d8be32e
a4ca61d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,6 +124,9 @@ impl<'gctx> PathSource<'gctx> { | |
} | ||
|
||
fn read_package(&self) -> CargoResult<Package> { | ||
if crate::util::toml::is_embedded(&self.path) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this is the best place to check this. Maybe we should move it to where we create the source ID? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo this feels too spooky as this function is not directly tied to dependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then I guess we should do the check when we read the manifest file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or the dependency resolution phase. Maybe do it when resolving dependencies makes more sense. |
||
anyhow::bail!("The embedded script cannot be used as a dependency"); | ||
} | ||
let path = self.path.join("Cargo.toml"); | ||
let pkg = ops::read_package(&path, self.source_id, self.gctx)?; | ||
Ok(pkg) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,7 +289,7 @@ fn main() {} | |
"edition": "2021", | ||
"features": {}, | ||
"homepage": null, | ||
"id": "path+[ROOTURL]/foo#foo::[email protected]", | ||
"id": "path+[ROOTURL]/foo/foo::bar.rs#foo::[email protected]", | ||
"keywords": [], | ||
"license": null, | ||
"license_file": null, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this reformatting belong on the previous commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I squashed it into the wrong commit.