]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoRework cargo-features a little.
Eric Huss [Thu, 21 Jan 2021 04:08:52 +0000 (20:08 -0800)]
Rework cargo-features a little.

* Add `removed` support.
* Include the version where it is stabilized.
* Include a links to the documentation in the error/warning messages.

3 years agoAdd more helpful message with stabilized -Z flags.
Eric Huss [Thu, 21 Jan 2021 03:46:50 +0000 (19:46 -0800)]
Add more helpful message with stabilized -Z flags.

Previously, when something was stabilized, Cargo would spit out a very
unhelpful error message about an unknown -Z flag. This changes it so
that it displays a helpful warning (or error).

3 years agoRemove publish-lockfile key from manifest.
Eric Huss [Thu, 21 Jan 2021 03:31:57 +0000 (19:31 -0800)]
Remove publish-lockfile key from manifest.

The feature was stabilized without the key in #7026 about 1.5 years ago.
(Will follow up with an error message in a subsequent commit.)

3 years agoAdd error message for wrong cargo-features placement.
Eric Huss [Thu, 21 Jan 2021 03:22:51 +0000 (19:22 -0800)]
Add error message for wrong cargo-features placement.

This is intended to help if the user puts cargo-features in the
wrong place in Cargo.toml.

3 years agoAdd some comments why some options are hidden.
Eric Huss [Thu, 21 Jan 2021 03:18:59 +0000 (19:18 -0800)]
Add some comments why some options are hidden.

3 years agoUnhide nightly-only flags.
Eric Huss [Thu, 21 Jan 2021 03:16:54 +0000 (19:16 -0800)]
Unhide nightly-only flags.

I changed my mind on how these should work. I think it is useful to
"advertise" the existence of these options on stable. The error message
if you try to use it should help guide on what to do.

3 years agoAuto merge of #8037 - djc:rfc-2495, r=ehuss
bors [Wed, 20 Jan 2021 16:12:56 +0000 (16:12 +0000)]
Auto merge of #8037 - djc:rfc-2495, r=ehuss

Implement support for rust-version field in project metadata

Needs a bunch more work, but I'd like some early feedback! Remaining work:

- [x] Bikeshedding name (picked `rust-version` here over `msrv` or `min-rust-version`)
- [x] Failing test for local dependency with unsatisfied MSRV
- [x] Requirement cannot be smaller than 1.27
- [x] Requirement cannot be smaller than initial release of edition used
- [x] Check for `run`, `verify` and `publish` subcommands
- [x] More tests (would love feedback on this)
- [x] Handle pre-release identifiers
- [x] Disallow semver range operators
- [x] Feature gate it
- [x] Add documentation for unstable feature

Minimal version of `@moxian's` earlier take in #7801.

cc rust-lang/rust#65262

3 years agoImplement support for rust-version field in project metadata
Dirkjan Ochtman [Tue, 24 Mar 2020 21:31:28 +0000 (22:31 +0100)]
Implement support for rust-version field in project metadata

3 years agoAuto merge of #9075 - alexcrichton:fix-cycles, r=ehuss
bors [Mon, 18 Jan 2021 19:51:07 +0000 (19:51 +0000)]
Auto merge of #9075 - alexcrichton:fix-cycles, r=ehuss

Fix a bug in Cargo's cyclic dep graph detection

Cargo's cyclic dependency graph detection turns out to have had a bug
for quite a long time as surfaced by #9073. The bug in Cargo has to do
with how dev-dependencies are handled. Cycles are "allowed" through
dev-dependencies because the dev-dependency can depend on the original
crate. Our cyclic graph detection, however, was too eagerly flagging a
package as known to not have a cycle before we had processed everything
about it.

