Commit graph

11617 commits

Author SHA1 Message Date
Weihang Lo 4ecb54339a
Compare version fields' equalities directly
Instead of creating another VersionReq, this can reduce some extra
efforts on version matching logic. Though it also may introduces
divergence from semver's matching logic. Accordingly, we borrow unit
tests from semver crate and compare the matching results to prevent
future breaks.
2021-09-20 11:32:55 +08:00
Weihang Lo d22623466d
Show original version_req for locked dependency
When encounter resolver error with locked dependency, we now show
original version req along with the exact locked version.
2021-09-20 11:31:59 +08:00
Weihang Lo c6762ce470
Update synthetic locked version_req to real locked
Previously we use exact semver version req to synthesize locked version
req. Now we make those need a truly locked to be `OptVersionReq::Locked`.
2021-09-20 11:31:59 +08:00
Weihang Lo d6fd4998cf
Add Locked variant for OptVersionReq
`OptVersionReq::Locked` stores the original version requirement and the
acutal locked version. This makes error message describing more precise.
2021-09-20 11:31:59 +08:00
Eric Huss 90b2ef02d1 Add fetch smoke test. 2021-09-18 18:10:16 -07:00
Alex Crichton 9a28ac83c9
Merge pull request #9920 from ehuss/revert-curl-sys
Temporarily revert curl-sys update.
2021-09-18 15:42:28 -05:00
Eric Huss 637ee66375 Temporarily revert curl-sys update. 2021-09-18 12:43:14 -07:00
bors 33ee5f82ed Auto merge of #9917 - ehuss:update-curl-sys, r=alexcrichton
Update curl-sys

Updates to 0.4.47 to bring in https://github.com/alexcrichton/curl-rust/pull/406.
2021-09-17 13:51:54 +00:00
Eric Huss 28eb20305c Update curl-sys 2021-09-17 03:04:06 -07:00
bors 53471b7502 Auto merge of #9914 - alexcrichton:bump-curl, r=ehuss
Bump Cargo's curl requirement to 7.79.0

Brings in the latest release of `curl`
2021-09-15 15:11:44 +00:00
Alex Crichton 3093df485c Bump Cargo's curl requirement to 7.79.0
Brings in the latest release of `curl`
2021-09-15 07:39:25 -07:00
bors f69305e005 Auto merge of #9911 - rust-lang:revert-9686-rustin-patch-error, r=alexcrichton
Revert "When a dependency does not have a version, git or path, fails directly"

Reverts rust-lang/cargo#9686

We discussed, and felt like this change wasn't all that important, and a few people have mentioned that it caused problems for them.

Closes #9885
2021-09-14 20:20:30 +00:00
Eric Huss d4e504ca85
Revert "When a dependency does not have a version, git or path, fails directly" 2021-09-14 13:04:03 -07:00
bors 72ef2bd8cc Auto merge of #9904 - ehuss:contrib-debug-test, r=alexcrichton
Add some contributor docs for debugging testsuite tests.

This adds some suggestions on how to debug testsuite tests.

Closes #9757
2021-09-13 19:09:16 +00:00
bors ed8590e8c0 Auto merge of #9903 - jyn514:rustdoc-warnings, r=alexcrichton
Fix warnings when documenting with `--document-private-items`

- Use hyperlinks for URLs
- Fix broken intra-doc links

This doesn't fix the following warning, since I wasn't sure what change
was appropriate:
```
warning: public documentation for `rustc_process` links to private item `self::core::compiler::Context::primary_packages`
   --> src/cargo/core/compiler/compilation.rs:164:22
    |
164 |     /// flag), see [`crate::core::compiler::Context::primary_packages`].
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
    = note: this link resolves only because you passed `--document-private-items`, but will break without
```

To avoid noise, this doesn't add an `allow` either.
2021-09-13 18:38:16 +00:00
bors f7ca659fd3 Auto merge of #9905 - ehuss:wrong-output-error, r=alexcrichton
Improve "wrong output" error.

The error message for an improperly formatted build script output was a bit abrupt and unhelpful.  This adds some more details to the error message.
2021-09-13 18:07:19 +00:00
bors 70967dad28 Auto merge of #9906 - camelid:fix-warnings, r=alexcrichton
Fix warnings from better precision of `dead_code` lint

The lint now ignores derived `Clone` and `Debug` implementations, as of
PR rust-lang/rust#85200, which landed a couple of days ago.

I sprinkled `#[allow(dead_code)]` in a few places; the fields are not
expected to be read since they are just part of a very specific test.
2021-09-13 17:31:11 +00:00
Noah Lev f6823a6427 Fix warnings from better precision of dead_code lint
The lint now ignores derived `Clone` and `Debug` implementations, as of
PR rust-lang/rust#85200, which landed a couple of days ago.

