Skip to content

Reject path-based dependencies in cargo package#3060

Merged
bors merged 3 commits into
rust-lang:masterfrom
rillian:package_path_deps
Sep 1, 2016
Merged

Reject path-based dependencies in cargo package#3060
bors merged 3 commits into
rust-lang:masterfrom
rillian:package_path_deps

Conversation

@rillian

@rillian rillian commented Aug 31, 2016

Copy link
Copy Markdown
Contributor

cargo publish will complain if a package manifest contains a path, rather than registry+version-based dependency. Make cargo package do the same so that issue is caught sooner in developer workflow.

Port registry::verify_dependencies to the `cargo package`
command to perform the local portion of that check. It
looks like the package operation doesn't generally make
reference to the registry, so skip variant-origin checks
until publish time.
Port of the equivalent test from the `cargo publish` command.
@rust-highfive

Copy link
Copy Markdown

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rillian

rillian commented Aug 31, 2016

Copy link
Copy Markdown
Contributor Author
$ make test
sh tests/check-style.sh
checking for lines over 100 characters...
tests/package.rs:[WARNING] manifest has no documentation, homepage or repository. See http://doc.crates.io/manifest.html#package-metadata for more info.
make: *** [style] Error 1

This is just the test trying to match the actual command output. I guess I can fix the message in ops::cargo_package::verify_metadata.

@rillian
rillian force-pushed the package_path_deps branch 2 times, most recently from efde3b1 to c5e5392 Compare September 1, 2016 03:47
This lets test result expected output pass the long-line style check.
@rillian

rillian commented Sep 1, 2016

Copy link
Copy Markdown
Contributor Author

Sorry for the noise. The tests don't all pass in my local environments, so it can be hard to tell what needs to be fixed.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+ 3227546

Looks good to me, thanks!

@bors

bors commented Sep 1, 2016

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3227546 with merge b78beb1...

bors added a commit that referenced this pull request Sep 1, 2016
Reject path-based dependencies in `cargo package`

`cargo publish` will complain if a package manifest contains a path, rather than registry+version-based dependency. Make `cargo package` do the same so that issue is caught sooner in developer workflow.
@bors

bors commented Sep 1, 2016

Copy link
Copy Markdown
Contributor

☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64
Approved by: alexcrichton
Pushing b78beb1 to master...

@bors
bors merged commit 3227546 into rust-lang:master Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants