]> git.proxmox.com Git - cargo.git/log
cargo.git
4 years agoAuto merge of #7706 - matthiaskrgr:bump_git, r=Eh2406
bors [Mon, 23 Dec 2019 15:10:46 +0000 (15:10 +0000)]
Auto merge of #7706 - matthiaskrgr:bump_git, r=Eh2406

bump git2 dependencies

This required some manual code changes which dependabot could not perform.

4 years agoAuto merge of #7738 - JohnTitor:issue-none, r=ehuss
bors [Sun, 22 Dec 2019 17:54:52 +0000 (17:54 +0000)]
Auto merge of #7738 - JohnTitor:issue-none, r=ehuss

Use issue = "none" instead of "0"

Replace `issue = "0"` with `"none"`

CC: rust-lang/rust#67496
4 years agoAuto merge of #7737 - Mark-Simulacrum:cache-not-mem, r=ehuss
bors [Sun, 22 Dec 2019 17:35:34 +0000 (17:35 +0000)]
Auto merge of #7737 - Mark-Simulacrum:cache-not-mem, r=ehuss

Read cached output line-by-line

This avoids loading potentially gigabytes of output into memory, which
can cause OOMs.

Fixes #7736.

This does not add a test as I don't really want to generate gigabytes of output (that seems like a bad idea) -- and it's unclear how to test other than by causing OOM on (most) CI systems, and it's unlikely that we'll actually regress here.

4 years agoUse issue = "none" instead of "0"
Yuki Okushi [Sun, 22 Dec 2019 08:21:13 +0000 (17:21 +0900)]
Use issue = "none" instead of "0"

4 years agoAuto merge of #7733 - ehuss:doc-updates, r=Eh2406
bors [Sun, 22 Dec 2019 03:42:20 +0000 (03:42 +0000)]
Auto merge of #7733 - ehuss:doc-updates, r=Eh2406

Various doc updates

This is a collection of documentation updates that have been in my todo list for a while. Each change is in a separate commit.

The "features" chapter will probably get significant changes in the future, as it is pretty bare right now. Similarly the "workspace" chapter could probably use more examples.

Closes #3062
Closes #3817
Closes #3971
Closes #4212
Closes #4438
Closes #4756
Closes #5822
Closes #6913
Closes #7055

4 years agoRead cached output line-by-line
Mark Rousskov [Sun, 22 Dec 2019 03:03:30 +0000 (22:03 -0500)]
Read cached output line-by-line

This avoids loading potentially gigabytes of output into memory, which
can cause OOMs.

4 years agoNote that harness=false enables cfg(test).
Eric Huss [Sat, 21 Dec 2019 21:28:27 +0000 (13:28 -0800)]
Note that harness=false enables cfg(test).

4 years agoAdd build script examples to reference index.
Eric Huss [Sat, 21 Dec 2019 21:22:58 +0000 (13:22 -0800)]
Add build script examples to reference index.

4 years agoMove overriding dependencies into a separate chapter.
Eric Huss [Sat, 21 Dec 2019 20:45:30 +0000 (12:45 -0800)]
Move overriding dependencies into a separate chapter.

4 years agoAuto merge of #7734 - ehuss:version-bump, r=Eh2406
bors [Sun, 22 Dec 2019 00:07:30 +0000 (00:07 +0000)]
Auto merge of #7734 - ehuss:version-bump, r=Eh2406

Bump to 0.43.0, Update changelog

4 years agoUpdate changelog for 1.41.
Eric Huss [Sat, 21 Dec 2019 22:47:27 +0000 (14:47 -0800)]
Update changelog for 1.41.

4 years agoMove nightly-only changes to dedicated sections.
Eric Huss [Sat, 21 Dec 2019 22:14:10 +0000 (14:14 -0800)]
Move nightly-only changes to dedicated sections.

4 years agoBump to 0.43.0
Eric Huss [Sat, 21 Dec 2019 22:13:53 +0000 (14:13 -0800)]
Bump to 0.43.0

4 years agoAdd a table of contents for the manifest.
Eric Huss [Sat, 21 Dec 2019 05:28:27 +0000 (21:28 -0800)]
Add a table of contents for the manifest.

Closes #5822

4 years agoMove features to a separate chapter.
Eric Huss [Sat, 21 Dec 2019 04:43:37 +0000 (20:43 -0800)]
Move features to a separate chapter.