The fix here was basically to just simplify the graph traversal. Instead
of traversing the raw `Resolve` this instead creates an alternate
in-memory graph which has the actual edges we care about for cycle
detection (e.g. every edge that wasn't induced via a dev-dependency).
With this simplified graph we then apply the exact same algorithm, but
this time it should be less buggy because we're not trying to do funky
things about switching sets about what's visited halfway through a
traversal.

Closes #9073

3 years agoAuto merge of #9081 - ximon18:typo-correction, r=ehuss
bors [Fri, 15 Jan 2021 15:02:30 +0000 (15:02 +0000)]
Auto merge of #9081 - ximon18:typo-correction, r=ehuss

Typo correction: artifcats -> artifacts

3 years agoTypo correction: artifcats -> artifacts
Ximon Eighteen [Fri, 15 Jan 2021 14:24:44 +0000 (15:24 +0100)]
Typo correction: artifcats -> artifacts

3 years agoAuto merge of #9079 - lzutao:stray-backtick, r=ehuss
bors [Fri, 15 Jan 2021 02:14:36 +0000 (02:14 +0000)]
Auto merge of #9079 - lzutao:stray-backtick, r=ehuss

Remove stray backtick from doc

Just a minor typo.

3 years agoRemove stray backtick from doc
Lzu Tao [Fri, 15 Jan 2021 01:24:37 +0000 (08:24 +0700)]
Remove stray backtick from doc

3 years agoFix a bug in Cargo's cyclic dep graph detection
Alex Crichton [Thu, 14 Jan 2021 16:40:12 +0000 (08:40 -0800)]
Fix a bug in Cargo's cyclic dep graph detection

Cargo's cyclic dependency graph detection turns out to have had a bug
for quite a long time as surfaced by #9073. The bug in Cargo has to do
with how dev-dependencies are handled. Cycles are "allowed" through
dev-dependencies because the dev-dependency can depend on the original
crate. Our cyclic graph detection, however, was too eagerly flagging a
package as known to not have a cycle before we had processed everything
about it.

The fix here was basically to just simplify the graph traversal. Instead
of traversing the raw `Resolve` this instead creates an alternate
in-memory graph which has the actual edges we care about for cycle
detection (e.g. every edge that wasn't induced via a dev-dependency).
With this simplified graph we then apply the exact same algorithm, but
this time it should be less buggy because we're not trying to do funky
things about switching sets about what's visited halfway through a
traversal.

Closes #9073

3 years agoFix typo in method name
Dirkjan Ochtman [Sat, 4 Apr 2020 18:39:14 +0000 (20:39 +0200)]
Fix typo in method name

3 years agoAuto merge of #9066 - rubenrua:hotfix_sort_bins, r=ehuss
bors [Tue, 12 Jan 2021 23:45:39 +0000 (23:45 +0000)]
Auto merge of #9066 - rubenrua:hotfix_sort_bins, r=ehuss

Sort available binaries when multiple

From:
```
error: `cargo run` could not determine which binary to run. Use the `--bin` option to specify a binary, or the `default-run` manifest key.
available binaries: basic-tutorial-13, basic-tutorial-6, basic-tutorial-1, basic-tutorial-4, basic-tutorial-9, basic-tutorial-2, basic-tutorial-3, basic-tutorial-5, basic-tutorial-12, playback-tutorial-4, basic-tutorial-8, basic-tutorial-7
```

To:
```
error: `cargo run` could not determine which binary to run. Use the `--bin` option to specify a binary, or the `default-run` manifest key.
available binaries: basic-tutorial-1, basic-tutorial-12, basic-tutorial-13, basic-tutorial-2, basic-tutorial-3, basic-tutorial-4, basic-tutorial-5, basic-tutorial-6, basic-tutorial-7, basic-tutorial-8, basic-tutorial-9, playback-tutorial-4
```

3 years agoAuto merge of #9067 - AnthonyMikh:patch-1, r=ehuss
bors [Tue, 12 Jan 2021 23:16:21 +0000 (23:16 +0000)]
Auto merge of #9067 - AnthonyMikh:patch-1, r=ehuss

Fix misspelling of environment variable

3 years agoFix misspelling of environment variable
AnthonyMikh [Tue, 12 Jan 2021 17:45:36 +0000 (20:45 +0300)]
Fix misspelling of environment variable

3 years agoTest for sort available binaries when multiple
rubenrua [Tue, 12 Jan 2021 22:10:51 +0000 (23:10 +0100)]
Test for sort available binaries when multiple

3 years agoAuto merge of #9070 - joshtriplett:opt-level-vs-debug, r=Eh2406
bors [Tue, 12 Jan 2021 20:43:56 +0000 (20:43 +0000)]
Auto merge of #9070 - joshtriplett:opt-level-vs-debug, r=Eh2406

Remove statement that opt-level 0 turns on debug

See https://github.com/rust-lang/cargo/pull/9020#issuecomment-751513035

3 years agoRemove statement that opt-level 0 turns on debug
Josh Triplett [Tue, 12 Jan 2021 20:31:49 +0000 (12:31 -0800)]
Remove statement that opt-level 0 turns on debug

See https://github.com/rust-lang/cargo/pull/9020#issuecomment-751513035

3 years agoAuto merge of #9065 - alexcrichton:fix-build-bug-again, r=ehuss
bors [Tue, 12 Jan 2021 17:14:29 +0000 (17:14 +0000)]
Auto merge of #9065 - alexcrichton:fix-build-bug-again, r=ehuss

Fix `links` vars showing up for testing packages

If a package is tested and the library for the package wasn't built
(e.g. only tested or it wasn't present) then the `links` env vars from
dependencies weren't showing up to the build script by accident. This
was an accidental regression from #8969.

The intention of #8969 was to exclude connections to build scripts
connected via dev-dependencies, but it only applied a heuristic because
the unit graph doesn't retain information about dev-dependencies. The
fix here is to instead actually retain information about
dev-dependencies which is only used for constructing the unit graph and
connecting build script executions to one another.

Closes #9063

3 years agoFix `links` vars showing up for testing packages
Alex Crichton [Mon, 11 Jan 2021 18:42:38 +0000 (10:42 -0800)]
Fix `links` vars showing up for testing packages

If a package is tested and the library for the package wasn't built
(e.g. only tested or it wasn't present) then the `links` env vars from
dependencies weren't showing up to the build script by accident. This
was an accidental regression from #8969.

The intention of #8969 was to exclude connections to build scripts
connected via dev-dependencies, but it only applied a heuristic because
the unit graph doesn't retain information about dev-dependencies. The
fix here is to instead actually retain information about
dev-dependencies which is only used for constructing the unit graph and
connecting build script executions to one another.

Closes #9063

3 years agoSort available binaries when multiple
rubenrua [Tue, 12 Jan 2021 07:46:25 +0000 (08:46 +0100)]
Sort available binaries when multiple

From:
```
error: `cargo run` could not determine which binary to run. Use the `--bin` option to specify a binary, or the `default-run` manifest key.
available binaries: basic-tutorial-13, basic-tutorial-6, basic-tutorial-1, basic-tutorial-4, basic-tutorial-9, basic-tutorial-2, basic-tutorial-3, basic-tutorial-5, basic-tutorial-12, playback-tutorial-4, basic-tutorial-8, basic-tutorial-7
```

To:
```
error: `cargo run` could not determine which binary to run. Use the `--bin` option to specify a binary, or the `default-run` manifest key.
available binaries: basic-tutorial-1, basic-tutorial-12, basic-tutorial-13, basic-tutorial-2, basic-tutorial-3, basic-tutorial-4, basic-tutorial-5, basic-tutorial-6, basic-tutorial-7, basic-tutorial-8, basic-tutorial-9, playback-tutorial-4
```

3 years agoAuto merge of #9059 - ehuss:fix-unit-for-host, r=alexcrichton
bors [Mon, 11 Jan 2021 15:12:09 +0000 (15:12 +0000)]
Auto merge of #9059 - ehuss:fix-unit-for-host, r=alexcrichton

Fix unit_for computation on proc-macros in shared workspace.

There was a bug where the UnitFor was not being computed properly for proc-macros in a workspace with shared dependencies, integration tests, and a mixture of various flags (`--workspace --all-targets --all-features`). The issue is that [this line](https://github.com/rust-lang/cargo/blob/faf05ac316cd71100a691799cd8da02fce6dd85d/src/cargo/core/compiler/unit_dependencies.rs#L474), which is used when attaching the implicit dependency from an integration test to its library, was using the wrong unit_for value (it was not checking if the implicit lib is a proc-macro). The consequence is that the graph could be built inconsistently, causing features to be randomly selected incorrectly if the integration test happened to be the first unit processed.

The solution here is to use a common function for transitioning the unit_for value. The with_for_host/with_host_features split was mostly a consequence of how things evolved over time, and keeping them separate wasn't really necessary.

3 years agoAuto merge of #9000 - JohnTitor:owner-add-docs, r=ehuss
bors [Sun, 10 Jan 2021 20:25:54 +0000 (20:25 +0000)]
Auto merge of #9000 - JohnTitor:owner-add-docs, r=ehuss

Document `could not find the github team` error on `cargo owner --add`

When running `cargo owner --add`, the `could not find the github team` error often occurs due to lack of the permissions.
Example cases: https://github.com/rust-lang/cargo/issues/5297#issuecomment-653709183, https://github.com/rust-lang/crates.io/issues/2928

I think it's worth documenting that error and the possible solution.

3 years agoAddress the review comments
Yuki Okushi [Sun, 10 Jan 2021 08:12:18 +0000 (17:12 +0900)]
Address the review comments

3 years agoFix unit_for computation on proc-macros in shared workspace.
Eric Huss [Sat, 9 Jan 2021 23:18:28 +0000 (15:18 -0800)]
Fix unit_for computation on proc-macros in shared workspace.

3 years agoAuto merge of #9057 - roblabla:patch-2, r=ehuss
bors [Fri, 8 Jan 2021 17:50:56 +0000 (17:50 +0000)]
Auto merge of #9057 - roblabla:patch-2, r=ehuss

Unstable section of cargo/config.toml takes bools

At least according to a quick local test, those should not be strings, but booleans! With the following cargo config:

```toml
[unstable]
mtime-on-use = 'yes'
```

I get the following cargo output:

```
error: error in /root/builds/hlab/isengard/agent-rust/.cargo_cache/config: `unstable.mtime-on-use` expected true/false, but found a string
```

3 years agoTimings takes an array of strings.
Robin Lambertz [Fri, 8 Jan 2021 17:30:56 +0000 (18:30 +0100)]
Timings takes an array of strings.

Co-authored-by: Eric Huss <eric@huss.org>
3 years agoUnstable section of cargo/config.toml takes bools
Robin Lambertz [Fri, 8 Jan 2021 17:06:22 +0000 (18:06 +0100)]
Unstable section of cargo/config.toml takes bools

3 years agoAuto merge of #9053 - sharnoff:master, r=alexcrichton
bors [Fri, 8 Jan 2021 16:44:12 +0000 (16:44 +0000)]
Auto merge of #9053 - sharnoff:master, r=alexcrichton

[doc] add note about empty environment variables for missing manifest keys

This is a small addition to the cargo book.

In [the section](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates) about the environment variables cargo sets to provide information about a crate, there's no mention about the value of those environment variables is if the key isn't present in the manifest.

As can be seen [here](https://github.com/rust-lang/cargo/blob/94e21ada550f91f5d32f2f51635792a79aeb8d63/src/cargo/core/compiler/compilation.rs#L287)¹, the values default to the empty string (instead of, say, not being present), so this change just adds a sentence in the book to clarify that.

If the terminology could be improved or there's a better place for this to be included, I'm happy to change it :)

---

¹ To be clear, I did also play around with this and found that the environment variables were empty. The code reference was more to double-check that the behavior I saw was a consistent pattern.

3 years agoadd doc note about environment variables for missing manifest keys
sharnoff [Thu, 7 Jan 2021 20:08:48 +0000 (20:08 +0000)]
add doc note about environment variables for missing manifest keys

3 years agoAuto merge of #9051 - matthiaskrgr:clippy_v18, r=ehuss
bors [Wed, 6 Jan 2021 20:59:07 +0000 (20:59 +0000)]
Auto merge of #9051 - matthiaskrgr:clippy_v18, r=ehuss

another round of clippy lint fixes

3 years agoAuto merge of #9050 - bishtpawan:master, r=alexcrichton
bors [Wed, 6 Jan 2021 15:28:00 +0000 (15:28 +0000)]
Auto merge of #9050 - bishtpawan:master, r=alexcrichton

Updated display message of cargo metadata --help

Resolved Issue #8928

3 years agoFix more clippy warnings;
Matthias Krüger [Wed, 6 Jan 2021 13:12:30 +0000 (14:12 +0100)]
Fix more clippy warnings;

clippy::comparison_to_empty
clippy::needless_question_mark
clippy::needless_borrow
clippy::match_like_matches_macro
clippy::vec_init_then_push
clippy::redundant_clone
clippy::nonminimal_bool
clippy::ptr_arg

3 years agofix clippy::unnecessary_wraps.
Matthias Krüger [Wed, 6 Jan 2021 13:15:31 +0000 (14:15 +0100)]
fix clippy::unnecessary_wraps.

Make functions that return Options but only ever return Ok() return the wrapped value directly and remove redundant matching

3 years agoreduce nesting of if x { } else { if y {} else {} } expressions by concerting to...
Matthias Krüger [Wed, 6 Jan 2021 12:59:17 +0000 (13:59 +0100)]
reduce nesting of if x { } else { if y {} else {} } expressions by concerting to if x {} else if y {} else {} (clippy::collapsible_else_if)

3 years agoUpdate display message for cargo metadata
bishtpawan [Wed, 6 Jan 2021 10:48:08 +0000 (16:18 +0530)]
Update display message for cargo metadata

3 years agoAuto merge of #8994 - jonhoo:manifest-in-local-deps-meta, r=ehuss
bors [Wed, 6 Jan 2021 00:01:52 +0000 (00:01 +0000)]
Auto merge of #8994 - jonhoo:manifest-in-local-deps-meta, r=ehuss

metadata: Supply local path for path dependencies

This is potentially a simpler way to address #7483 than #8988.

/cc https://github.com/rust-lang/rustfmt/issues/4247

Fixes #7483.

3 years agoAuto merge of #8922 - m-ou-se:2021, r=alexcrichton
bors [Tue, 5 Jan 2021 22:10:44 +0000 (22:10 +0000)]
Auto merge of #8922 - m-ou-se:2021, r=alexcrichton

Add support for Rust edition 2021.

This adds support for `ediiton = "2021"`.

Related `rustc` PR: https://github.com/rust-lang/rust/pull/79576

3 years agoAuto merge of #8997 - ehuss:stabilize-features, r=alexcrichton
bors [Tue, 5 Jan 2021 21:39:20 +0000 (21:39 +0000)]
Auto merge of #8997 - ehuss:stabilize-features, r=alexcrichton

Stabilize -Zfeatures and -Zpackage-features.

This follows through with [RFC 2957](https://github.com/rust-lang/rfcs/pull/2957) to stabilize the new feature resolver, and `-Zpackage-features` command-line changes.

This also rewrites the "Features" chapter to try to expand it a little.

I decided to leave the `-Zfeatures` flag in for now for testing, but it can be removed at a later date.

There is a code change related to the `package-name/feature-name` syntax for the `--features` flag. I wanted to stabilize that for `resolver = "1"`, but I previously neglected to separate that behavior out, so it required change to `Workspace::members_with_features` to make that work (see the `resolver1_member_features` test).

Closes #4328
Closes #5364
Closes #7914
Closes #7915
Closes #7916
Closes #8088
Closes #8431

3 years agoAuto merge of #9046 - Ekleog:store-kinds-list-in-bcx, r=alexcrichton
bors [Tue, 5 Jan 2021 18:09:59 +0000 (18:09 +0000)]
Auto merge of #9046 - Ekleog:store-kinds-list-in-bcx, r=alexcrichton

Small refactor, adding a list of all kinds to BuildContext

Involved in https://github.com/rust-lang/cargo/pull/9030

cc `@alexcrichton`

3 years agoDisable 2018->2021 in cargo fix for now, as 2021 lints are not ready.
Mara Bos [Tue, 5 Jan 2021 15:30:42 +0000 (16:30 +0100)]
Disable 2018->2021 in cargo fix for now, as 2021 lints are not ready.

3 years agoUse edition enum in cargo fix, and add edition 2021.
Mara Bos [Tue, 5 Jan 2021 14:52:39 +0000 (15:52 +0100)]
Use edition enum in cargo fix, and add edition 2021.

3 years agoSmall refactor, adding a list of all kinds to BuildContext
Léo Gaspard [Tue, 5 Jan 2021 01:31:57 +0000 (02:31 +0100)]
Small refactor, adding a list of all kinds to BuildContext

Involved in https://github.com/rust-lang/cargo/pull/9030

3 years agoAuto merge of #8986 - ehuss:fix-git-http-proxy, r=alexcrichton
bors [Mon, 4 Jan 2021 17:44:14 +0000 (17:44 +0000)]
Auto merge of #8986 - ehuss:fix-git-http-proxy, r=alexcrichton

Fix git http.proxy config setting.

The `http.proxy` setting in `~/.gitconfig` was never being used. This is because the `get_str` method of `git2::Config` requires a "snapshot" config. Otherwise, it aways returns an error of "get_string called on a live config object".

I'm not 100% positive it makes sense to fix this, since I'm uncertain this might introduce problems for people, but it seems to be the intent here.

3 years agoAuto merge of #9031 - noritada:update-update-descriptions, r=alexcrichton
bors [Mon, 4 Jan 2021 16:30:27 +0000 (16:30 +0000)]
Auto merge of #9031 - noritada:update-update-descriptions, r=alexcrichton

Clarify the help text of `--aggressive` and `--precise` of `update`

In the help text, `--aggressive` is described as follows:

```
        --aggressive              Force updating all dependencies of <name> as well
```

But `<name>` is not documented anywhere and it seems to be an older parameter name of `SPEC` before 0d2a2434f6f49cd671bd06e8cfc9f88bbbc67ff8.

This PR updates that parameter name and also clarifies in the help text that `--aggressive` and `--precise` make sense when used with `-p`, which specifies `SPEC`.

3 years agoAuto merge of #9037 - Swatinem:test-cwd, r=alexcrichton
bors [Mon, 4 Jan 2021 16:01:13 +0000 (16:01 +0000)]
Auto merge of #9037 - Swatinem:test-cwd, r=alexcrichton

Assert that tests are run in the crate directory

To avoid regressions to the test runtime directory, this asserts that
all test types (unit, integration, doctest) are executed in the crate
(manifest) directory, no matter where that crate is in relation to the
workspace root.

See #8992 / #8993

3 years agoAuto merge of #9044 - ehuss:update-mdbook, r=alexcrichton
bors [Mon, 4 Jan 2021 15:32:21 +0000 (15:32 +0000)]
Auto merge of #9044 - ehuss:update-mdbook, r=alexcrichton

Update mdbook

Changelog to 0.4.5: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045

3 years agoUpdate mdbook
Eric Huss [Mon, 4 Jan 2021 15:28:26 +0000 (07:28 -0800)]
Update mdbook

3 years agoAuto merge of #9042 - ehuss:version-bump, r=Eh2406
bors [Mon, 4 Jan 2021 00:16:05 +0000 (00:16 +0000)]
Auto merge of #9042 - ehuss:version-bump, r=Eh2406

Bump to 0.52.0, update changelog

3 years agoUpdate changelog for 1.50
Eric Huss [Sun, 3 Jan 2021 23:31:17 +0000 (15:31 -0800)]
Update changelog for 1.50

3 years agoBump to 0.52.0
Eric Huss [Sun, 3 Jan 2021 22:56:35 +0000 (14:56 -0800)]
Bump to 0.52.0

3 years agoAssert that tests are run in the crate directory
Arpad Borsos [Sat, 2 Jan 2021 13:34:21 +0000 (14:34 +0100)]
Assert that tests are run in the crate directory

To avoid regressions to the test runtime directory, this asserts that
all test types (unit, integration, doctest) are executed in the crate
(manifest) directory, no matter where that crate is in relation to the
workspace root.

See #8992 / #8993

3 years agoClarify the help text of `--aggressive` and `--precise` of `cargo update`
Noritada Kobayashi [Thu, 31 Dec 2020 09:13:50 +0000 (18:13 +0900)]
Clarify the help text of `--aggressive` and `--precise` of `cargo update`

This commit makes following 2 changes:

- Replace a parameter "<name>" with "SPEC". The former is an older name
  of the latter before 0d2a2434f6f49cd671bd06e8cfc9f88bbbc67ff8.
- Document that both options make sense when used with `-p`, which
  specifies SPEC.

3 years agoAuto merge of #9033 - ehuss:redundant_semicolons, r=Eh2406
bors [Thu, 31 Dec 2020 17:27:17 +0000 (17:27 +0000)]
Auto merge of #9033 - ehuss:redundant_semicolons, r=Eh2406

Fix redundant semicolon.

Lint introduced by https://github.com/rust-lang/rust/pull/79812.

3 years agoFix redundant semicolon.
Eric Huss [Thu, 31 Dec 2020 16:44:34 +0000 (08:44 -0800)]
Fix redundant semicolon.

3 years agoAuto merge of #9026 - kassens:master, r=Eh2406
bors [Tue, 29 Dec 2020 17:55:07 +0000 (17:55 +0000)]
Auto merge of #9026 - kassens:master, r=Eh2406

Clarify fingerprint log messages

I had to look up the source to figure out which side was the old value for a RUSTFLAGS fingerprint mismatch.

Making the logs a bit more explicit about which value is old and new would've helped me.

3 years agocargo fmt
Jan Kassens [Tue, 29 Dec 2020 17:42:28 +0000 (12:42 -0500)]
cargo fmt

3 years agoClarify fingerprint log messages
Jan Kassens [Tue, 29 Dec 2020 17:29:15 +0000 (17:29 +0000)]
Clarify fingerprint log messages

3 years agoAuto merge of #9013 - ehuss:credential-install-gnome-secret, r=Eh2406
bors [Thu, 24 Dec 2020 01:51:32 +0000 (01:51 +0000)]
Auto merge of #9013 - ehuss:credential-install-gnome-secret, r=Eh2406

Update credential docs for gnome-secret.

This can now be installed directly from crates.io, which is generally much faster than git.

3 years agoUpdate credential docs for gnome-secret.
Eric Huss [Thu, 24 Dec 2020 01:43:28 +0000 (17:43 -0800)]
Update credential docs for gnome-secret.

This can now be installed directly from crates.io, which is generally
much faster than git.

3 years agoAuto merge of #9009 - ehuss:bump-git2, r=alexcrichton
bors [Tue, 22 Dec 2020 18:10:56 +0000 (18:10 +0000)]
Auto merge of #9009 - ehuss:bump-git2, r=alexcrichton

Update git2

Pulls in https://github.com/rust-lang/git2-rs/pull/646 fixing an issue with arm64.

3 years agoUpdate git2
Eric Huss [Tue, 22 Dec 2020 14:03:54 +0000 (06:03 -0800)]
Update git2

3 years agoRewrite feature documentation section.
Eric Huss [Mon, 21 Dec 2020 19:37:35 +0000 (11:37 -0800)]
Rewrite feature documentation section.

Trying to make it clearer and expand on how to document.

3 years agoAuto merge of #8976 - ebroto:rustc_workspace_wrapper, r=ehuss
bors [Mon, 21 Dec 2020 19:37:30 +0000 (19:37 +0000)]
Auto merge of #8976 - ebroto:rustc_workspace_wrapper, r=ehuss

Stabilize RUSTC_WORKSPACE_WRAPPER

Stabilizing this environment variable would allow Clippy to fix a long-standing usability problem, [clippy#4612](https://github.com/rust-lang/rust-clippy/issues/4612).

It's also the last step towards stabilizing the `--fix` command-line argument in Clippy, that allows applying suggestions automatically when the lint supports it.

Closes #8143

r? `@ehuss`

3 years agoRearrange and try to clarify resolver 2 docs.
Eric Huss [Mon, 21 Dec 2020 19:02:46 +0000 (11:02 -0800)]
Rearrange and try to clarify resolver 2 docs.

* Avoid terms like "new", "previously", and "now".
* Add link for `resolver` field in manifest.md.
* Move the resolver version specification to the resolver chapter.
* Break up the version 2 section in features.md into subsections.
* Try to clarify some of the wording, and make it clearer when talking
  about resolver versions.
* Rewrite the section on version 2 command-line flags to hopefully be
  clearer.

3 years agoRemove resolver = "1" notes.
Eric Huss [Sat, 19 Dec 2020 17:15:15 +0000 (09:15 -0800)]
Remove resolver = "1" notes.

3 years agoAdd web-sys as an example.
Eric Huss [Sat, 19 Dec 2020 17:05:08 +0000 (09:05 -0800)]
Add web-sys as an example.

3 years agoUse recursive features in default example.
Eric Huss [Sat, 19 Dec 2020 16:58:19 +0000 (08:58 -0800)]
Use recursive features in default example.

3 years agoFix incorrect language tag.
Eric Huss [Sat, 19 Dec 2020 16:57:19 +0000 (08:57 -0800)]
Fix incorrect language tag.

3 years agoDon't use a conditional `no_std` attribute.
Eric Huss [Sat, 19 Dec 2020 16:56:12 +0000 (08:56 -0800)]
Don't use a conditional `no_std` attribute.

3 years agoStabilize -Zfeatures and -Zpackage-features.
Eric Huss [Thu, 17 Dec 2020 23:21:23 +0000 (15:21 -0800)]
Stabilize -Zfeatures and -Zpackage-features.

3 years agoDocument `could not find the github team` error on `cargo owner --add`
Yuki Okushi [Sat, 19 Dec 2020 15:23:29 +0000 (00:23 +0900)]
Document `could not find the github team` error on `cargo owner --add`

3 years agoAuto merge of #8987 - jonhoo:metadata-target-filtering, r=ehuss
bors [Sat, 19 Dec 2020 15:23:22 +0000 (15:23 +0000)]
Auto merge of #8987 - jonhoo:metadata-target-filtering, r=ehuss

Make cargo metadata and tree respect target

Previously, the `metadata` and `tree` subcommands would download
dependencies for all targets, regardless of whether those targets were
actually enabled. This PR updates them so that they only download the
same dependencies that building would do with the requested target(s).

`cargo metadata` still includes all targets by default; you can only opt
_out_ using `--filter-platform`. Ideally it should use `--target` the
same way `tree` does, but it's too late to change that now.

Fixes #8981.

3 years agoOops
Jon Gjengset [Fri, 18 Dec 2020 22:53:29 +0000 (14:53 -0800)]
Oops

3 years agopath is absolute path
Jon Gjengset [Fri, 18 Dec 2020 21:39:52 +0000 (13:39 -0800)]
path is absolute path

3 years agoSwitch to path and document
Jon Gjengset [Fri, 18 Dec 2020 21:12:03 +0000 (13:12 -0800)]
Switch to path and document

3 years agoAuto merge of #8998 - ehuss:update-git2, r=alexcrichton
bors [Fri, 18 Dec 2020 19:22:18 +0000 (19:22 +0000)]
Auto merge of #8998 - ehuss:update-git2, r=alexcrichton

Update git2

Hopefully this will finally fix #8517 (and hopefully won't cause much breakage).

Major changes:
- Requires libgit2 1.1: https://github.com/rust-lang/git2-rs/pull/632
- Update libgit2: https://github.com/rust-lang/git2-rs/pull/642  (changes: https://github.com/libgit2/libgit2/compare/7f4fa178629d559c037a1f72f79f79af9c1ef8ce...530d37beb2731a2073f5298242825a803815c37c)

3 years agoAuto merge of #8996 - alexcrichton:revert, r=ehuss
bors [Fri, 18 Dec 2020 18:21:58 +0000 (18:21 +0000)]
Auto merge of #8996 - alexcrichton:revert, r=ehuss

Revert #8954 - changing rustdoc's cwd

This PR reverts https://github.com/rust-lang/cargo/pull/8954 in reference to https://github.com/rust-lang/cargo/issues/8993 and https://github.com/rust-lang/cargo/issues/8992 where there's still definitely a bug to be fixed but we should probably avoid regressing in the meantime.

Closes https://github.com/rust-lang/cargo/issues/8992

3 years agoUpdate git2
Eric Huss [Fri, 18 Dec 2020 18:13:50 +0000 (10:13 -0800)]
Update git2

3 years agoRevert now-unnecessary change
Jon Gjengset [Fri, 18 Dec 2020 18:06:36 +0000 (10:06 -0800)]
Revert now-unnecessary change

3 years agoRemove unnecessary second download phase
Jon Gjengset [Fri, 18 Dec 2020 17:49:22 +0000 (09:49 -0800)]
Remove unnecessary second download phase

3 years agoRevert "Run rustdoc doctests relative to the workspace"
Alex Crichton [Fri, 18 Dec 2020 16:06:43 +0000 (08:06 -0800)]
Revert "Run rustdoc doctests relative to the workspace"

This reverts commit 2cc2ae8c963298143b71dceab0014dc09d4f65a8.

3 years agoRevert "fix failures on linux"
Alex Crichton [Fri, 18 Dec 2020 16:06:38 +0000 (08:06 -0800)]
Revert "fix failures on linux"

This reverts commit e729880f566839824d077d1be865ac5687fe0fdd.

3 years agoSupply manifest path for path dependencies
Jon Gjengset [Thu, 17 Dec 2020 21:26:10 +0000 (13:26 -0800)]
Supply manifest path for path dependencies

Fixes #7483.

3 years agoTrigger CI yet again for spurious failure.
Jon Gjengset [Thu, 17 Dec 2020 18:22:27 +0000 (10:22 -0800)]
Trigger CI yet again for spurious failure.

3 years agoRe-trigger CI for spurious failure.
Jon Gjengset [Thu, 17 Dec 2020 18:21:09 +0000 (10:21 -0800)]
Re-trigger CI for spurious failure.

3 years agoMake ResolveOpts::new take RequestedFeatures
Jon Gjengset [Thu, 17 Dec 2020 18:16:26 +0000 (10:16 -0800)]
Make ResolveOpts::new take RequestedFeatures

3 years agoAdd tests for fixed metadata download behavior
Jon Gjengset [Thu, 17 Dec 2020 18:01:24 +0000 (10:01 -0800)]
Add tests for fixed metadata download behavior

3 years agoAuto merge of #8991 - alexcrichton:debug-curl-verison, r=Eh2406
bors [Thu, 17 Dec 2020 16:18:33 +0000 (16:18 +0000)]
Auto merge of #8991 - alexcrichton:debug-curl-verison, r=Eh2406

With debug HTTP mode log curl's version

This will hopefully help any future reports where we're trying to
figure out what's going on with possible different versions of the
`curl` library.

3 years agoWith debug HTTP mode log curl's version
Alex Crichton [Thu, 17 Dec 2020 16:11:50 +0000 (08:11 -0800)]
With debug HTTP mode log curl's version

This will hopefully help any future reports where we're trying to
figure out what's going on with possible different versions of the
`curl` library.

3 years agoMake cargo metadata and tree respect target
Jon Gjengset [Wed, 16 Dec 2020 20:16:07 +0000 (12:16 -0800)]
Make cargo metadata and tree respect target

Previously, the `metadata` and `tree` subcommands would download
dependencies for all targets, regardless of whether those targets were
actually enabled. This PR updates them so that they only download the
same dependencies that building would do with the requested target(s).

`cargo metadata` still includes all targets by default; you can only opt
_out_ using `--filter-platform`. Ideally it should use `--target` the
same way `tree` does, but it's too late to change that now.

Fixes #8981.

3 years agoFix git http.proxy config setting.
Eric Huss [Wed, 16 Dec 2020 21:49:46 +0000 (13:49 -0800)]
Fix git http.proxy config setting.

3 years agoAuto merge of #8984 - ehuss:reject-ambiguous-git, r=Eh2406
bors [Wed, 16 Dec 2020 21:37:20 +0000 (21:37 +0000)]
Auto merge of #8984 - ehuss:reject-ambiguous-git, r=Eh2406

Reject ambiguous git dependency declaration.

This rejects a git dependency that specifies more than one of `branch`, `tag`, or `rev`. Cargo does not handle this case very well, and this warning has been in place for 4 years (since #2940).

Fixes #7841

3 years agoReject ambiguous git dependency declaration.
Eric Huss [Wed, 16 Dec 2020 21:10:11 +0000 (13:10 -0800)]
Reject ambiguous git dependency declaration.

3 years agoAuto merge of #8982 - ehuss:fix-alt-target-tests, r=alexcrichton
bors [Wed, 16 Dec 2020 21:02:59 +0000 (21:02 +0000)]
Auto merge of #8982 - ehuss:fix-alt-target-tests, r=alexcrichton

Fix tests not working with a different CARGO_TARGET_DIR.

Fixes #8980

3 years agoAuto merge of #8983 - ehuss:credential-versions, r=alexcrichton
bors [Wed, 16 Dec 2020 20:30:29 +0000 (20:30 +0000)]
Auto merge of #8983 - ehuss:credential-versions, r=alexcrichton

Add version to credential dependencies.

I forgot to add the version in the dependency declaration for cargo-credential.

3 years agoAdd version to credential dependencies.
Eric Huss [Wed, 16 Dec 2020 20:25:59 +0000 (12:25 -0800)]
Add version to credential dependencies.

I forgot to add the version in the dependency declaration for cargo-credential.