I sprinkled `#[allow(dead_code)]` in a few places; the fields are not
expected to be read since they are just part of a very specific test.
2021-09-13 10:25:52 -07:00
Eric Huss c4e92ac69a Improve "wrong output" error. 2021-09-11 16:34:09 -07:00
Eric Huss f437af3ec3 Add some contributor docs for debugging testsuite tests. 2021-09-11 11:26:38 -07:00
Joshua Nelson bf62ae9a5a Fix warnings when documenting with --document-private-items
- Use hyperlinks for URLs
- Fix broken intra-doc links

This doesn't fix the following warning, since I wasn't sure what change
was appropriate:
```
warning: public documentation for `rustc_process` links to private item `self::core::compiler::Context::primary_packages`
   --> src/cargo/core/compiler/compilation.rs:164:22
    |
164 |     /// flag), see [`crate::core::compiler::Context::primary_packages`].
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this item is private
    |
    = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
    = note: this link resolves only because you passed `--document-private-items`, but will break without
```

To avoid noise, this doesn't add an `allow` either.
2021-09-11 12:33:45 -05:00
bors 2274489833 Auto merge of #9900 - ehuss:version-bump, r=alexcrichton
Bump to 0.58.0, update changelog
2021-09-10 18:24:27 +00:00
bors d58c646e95 Auto merge of #9898 - ehuss:rustc-profile-dev, r=alexcrichton
Fix rustc --profile=dev unstable check.

This fixes an oversight from #9685 where `cargo rustc --profile=dev` was accidentally changed to require `-Zunstable-options`.  1.54 and earlier supported that [here](https://github.com/rust-lang/cargo/blob/rust-1.54.0/src/bin/cargo/commands/rustc.rs#L490.

Fixes #9897
2021-09-10 17:54:06 +00:00
Eric Huss 8fe9eca8a5 Update changelog for 1.56 2021-09-10 10:29:28 -07:00
Eric Huss 0603dc0f20 Bump to 0.58.0 2021-09-10 09:47:06 -07:00
Eric Huss 49cf3de927 Fix rustc --profile=dev unstable check. 2021-09-10 09:40:37 -07:00
bors c7a1c09709 Auto merge of #9896 - frogtile:master, r=ehuss
config.md: fix typo

match  value with comment
2021-09-10 03:37:39 +00:00
frogtile 0fe36b6e2a
config.md: fix typo
match  value with comment
2021-09-10 09:21:34 +06:00
bors d7f413d682 Auto merge of #9893 - ehuss:windows-echo, r=alexcrichton
Enable some tests on windows.

This enables some more tests on windows that were disabled because `echo` is not always available. It's pretty easy to make a custom `echo`, so that's what this does.  I'm generally not comfortable with disabling tests just because there is an inconvenience like this.
2021-09-09 15:33:04 +00:00
bors 41687275e9 Auto merge of #9889 - ehuss:macos-strip, r=alexcrichton
Enable strip test on macos.

This enables the `strip_works` test for macos, which was fixed a while ago in https://github.com/rust-lang/rust/pull/82037.
2021-09-09 15:03:39 +00:00
bors b9c27227b0 Auto merge of #9890 - ehuss:remove-z-force-warn, r=alexcrichton
Fix `cargo fix --edition` on stable.

I accidentally missed the removal of a `-Zunstable-options` flag in #9800.  This prevented `cargo fix --edition` from working on stable/beta.
2021-09-09 14:36:06 +00:00
Eric Huss 422d5b030c Enable some tests on windows. 2021-09-08 23:34:37 -07:00
Eric Huss 1ae99dad6e Fix cargo fix --edition on stable. 2021-09-08 21:31:45 -07:00
Eric Huss 9b82a780f3 Enable strip test on macos. 2021-09-08 20:12:35 -07:00
bors e515c3277b Auto merge of #9873 - hi-rustin:rustin-patch-mask, r=alexcrichton
Remove log output that may leak tokens

close https://github.com/rust-lang/cargo/issues/9822
2021-09-08 14:32:15 +00:00
二手掉包工程师 e3879397e9
Remove log 2021-09-08 20:51:24 +08:00
bors 7d7c37089d Auto merge of #9859 - dtolnay-contrib:pullrequest, r=ehuss
rev = "refs/pull/𑑛/head"

GitHub exposes a named reference associated with the head of every pull request. For example, you can fetch *this* pull request:

```console
$ git fetch origin refs/pull/9859/head
$ git show FETCH_HEAD
```

Usually when I care about pulling in a patch of one of my dependencies using `[patch.crates-io]`, this is the ref that I want to depend on. None of the alternatives are good:

- `{ git = "the fork", branch = "the-pr-branch" }` — this is second closest to what I want, except that when the PR merges and the PR author deletes their fork, it'll breaks.

- `{ git = "the fork", rev = "commithash" }` — same failure mode as the previous. Also doesn't stay up to date with PR, which is sometimes what I want.

- `{ git = "the upstream", rev = "commithash" }` — doesn't work until the PR is merged or the repo owner creates a named branch or tag containing the PR commit among its ancestors, because otherwise the commit doesn't participate in Cargo's fetch.

- `{ git = "my own fork of PR author's repo", branch = "the-pr-branch" }` — doesn't stay up to date with PR.

This PR adds support for specifying a git dependency on the head of a pull request via the existing `rev` setting of git dependencies: `{ git = "the upstream", rev = "refs/pull/9859/head" }`.

Previously this would fail because the `cargo::sources::git::fetch` function touched in this pull request did not fetch the refspec that we care about. The failures look like:

```console
error: failed to get `mockall` as a dependency of package `testing v0.0.0`

Caused by:
  failed to load source for dependency `mockall`

Caused by:
  Unable to update https://github.com/asomers/mockall?rev=refs/pull/330/head

Caused by:
  revspec 'refs/pull/330/head' not found; class=Reference (4); code=NotFound (-3)
```

If dual purposing `rev` for this is not appealing, I would alternatively propose `{ git = "the upstream", pull-request = "9859" }` which Cargo will interpret using GitHub's ref naming convention as `refs/pull/9859/head`.
2021-09-07 17:51:57 +00:00
bors 941b123689 Auto merge of #9877 - dswij:fix-init-bin-help, r=ehuss
Update suggestion message on bad project name error

closes #9876

Error message suggest adding `[bin]` to `Cargo.toml` which should be `[[bin]]` instead.
2021-09-06 14:45:41 +00:00
dswij cb2932e47b Update help message on bad project name creation [bin] -> [[bin]] 2021-09-06 15:51:52 +08:00
dswij bd005850d8 Update test output for hint on project creation [bin] -> [[bin]] 2021-09-06 15:51:33 +08:00
bors a007f97c88 Auto merge of #9871 - davepacheco:issue-9868, r=ehuss
clarify what goes into "*-sys" crates

Fixes #9868
2021-09-04 18:13:44 +00:00
hi-rustin edad75df5b Mask token with "*"
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-09-04 12:45:45 +08:00
David Pacheco 914949e687 clarify what goes into "*-sys" crates 2021-09-03 10:56:09 -07:00
bors d405d73f0e Auto merge of #9869 - nipunn1313:errmsg, r=alexcrichton
Improve error message when unable to initialize git index repo

With this - it'll be more obvious which git repo
couldn't be initialized.

Looks like this
```
➜  cargo RUST_BACKTRACE=1 target/debug/cargo build
error: failed to get `anyhow` as a dependency of package `cargo v0.57.0 (/Users/nipunn/src/cargo)`

Caused by:
  failed to initialize index git repository (in "/Users/nipunn/.cargo/registry/index/github.com-1ecc6299db9ec823")

Caused by:
  failed to parse config file: invalid configuration key (in /Users/nipunn/.config/git/config:1); class=Config (7)
```

Does the best we can with #9854 - since I don't think it can actually be fixed.
Fixes #9854
2021-09-03 15:22:58 +00:00
Nipunn Koorapati 168fac4fa3 Improve error message when unable to initialize git index repo
With this - it'll be more obvious which git repo
couldn't be initialized.
2021-09-02 21:09:59 -04:00
bors 8da3cf70cd Auto merge of #9865 - nipunn1313:pkg_in_repo, r=alexcrichton
Use serde_json to generate cargo_vcs_info.json

Should make it easier to add fields in the future
2021-09-02 14:17:23 +00:00
Nipunn Koorapati 08abcc78d1 Use serde_json to generate cargo_vcs_info.json
Should make it easier to add fields in the future
2021-09-02 01:47:25 -04:00
bors 18751dd3f2 Auto merge of #9850 - hi-rustin:rustin-patch-no-track, r=alexcrichton
print the full destination path when no track duplicates

close https://github.com/rust-lang/cargo/issues/9797
2021-09-01 14:26:00 +00:00
bors ac58670849 Auto merge of #9800 - ehuss:stabilize-2021, r=alexcrichton
Stabilize 2021 edition

This stabilizes the 2021 edition.

Closes #9781
2021-09-01 13:53:35 +00:00
David Tolnay 86276d4ffe
Document the use of rev to depend on pull requests 2021-09-01 00:42:07 -07:00