4 years agoMove workspaces to a separate chapter.
Eric Huss [Sat, 21 Dec 2019 02:53:59 +0000 (18:53 -0800)]
Move workspaces to a separate chapter.

4 years agoMove cargo targets to a new chapter.
Eric Huss [Sat, 21 Dec 2019 00:13:42 +0000 (16:13 -0800)]
Move cargo targets to a new chapter.

Closes #6913.

4 years agoDon't describe the package layout twice.
Eric Huss [Fri, 20 Dec 2019 17:55:06 +0000 (09:55 -0800)]
Don't describe the package layout twice.

4 years agoTry to clarify dev/test profile selection.
Eric Huss [Fri, 20 Dec 2019 02:20:14 +0000 (18:20 -0800)]
Try to clarify dev/test profile selection.

Closes #4438

4 years agobump git2 dependencies
Matthias Krüger [Fri, 13 Dec 2019 11:40:31 +0000 (12:40 +0100)]
bump git2 dependencies

4 years agoDocument that [replace] should not be used.
Eric Huss [Thu, 19 Dec 2019 22:21:44 +0000 (14:21 -0800)]
Document that [replace] should not be used.

cc #7092

4 years agoClarify that [replace] requires a version number.
Eric Huss [Thu, 19 Dec 2019 22:17:14 +0000 (14:17 -0800)]
Clarify that [replace] requires a version number.

Closes #4212

4 years agoTry to be clearer about how `--target` is different.
Eric Huss [Thu, 19 Dec 2019 21:57:27 +0000 (13:57 -0800)]
Try to be clearer about how `--target` is different.

Closes #3817

4 years agoTry to make it a little clearer that cargo package/publish will rebuild from scratch.
Eric Huss [Thu, 19 Dec 2019 21:33:13 +0000 (13:33 -0800)]
Try to make it a little clearer that cargo package/publish will rebuild from scratch.

Closes #3062

4 years agoShow example for 'cfg(feature="foo")' dependency alternative.
Eric Huss [Thu, 19 Dec 2019 21:26:14 +0000 (13:26 -0800)]
Show example for 'cfg(feature="foo")' dependency alternative.

4 years agoBreak up the Platform specific dependencies section.
Eric Huss [Thu, 19 Dec 2019 21:24:13 +0000 (13:24 -0800)]
Break up the Platform specific dependencies section.

4 years agoAuto merge of #7721 - ehuss:fix-doc-build-indent, r=Eh2406
bors [Thu, 19 Dec 2019 20:02:35 +0000 (20:02 +0000)]
Auto merge of #7721 - ehuss:fix-doc-build-indent, r=Eh2406

Fix indentation mistake in doc comment.

The `build` directory should be under `debug`.

4 years agoBuild script change detection: link to include/exclude
Eric Huss [Thu, 19 Dec 2019 19:45:04 +0000 (11:45 -0800)]
Build script change detection: link to include/exclude

4 years agoAuto merge of #7724 - ehuss:update-config-tracking-issue, r=alexcrichton
bors [Thu, 19 Dec 2019 19:45:09 +0000 (19:45 +0000)]
Auto merge of #7724 - ehuss:update-config-tracking-issue, r=alexcrichton

Add config tracking issue links.

4 years agoAdd config tracking issue links.
Eric Huss [Thu, 19 Dec 2019 19:29:02 +0000 (11:29 -0800)]
Add config tracking issue links.

4 years agoFix indentation mistake in doc comment.
Eric Huss [Thu, 19 Dec 2019 19:10:35 +0000 (11:10 -0800)]
Fix indentation mistake in doc comment.

The `build` directory should be under `debug`.

4 years agoMention `cargo metadata` for custom subcommands.
Eric Huss [Thu, 19 Dec 2019 18:30:27 +0000 (10:30 -0800)]
Mention `cargo metadata` for custom subcommands.

4 years agoDescribe dep-info files a little better.
Eric Huss [Thu, 19 Dec 2019 18:25:32 +0000 (10:25 -0800)]
Describe dep-info files a little better.

4 years agoClarify `cargo fix` behavior with features.
Eric Huss [Thu, 19 Dec 2019 18:11:17 +0000 (10:11 -0800)]
Clarify `cargo fix` behavior with features.

4 years agoAuto merge of #7649 - ehuss:config2, r=alexcrichton
bors [Thu, 19 Dec 2019 17:55:00 +0000 (17:55 +0000)]
Auto merge of #7649 - ehuss:config2, r=alexcrichton

Config enhancements.

This is a collection of changes to config handling. I intended to split this into separate PRs, but they all built on one another so I decided to do it as one. However, I can still split this up if desired.

High level overview:

- Refactorings, mainly to remove `pub` from `Config::get_table` and use serde API instead.
- Add `--config` CLI option.
- Add config `include` to include other files.

This makes some progress on #5416.
Closes #6699.

This makes a minor user-visible change in regards to `StringList` types. If an array is specified in a config as a list, and also as an env var, they will now be merged. Previously the environment variable overrode the file value. But if it is a string, then it won't join (env var takes precedence). I can probably change this, but I'm not sure if the old behavior is desired, or if it should merge all the time?

**Future plans**
This lays the groundwork for some more changes:
- Work on #7253 (`debug-assertions` and `debug` fails in environment vars). I have some ideas to try.
- Consider removing use of `get_list` for `paths`, and use a `Vec<ConfigRelativePath>`. This will require some non-trivial changes to how `ConfigSeqAccess` works. This is one of the last parts that does not use the serde API.
- Possibly change `[source]` to load config values in a lazy fashion. This will unlock the ability to use environment variables with source definitions (like CARGO_SOURCE_CRATES_IO_REPLACE_WITH).
- Possibly change `[profile]` to load config profiles in a lazy fashion. This will make it easier to use environment variables with profiles, particularly with arbitrarily named profiles.
- Possibly remove the case-sensitive environment variables in `-Zadvanced-env`. I think they are just too awkward, and prone to problems. Instead, drive people towards using `--config` instead of env vars.
- Add support for TOML tables in env vars (like `CARGO_PROFILES={my-profile={opt-level=1}})`). I started implementing it, but then looking at the use cases, it didn't seem as useful as I initially thought. However, it's still an option to try.

**Refactoring overview**

- `[source]` table now uses the serde API.
- `[target]` table now uses the serde API. This is complicated since the 'cfg()' entries are different from the triple entries. The 'cfg()' tables are loaded separately, and are accessed from `Config::target_cfgs`. Otherwise, it just uses `config.get` of the specific target.TRIPLE.
    - Moved the target config stuff into `config/target.rs`.
- Various changes to make this work:
    - Added `PathAndArgs` type which replaces `config.get_path_and_args`.
    - Changed `ConfigKey` to track the key parts as a list (instead of a string). This fixes an issue where quoted keys weren't handled properly (like `[foo.'a.b'.bar]`). This also seems to make a little more sense (it was joining parts into a string only to immediately call `split` on it). Changed various APIs to take a `ConfigKey` object instead of a string to avoid that splitting behavior.
    - `ValueDeserializer` now pre-computes the `Definition` so that it can provide a better error message when a value fails to deserialize.

Overall, there shouldn't be significant user-visible changes. Some error messages have changed and warnings have been added for some ignored keys. `-Zadvanced-env` now works for source and target tables, though I'm not really happy with that feature.

4 years agoFix for merge conflict.
Eric Huss [Thu, 19 Dec 2019 17:54:21 +0000 (09:54 -0800)]
Fix for merge conflict.

4 years agoAdding some config doc comments.
Eric Huss [Tue, 3 Dec 2019 02:03:45 +0000 (18:03 -0800)]
Adding some config doc comments.

4 years agoAdd some context to a [target] links deserialize error.
Eric Huss [Tue, 3 Dec 2019 02:01:49 +0000 (18:01 -0800)]
Add some context to a [target] links deserialize error.

4 years agoFixes for some test errors on Windows.
Eric Huss [Sun, 1 Dec 2019 20:47:13 +0000 (12:47 -0800)]
Fixes for some test errors on Windows.

4 years agoImplement config-include.
Eric Huss [Sun, 1 Dec 2019 18:19:02 +0000 (10:19 -0800)]
Implement config-include.

4 years agoAdd --config CLI option.
Eric Huss [Sat, 30 Nov 2019 21:55:52 +0000 (13:55 -0800)]
Add --config CLI option.

4 years agoStore Definition in ConfigValue.
Eric Huss [Thu, 28 Nov 2019 22:03:11 +0000 (14:03 -0800)]
Store Definition in ConfigValue.

4 years agoAdd a ConfigBuilder for tests.
Eric Huss [Thu, 28 Nov 2019 20:47:22 +0000 (12:47 -0800)]
Add a ConfigBuilder for tests.

4 years agoConfig refactoring.
Eric Huss [Sun, 24 Nov 2019 17:43:59 +0000 (09:43 -0800)]
Config refactoring.

4 years agoAuto merge of #7718 - ehuss:fix-vendor-alt-reg, r=alexcrichton
bors [Thu, 19 Dec 2019 09:59:33 +0000 (09:59 +0000)]
Auto merge of #7718 - ehuss:fix-vendor-alt-reg, r=alexcrichton

vendor: support alt registries

Adds support for alt registries to `cargo vendor`. It mostly worked before, but panicked when trying to display the `.cargo/config` instructions.

This isn't entirely elegant, as the source replacement looks like this:

```toml
[source.crates-io]
replace-with = "vendored-sources"

[source."file:///Users/eric/Proj/rust/cargo/target/cit/t0/alternative-registry"]
registry = "file:///Users/eric/Proj/rust/cargo/target/cit/t0/alternative-registry"
replace-with = "vendored-sources"

[source."file:///Users/eric/Proj/rust/cargo/target/cit/t0/gitdep"]
git = "file:///Users/eric/Proj/rust/cargo/target/cit/t0/gitdep"
branch = "master"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
```

The duplication of the URLs is a little unfortunate.  It could use the name of the registry, but that is not readily available and is tricky to obtain.  I feel like that is a challenge for another day.

Closes #7674.

4 years agoAuto merge of #7717 - giraffate:registry_flag_is_already_stabilized, r=ehuss
bors [Thu, 19 Dec 2019 09:42:04 +0000 (09:42 +0000)]
Auto merge of #7717 - giraffate:registry_flag_is_already_stabilized, r=ehuss

Update the output of `cargo -Z help`

`--registry` flag is already stabilized at 737382d7e.

4 years agoFix some chapter links missing from index pages.
Eric Huss [Thu, 19 Dec 2019 06:29:35 +0000 (22:29 -0800)]
Fix some chapter links missing from index pages.

4 years agoFix minor `vendor` mistake in glossary.
Eric Huss [Thu, 19 Dec 2019 06:17:22 +0000 (22:17 -0800)]
Fix minor `vendor` mistake in glossary.

4 years agoBe clearer about which fields are optional/required.
Eric Huss [Thu, 19 Dec 2019 06:06:53 +0000 (22:06 -0800)]
Be clearer about which fields are optional/required.

This attempts to be clearer about the requirements for crates.io publishing.

This also includes some other clarifications around various fields and specifying dependencies.

Closes #3971
Closes #7055

4 years agoSimplify some crates.io links.
Eric Huss [Wed, 18 Dec 2019 19:27:30 +0000 (11:27 -0800)]
Simplify some crates.io links.

4 years agoFix awkward comma in sentence.
Eric Huss [Wed, 18 Dec 2019 19:04:53 +0000 (11:04 -0800)]
Fix awkward comma in sentence.

4 years agoDocument the target directory layout.
Eric Huss [Wed, 18 Dec 2019 18:34:46 +0000 (10:34 -0800)]
Document the target directory layout.

Closes #4756.

4 years agoAdd links for rustflags/rustdocflags.
Eric Huss [Wed, 18 Dec 2019 17:08:01 +0000 (09:08 -0800)]
Add links for rustflags/rustdocflags.

4 years agoMention that `--features` can be specified multiple times.
Eric Huss [Wed, 18 Dec 2019 16:28:28 +0000 (08:28 -0800)]
Mention that `--features` can be specified multiple times.

4 years agoMention --offline in the FAQ entry on offline.
Eric Huss [Wed, 18 Dec 2019 16:23:51 +0000 (08:23 -0800)]
Mention --offline in the FAQ entry on offline.

4 years agovendor: support alt registries
Eric Huss [Wed, 18 Dec 2019 01:44:37 +0000 (17:44 -0800)]
vendor: support alt registries

4 years agoUpdate the output of `cargo -Z help`
Takayuki Nakata [Wed, 18 Dec 2019 00:46:13 +0000 (09:46 +0900)]
Update the output of `cargo -Z help`

`--registry` flag is already stabilized at 737382d7e.

4 years agoAuto merge of #7708 - giraffate:fix_overwriting_credentials, r=ehuss
bors [Tue, 17 Dec 2019 22:28:09 +0000 (22:28 +0000)]
Auto merge of #7708 - giraffate:fix_overwriting_credentials, r=ehuss

Fix overwriting alternate registry token

When executing `cargo login`, 2nd alternate registry token overwrites
1st alternate registry token.

Fixes #7701.

4 years agoRefactoring of creating registry
Takayuki Nakata [Tue, 17 Dec 2019 05:12:27 +0000 (14:12 +0900)]
Refactoring of creating registry

4 years agoRefactoring to call new `generate_*` functions instead of duplicating codes
Takayuki Nakata [Tue, 17 Dec 2019 03:31:01 +0000 (12:31 +0900)]
Refactoring to call new `generate_*` functions instead of duplicating codes

4 years agoAppend `registries` to config
Takayuki Nakata [Tue, 17 Dec 2019 00:59:45 +0000 (09:59 +0900)]
Append `registries` to config

4 years agoRemove unneeded flags
Takayuki Nakata [Mon, 16 Dec 2019 23:33:48 +0000 (08:33 +0900)]
Remove unneeded flags

4 years agoAuto merge of #7700 - ehuss:proc-macro-extern-prelude, r=alexcrichton
bors [Mon, 16 Dec 2019 16:29:59 +0000 (16:29 +0000)]
Auto merge of #7700 - ehuss:proc-macro-extern-prelude, r=alexcrichton

Add proc_macro to the extern prelude.

This makes it so that a proc-macro library can use the `proc_macro` crate without the `extern crate proc_macro;` item on the 2018 edition.  This is the Cargo half of https://github.com/rust-lang/rust/pull/64882.

4 years agoAuto merge of #7710 - dtolnay:argorder, r=alexcrichton
bors [Mon, 16 Dec 2019 15:49:05 +0000 (15:49 +0000)]
Auto merge of #7710 - dtolnay:argorder, r=alexcrichton

Pass --edition after --crate-name

This PR swaps the order of the --edition and --crate-name args in the rustc invocation.

- Before: `rustc --edition=2018 --crate-name cargo ...`
- After: `rustc --crate-name cargo --edition=2018 ...`

The crate name is a lot more relevant when looking at processes in `top` for example, and should appear first.

4 years agoAuto merge of #7631 - jsgf:explicit-version, r=alexcrichton
bors [Mon, 16 Dec 2019 15:29:53 +0000 (15:29 +0000)]
Auto merge of #7631 - jsgf:explicit-version, r=alexcrichton

vendor: implement --versioned-dirs

Implement `--explicit-version` from standalone cargo-vendor. This helps with vendoring
performance as it avoids redundantly deleting and re-copying already vendored packages.

