-
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
d4c1eee
95f6d0b
1514c7e
1d960c7
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 |
---|---|---|
|
@@ -393,6 +393,9 @@ impl SourceId { | |
.url | ||
.to_file_path() | ||
.expect("path sources cannot be remote"); | ||
if crate::util::toml::is_embedded(&path) { | ||
anyhow::bail!("The embedded script cannot be used as a dependency"); | ||
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. "embedded script" isn't quite the right term to use for this. We refer to the manifest as "embedded" because it is encapsulated within the script. We have unofficially been referring to the files as scripts but I'm not fully satisfied with that term. In the RFC, I also called these "single file packages". |
||
} | ||
Ok(Box::new(PathSource::new(&path, self, gctx))) | ||
} | ||
SourceKind::Registry | SourceKind::SparseRegistry => Ok(Box::new( | ||
|
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.
Hmm, I'm not seeing a test for
cargo install --path foo.rs
which I think would fail with thisThere 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.
No, I think we only support the directory path now. So it wouldn't reach here.
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.
I will add a test case for it.