394 Commits

Author SHA1 Message Date
Eh2406
a418364dda remove missing from the package list error and fmt 2018-07-31 15:04:12 -04:00
Eh2406
86feda12fa cargo update can deal with some bad lockfiles 2018-07-30 12:12:04 -04:00
Dale Wijnand
316622afd6
Test verbose error output for a bad lockfile 2018-07-26 17:14:08 +01:00
Dale Wijnand
fcc3044e83
Suggest "update -p" to fix a bad lockfile 2018-07-26 17:12:09 +01:00
bors
191bfbfaf2 Auto merge of #5794 - Nemo157:rustdoc-rename-extern, r=alexcrichton
Apply dependency renamings when running rustdoc

Fixes #5792
2018-07-26 00:36:42 +00:00
Wim Looman
a432619806 Apply dependency renamings when running rustdoc
Fixes #5792
2018-07-25 18:58:28 +02:00
Dale Wijnand
6ca32be8a2
Declare one-line write_all contents on one line, too 2018-07-25 10:00:45 +01:00
Dale Wijnand
ca7d9ee292
Declare one-line files on one line, in test projects 2018-07-25 09:58:50 +01:00
Dale Wijnand
ab19c48358
Dedup a bunch more manifest 2018-07-25 00:43:30 +01:00
Dale Wijnand
5659b78b76
Replace const BASIC_MANIFEST with basic_manifest("foo", "0.0.1") 2018-07-24 23:35:50 +01:00
bors
4e53ce48d1 Auto merge of #5782 - dwijnand:dedup-manifest, r=alexcrichton
Add a default template for Cargo.toml

Fixes #5743

r? @alexcrichton
2018-07-24 20:47:57 +00:00
bors
5bb850141a Auto merge of #5621 - knight42:cargo-search-relaced-registry, r=alexcrichton
Update replaced registry before search

Close #5550.

It seems that updating the replaced registry before search has not been well considered in cargo and I have to add a function to trait `core::source::Source` to get the replaced `SourceId`.