For example, re-vendoring cargo's dependencies it makes a big difference in wallclock
time. For initial vendoring it makes no difference, but re-vendoring (ie, when most or all dependencies haven't changed) without explicit versions is actually slightly slower
(5.8s -> 6s), but with explicit versions it goes from 5.8s -> 1.6s.

Timings:

Without explicit versions, initial vendor
real 0m5.810s
user 0m0.924s
sys 0m2.491s

Re-vendor:
real 0m6.083s
user 0m0.937s
sys 0m2.654s

With explicit versions, initial vendor:
real 0m5.810s
user 0m0.937s
sys 0m2.461s

Re-vendor:
real 0m1.567s
user 0m0.578s
sys 0m0.967s

Its interesting to look at the syscall summary:

Without explicit versions:
```
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 25.17    1.104699          18     59432      1065 openat
 19.86    0.871574          21     41156     13825 unlink
 13.64    0.598739           2    210510           lstat
  9.02    0.395948          29     13208           copy_file_range
  8.00    0.351242          11     30245           read
  6.36    0.279005           3     72487      4476 statx
  5.35    0.235027           6     37219           write
  4.02    0.176267           3     58368           close
```
with explicit versions:
```
 29.38    0.419068          15     27798     13825 unlink
 25.52    0.364021           1    209586           lstat
 20.67    0.294788          16     17967      1032 openat
 10.42    0.148586           4     35646           write
  3.53    0.050350           3     13825           chmod
  3.14    0.044786           2     16701      1622 statx
  2.19    0.031171           1     16936           close
  1.86    0.026538          24      1078           rmdir
```

Specifically, there are a lot fewer opens, copy_file_ranges, and unlinks.

4 years agoRefactoring
Takayuki Nakata [Sat, 14 Dec 2019 03:42:00 +0000 (12:42 +0900)]
Refactoring

4 years agoPass --edition after --crate-name
David Tolnay [Sat, 14 Dec 2019 03:10:15 +0000 (19:10 -0800)]
Pass --edition after --crate-name

This PR swaps the order of the --edition and --crate-name args in the
rustc invocation.

    Before: rustc --edition=2018 --crate-name cargo ...
    After: rustc --crate-name cargo --edition=2018 ...

The crate name is a lot more relevant when looking at processes in top
for example, and should appear first.

4 years agoFix overwriting alternate registry token
Takayuki Nakata [Fri, 13 Dec 2019 12:54:07 +0000 (21:54 +0900)]
Fix overwriting alternate registry token

When executing `cargo login`, 2nd alternate registry token overwrites
1st alternate registry token.

Fixes #7701.

4 years agoAdd proc_macro to the extern prelude.
Eric Huss [Thu, 12 Dec 2019 19:56:33 +0000 (11:56 -0800)]
Add proc_macro to the extern prelude.

4 years agoAuto merge of #7698 - dtolnay:description, r=alexcrichton
bors [Thu, 12 Dec 2019 19:03:51 +0000 (19:03 +0000)]
Auto merge of #7698 - dtolnay:description, r=alexcrichton

Remove use of deprecated Error::description method

We are getting ready to deprecate std::error::Error::description: rust-lang/rust#66919. This PR replaces one place that should be using Display instead.

4 years agoAuto merge of #7695 - giraffate:add_and_update_tests_for_jobs_of_cargo_build, r=ehuss
bors [Thu, 12 Dec 2019 18:39:29 +0000 (18:39 +0000)]
Auto merge of #7695 - giraffate:add_and_update_tests_for_jobs_of_cargo_build, r=ehuss

Add and move tests for jobs of `cargo build`

A test when argument is negative is added. In addition, `default_cargo_config_jobs` and `good_cargo_config_jobs` is moved from `testsuite/bad_config.rs` to `testsuite/build.rs` because these tests are not for `bad config`.

4 years agoAuto merge of #7680 - stefanhoelzl:issue-7183, r=ehuss
bors [Thu, 12 Dec 2019 18:19:57 +0000 (18:19 +0000)]
Auto merge of #7680 - stefanhoelzl:issue-7183, r=ehuss

include dotfiles in packages

This PR solves #7183

It changes the behavior of `cargo package` to also include dotfiles by default.

It should be discussed if this is intended or if the implementation should be changed to only include dotfiles which are specified in the `include` section.

From the [existing comment](https://github.com/stefanhoelzl/cargo/blob/40885dfab40a1bf62b22aa03f732ef45163c013f/src/cargo/sources/path.rs#L358) it is a little bit unclear to me, but I supposed it was intended only to exclude directories starting with a dot?

4 years agoAuto merge of #7699 - ehuss:build-std-no-sysroot, r=alexcrichton
bors [Thu, 12 Dec 2019 17:59:45 +0000 (17:59 +0000)]
Auto merge of #7699 - ehuss:build-std-no-sysroot, r=alexcrichton

Switch build-std to use --extern

Switch `build-std` to use `--extern` flags instead of `--sysroot`.

This is mostly a revert of #7421. It uses the new extern flag options introduced in https://github.com/rust-lang/rust/pull/67074. It avoids modifying the extern prelude which was the source of the problem of https://github.com/rust-lang/wg-cargo-std-aware/issues/40.

Closes https://github.com/rust-lang/wg-cargo-std-aware/issues/49
Reopens https://github.com/rust-lang/wg-cargo-std-aware/issues/31

4 years agoSwitch build-std to use --extern
Eric Huss [Fri, 6 Dec 2019 00:52:13 +0000 (16:52 -0800)]
Switch build-std to use --extern

4 years agoRemove use of deprecated Error::description method
David Tolnay [Thu, 12 Dec 2019 07:34:08 +0000 (23:34 -0800)]
Remove use of deprecated Error::description method

4 years agoAuto merge of #7694 - danielparks:issue-7691-manifest-badges-section, r=ehuss
bors [Wed, 11 Dec 2019 17:51:57 +0000 (17:51 +0000)]
Auto merge of #7694 - danielparks:issue-7691-manifest-badges-section, r=ehuss

Clarify manifest format docs for [badges] section

Previously the `[badges]` section documentation was mixed in with the `[package]` section. This extracts it out under its own heading.

This also pulls the `license` and `license-file` field documentation out of the package metadata code block. It sets the example license to “MIT OR Apache-2.0” since that is the typical licensing scheme for many crates.

This includes minor rewrites for clarity and to match the register of the rest of the document.

This resolves issue #7691.

4 years agoAuto merge of #7696 - matthiaskrgr:typ0s, r=ehuss
bors [Wed, 11 Dec 2019 17:33:14 +0000 (17:33 +0000)]
Auto merge of #7696 - matthiaskrgr:typ0s, r=ehuss

fix a couple of typos

4 years agofix a couple of typos
Matthias Krüger [Wed, 11 Dec 2019 14:31:26 +0000 (15:31 +0100)]
fix a couple of typos

4 years agoAdd and move tests for jobs of `cargo build`
Takayuki Nakata [Wed, 11 Dec 2019 09:01:01 +0000 (18:01 +0900)]
Add and move tests for jobs of `cargo build`

A test when argument is negative is added. In addition,
`default_cargo_config_jobs` and `good_cargo_config_jobs` is moved from
`testsuite/bad_config.rs` to `testsuite/build.rs` because these tests
are not for `bad config`.

4 years agoClarify manifest format docs for [badges] section
Daniel Parks [Tue, 10 Dec 2019 23:20:01 +0000 (15:20 -0800)]
Clarify manifest format docs for [badges] section

Previously the `[badges]` section documentation was mixed in with the
`[package]` section. This extracts it out under its own heading.

This also pulls the `license` and `license-file` field documentation out
of the package metadata code block. It sets the example license to “MIT
OR Apache-2.0” since that is the typical licensing scheme for many
crates.

This includes minor rewrites for clarity and to match the register of
the rest of the document.

This resolves issue #7691.

4 years agodeleted unneccessary ignore pattern
Stefan Hoelzl [Tue, 10 Dec 2019 20:53:15 +0000 (21:53 +0100)]
deleted unneccessary ignore pattern

4 years agoAuto merge of #7693 - ehuss:bump-cargo-platform, r=Eh2406
bors [Tue, 10 Dec 2019 20:17:50 +0000 (20:17 +0000)]
Auto merge of #7693 - ehuss:bump-cargo-platform, r=Eh2406

Bump cargo-platform version.

Needed for changes from #7660.

4 years agoBump cargo-platform version.
Eric Huss [Tue, 10 Dec 2019 19:59:06 +0000 (11:59 -0800)]
Bump cargo-platform version.

4 years agoAuto merge of #7690 - giraffate:add_test_for_cargo_locate_project, r=alexcrichton
bors [Tue, 10 Dec 2019 17:25:27 +0000 (17:25 +0000)]
Auto merge of #7690 - giraffate:add_test_for_cargo_locate_project, r=alexcrichton

Add a test for `cargo locate-project`

There seems to be no test for `cargo locate-project`, so I add the simple test case for this command.

4 years agoDocument --version-dirs in cargo-vendor.adoc and re-generate all doc formats.
Jeremy Fitzhardinge [Tue, 10 Dec 2019 00:46:25 +0000 (16:46 -0800)]
Document --version-dirs in cargo-vendor.adoc and re-generate all doc formats.

4 years agoAdd a test for `cargo locate-project`
Takayuki Nakata [Tue, 10 Dec 2019 00:18:12 +0000 (09:18 +0900)]
Add a test for `cargo locate-project`

4 years agoAuto merge of #7660 - benediktwerner:master, r=alexcrichton
bors [Mon, 9 Dec 2019 17:26:35 +0000 (17:26 +0000)]
Auto merge of #7660 - benediktwerner:master, r=alexcrichton

Emit error on [target.'cfg(debug_assertions)'.dependencies] and similar

Closes #7634

Cargo now emits an error if an unsupported cfg key or name is used for specifying a target.

This PR also updates the docs to clarify this behavior.

4 years agoAuto merge of #7687 - giraffate:Update_the_layout_of_cargo_commands, r=ehuss
bors [Mon, 9 Dec 2019 16:16:56 +0000 (16:16 +0000)]
Auto merge of #7687 - giraffate:Update_the_layout_of_cargo_commands, r=ehuss

Update the layout of `Cargo Commands` in doc

It seems better to improve the follwing two points.
- A subcategory like [`Build Commands`](https://doc.rust-lang.org/stable/cargo/commands/build-commands.html) does not contain any contents.
- [`Cargo Commands`](https://doc.rust-lang.org/stable/cargo/commands/index.html) actually just points to `cargo` command.

So, I fix categories like `Build Commands` to include links to each
commands. In addition, I add `cargo` command to `General Commands`.

I just changed the way it was arranged and nothing about the contents.
The following is an example.

before
<img width="1283" alt="スクリーンショット 2019-12-09 10 01 44" src="https://user-images.githubusercontent.com/17407489/70399888-f2c3df80-1a6a-11ea-813b-4bba47d3b659.png">

after
<img width="1415" alt="スクリーンショット 2019-12-09 10 06 43" src="https://user-images.githubusercontent.com/17407489/70400018-a4631080-1a6b-11ea-8bd4-ab15338ae508.png">

4 years agoUpdate the layout of `Cargo Commands` in doc
Takayuki Nakata [Mon, 9 Dec 2019 00:47:50 +0000 (09:47 +0900)]
Update the layout of `Cargo Commands` in doc

It seems better to improve the follwing two points.
- A subcategory like `Build Commands` does not contain any contents.
- `Cargo Commands` actually just points to `cargo` command.

So, I fix categories like `Build Commands` to include links to each
commands. In addition, I add `cargo` command to `General Commands`.

4 years agoAuto merge of #7682 - fintelia:patch-1, r=ehuss
bors [Sun, 8 Dec 2019 17:51:56 +0000 (17:51 +0000)]
Auto merge of #7682 - fintelia:patch-1, r=ehuss

Features and dependencies can't have the same name

The document was describing a Cargo.toml containing
```
[dependencies]
postgres = { version = "*", optional = true }
postgres-macros = { version = "*", optional = true }

[features]
postgres = ["postgres", "postgres-macros"]
```

If you tried doing this you'd get an error:
```
error: failed to parse manifest at `/home/jonathan/tmp/features/Cargo.toml`

Caused by:
  Features and dependencies cannot have the same name: `postgres`
```

4 years agovariant with old behaviour but dotfiles can be included
Stefan Hoelzl [Sun, 8 Dec 2019 15:06:57 +0000 (16:06 +0100)]
variant with old behaviour but dotfiles can be included

4 years agotest variant to exclude dot-files/dirs by default
Stefan Hoelzl [Sun, 8 Dec 2019 11:43:39 +0000 (12:43 +0100)]
test variant to exclude dot-files/dirs by default

4 years agoadded dotfile to include test
Stefan Hoelzl [Sun, 8 Dec 2019 11:10:13 +0000 (12:10 +0100)]
added dotfile to include test

got rid of extra test for dotfiles

4 years agoFeatures and dependencies can't have the same name
Jonathan Behrens [Sun, 8 Dec 2019 00:24:12 +0000 (19:24 -0500)]
Features and dependencies can't have the same name

The document was describing a Cargo.toml containing
```
[dependencies]
postgres = { version = "*", optional = true }
postgres-macros = { version = "*", optional = true }

[features]
postgres = ["postgres", "postgres-macros"]
```

If you tried doing this you'd get an error:
```
error: failed to parse manifest at `/home/jonathan/tmp/features/Cargo.toml`

Caused by:
  Features and dependencies cannot have the same name: `postgres`
```

4 years agofix format issues
Stefan Hoelzl [Sat, 7 Dec 2019 19:19:17 +0000 (20:19 +0100)]
fix format issues

4 years agoWarn instead of error
Benedikt Werner [Sat, 7 Dec 2019 08:10:06 +0000 (09:10 +0100)]
Warn instead of error

4 years agoinclude dotfiles
Stefan Hoelzl [Fri, 6 Dec 2019 21:29:21 +0000 (22:29 +0100)]
include dotfiles

4 years agoadded testcase
Stefan Hoelzl [Fri, 6 Dec 2019 20:42:34 +0000 (21:42 +0100)]
added testcase

4 years agoAuto merge of #7672 - giraffate:fix_some_typos, r=alexcrichton
bors [Fri, 6 Dec 2019 14:01:07 +0000 (14:01 +0000)]
Auto merge of #7672 - giraffate:fix_some_typos, r=alexcrichton

Fix some typos in doc

4 years agoConvert --explicit-version -> --versioned-dirs
Jeremy Fitzhardinge [Wed, 4 Dec 2019 23:30:13 +0000 (15:30 -0800)]
Convert --explicit-version -> --versioned-dirs