Skip to content

Commit afac7fc

Browse files
committed
Auto merge of #2625 - aidanhs:aphs-path-crates-io, r=alexcrichton
`path` dependencies are ignored from crates.io
2 parents d58f2b8 + 54ec3cc commit afac7fc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/doc/guide.md

+9
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,15 @@ in the `hello_utils` folder (relative to the `Cargo.toml` it’s written in).
446446

447447
And that’s it! The next `cargo build` will automatically build `hello_utils` and
448448
all of its own dependencies, and others can also start using the crate as well.
449+
However, dependencies with only a path are not permitted on crates.io so if we
450+
wanted to publish our `hello_world` crate we would need to publish a version of
451+
`hello_utils` to crates.io (or specify a git repository location) and specify it
452+
in the dependencies line:
453+
454+
```toml
455+
[dependencies]
456+
hello_utils = { path = "hello_utils", version = "0.1.0" }
457+
```
449458

450459
## Travis-CI
451460

src/doc/manifest.md

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ You can specify the source of a dependency in a few ways:
149149
inside it. The specified path should be relative to the current `Cargo.toml`.
150150
* If `path` and `git` are omitted, the dependency will come from crates.io, and
151151
the `version` key will be used to indicate the version requirement.
152+
* `path` will be ignored for all dependencies retrieved from crates.io, so `git`
153+
or `version` must be specified for all crate dependencies when uploading to
154+
crates.io.
152155

153156
Dependencies from crates.io can also use a shorthand where just the version
154157
requirement is specified:

0 commit comments

Comments
 (0)