I am not sure whether this is a good design, any advice is welcome.
2018-07-24 16:10:11 +00:00
Dale Wijnand
081e7930d2
Drop now unnecessary basic manifests 2018-07-24 16:33:55 +01:00
Dale Wijnand
252f6e8e9f
Opt-out all other failing tests
Looks like cargo traverses the filesystem & fails if it runs into a
Cargo.toml that doesn't declare a target.  I couldn't find a nice way to
re-engineer the test to avoid this issue.  So I'll leave that as someone
else's exercise.
2018-07-24 13:59:42 +01:00
Dale Wijnand
d2c815be22
Add an opt-out to the auto-generated Cargo.toml 2018-07-24 13:19:47 +01:00
Dale Wijnand
2e6e5f880b
Insert a basic Cargo.toml if one is not defined. 2018-07-24 11:35:39 +01:00
Alex Crichton
6cdee674fc Don't warn about ignored files in cargo-fix
They're not being tracked, so no worries if we stomp over them!
2018-07-23 07:33:51 -07:00
knight42
7d279fe85c test: add test for replaced source 2018-07-23 09:35:27 +08:00
Dale Wijnand
43b42d6f4c
Reorganise the testsuite crate module hierarchy
* Collapse the nested cargotest::support module into the cargotest
  module (merge the mod.rs's)
* Rename the cargotest module to support
* Nest the top-level hamcrest module into support
2018-07-22 08:46:44 +01:00
Eric Huss
c3b477d495 Support --cap-lints in rustdoc. 2018-07-21 20:17:03 -07:00
Eric Huss
f41ee8908a Fix flakey test on MacOS.
`do_not_package_if_src_was_modified` can fail if the test runs too quickly
due to mac's filesystem time resolution.
2018-07-21 17:27:34 -07:00
bors
b4a245e6f4 Auto merge of #5751 - RalfJung:default-run, r=alexcrichton
cargo run: on nightly, advertise the default-run feature
2018-07-21 23:03:13 +00:00
Dale Wijnand
f8c9928cc1
Rework some test projects to use the "foo" default
Generally that means either switching "foo" and "bar" around (reversing
the arrow), or it means push "foo" to "bar" (and sometimes "bar" to
"baz", etc..) to free up "foo".

For trivia that leaves 80/1222 outliers, therefore 93.4% of test
project use the default. :)
2018-07-21 19:40:45 +01:00
Dale Wijnand
6da2ada26d
Migrate trailing calls to project with an argument
.. in docs, commented code & tests targetting non-macos.
2018-07-20 15:25:51 +01:00
Dale Wijnand
7fe2fbc8a3
Remove the argument from the project test support function
By rewriting the tests, with rerast (https://github.com/google/rerast),
to use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
        project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
        replace!(project("foo") => project_foo());
        replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests
2018-07-20 13:31:50 +01:00
Ralf Jung
d1372315b3 cargo run: on nightly, advertise the default-run feature 2018-07-20 12:48:47 +02:00
Dale Wijnand
d7d513e95e
Add tests/ProjectBuilder::at 2018-07-19 13:55:39 +01:00
bors
506eea76ed Auto merge of #5723 - alexcrichton:cargo-fix, r=ehuss
Import `cargo fix` directly in to Cargo

This commit imports the `cargo fix` subcommand in rust-lang-nursery/rustfix
directly into Cargo as a subcommand. This should allow us to ease our
distribution story of `cargo fix` as we prepare for the upcoming 2018 edition
release.

It's been attempted here to make the code as idiomatic as possible for Cargo's
own codebase. Additionally all tests from cargo-fix were imported into Cargo's
test suite as well. After this lands and is published in nightly the `cargo-fix`
command in rust-lang-nursery/rustfix will likely be removed.

cc rust-lang/rust#52272
2018-07-17 16:28:32 +00:00
Alex Crichton
b02ba3771e Import cargo fix directly in to Cargo
This commit imports the `cargo fix` subcommand in rust-lang-nursery/rustfix
directly into Cargo as a subcommand. This should allow us to ease our
distribution story of `cargo fix` as we prepare for the upcoming 2018 edition
release.

It's been attempted here to make the code as idiomatic as possible for Cargo's
own codebase. Additionally all tests from cargo-fix were imported into Cargo's
test suite as well. After this lands and is published in nightly the `cargo-fix`
command in rust-lang-nursery/rustfix will likely be removed.

cc rust-lang/rust#52272
2018-07-16 21:58:58 -07:00
bors
558eee4fbc Auto merge of #5732 - Eh2406:sort_unstable, r=alexcrichton`,
most sorts can be unstable

Inspired by [this](94f7058a48/src/bin/cargo/main.rs (L112-L122)) witch was improved in #5691, I did a quick review of `sort`s in the code. Most can be unstable, some can use a `_key` form, and none had unnecessary allocation.
2018-07-16 21:45:15 +00:00
Eh2406
c74aa9490e most sorts can be unstable 2018-07-16 16:57:38 -04:00
bors
e325bff3c4 Auto merge of #5710 - RalfJung:default-run, r=alexcrichton
implement default-run option to set default binary for cargo run

The implementation is not pretty but as good as I could make it. The fact that all this logic in `cargo_run` is for diagnosis only and essentially just re-implements the filtering done elsewhere really threw me off.

Fixes #2200
2018-07-16 20:47:38 +00:00
Ralf Jung
04abd5ef2f fix code nits 2018-07-16 21:48:14 +02:00
Ralf Jung
579e0348d7 order of lits of binaries is not stable 2018-07-16 21:48:14 +02:00
Ralf Jung
c955c60e6b feature-gate default-run 2018-07-16 21:48:14 +02:00
Ralf Jung
5936f6ae9e implement default-run option to set default binary for cargo run 2018-07-16 21:48:14 +02:00
bors
fefbb68f89 Auto merge of #5691 - Eh2406:hyphen-underscore, r=alexcrichton
Make index lookup robust to _ vs -, but don't let the user get it wrong.

This does a brute force search thru combinations of hyphen and underscores to allow queries of crates to pass the wrong one.

This is a small first step of fixing #2775

Where is best to add test?
2018-07-16 19:35:38 +00:00
Eh2406
95b4640b32 only suggest lev_distance < 4 2018-07-16 15:28:53 -04:00
bors
06721dd6b6 Auto merge of #5543 - roblabla:doc-private-items, r=alexcrichton
Add document-private-items flag to cargo doc

Add a `--document-private-items` flag to `cargo doc`, that mimics the equivalent `cargo rustdoc -- --document-private-items`. This works by relaying the flag to the underlying rustdoc call.
2018-07-16 00:26:07 +00:00
roblabla
7757753b28 Verify that private items were actually documented 2018-07-15 20:22:22 +02:00
roblabla
4a11afc59f Add a test for document-private-items 2018-07-15 20:10:01 +02:00
bors
caf810b8f1 Auto merge of #5726 - ehuss:warn-virtual-keys, r=alexcrichton
Warn about unused virtual manifest keys.

Fixes #4243
2018-07-15 17:20:14 +00:00
Eh2406
c01a189980 recv_timeout was stable in 1.12 2018-07-14 22:50:00 -04:00
Eric Huss
688a4fa6b3 Warn about unused virtual manifest keys.
Fixes #4243
2018-07-14 09:20:15 -07:00
Eh2406
98e1bdb762 oops... 2018-07-13 18:05:24 -04:00
bors
738c42d4dc Auto merge of #5715 - euclio:third-party-help, r=alexcrichton
help: display external subcommand help

When invoking `cargo help <subcommand>`, if the subcommand isn't found, but it *is* an external subcommand, call that subcommand with `--help`.

A test should probably be written for this, but I'm not sure how best to mock an external subcommand.
2018-07-13 22:02:09 +00:00
Andy Russell
9e41e383ac
help: display external subcommand help 2018-07-13 15:09:00 -04:00
Alex Crichton
f9d4927b26 Partially revert dep changes in #5651
Some logic which was tweaked around the dependencies of build script targets was
tweaked slightly in a way that causes cargo to stack overflow by accientally
adding a dependency loop. This commit implements one of the strategies discussed
in #5711 to fix this situation.

The problem here is that when calculating the deps of a build script we need the
build scripts of *other* packages, but the exact profile is somewhat difficult
to guess at the moment we're generating our build script unit. To solve this the
dependencies towards other build scripts' executions is added in a different
pass after all other units have been assembled. At this point we should know for
sure that all build script executions are in the dependency graph, and we just
need to add a few more edges.

Closes #5708
2018-07-13 10:54:22 -07:00
Eh2406
3f5036ae4d update test to get ci passing 2018-07-11 23:26:01 -04:00
Eh2406
84cc3d8b09 allow each source to recommend packages that are close to a dependency 2018-07-11 12:46:52 -04:00