7261 Commits

Author SHA1 Message Date
Katharina Fey
142bafb7e6
Adding feature tests to publish and package 2018-12-29 11:45:05 +01:00
Katharina Fey
256fc39492
Adding feature-flags to cargo publish and cargo package
This change adds the `--features` and `--all-features` flags to the
above mentioned commands. This is to allow publishing of crates that
have certain feature requirements for compilation, without having to
rely on `--no-verify` which isn't good practise.

This PR adds two new fields `features` and `all_features` to both the
`PackageOpts` and `PublishOpts` and also adds the argument options
to the CLI commands.

Merging this feature will allow people to publish crates on crates.io
that require some feature flag to compile (or all?) without needing
to rely on not checking the package before uploading, potentially
resulting in less packaging errors and broken packages.
2018-12-26 12:47:02 +01:00
bors
fef78023a9 Auto merge of #6481 - ehuss:man-update, r=alexcrichton
Some minor documentation changes.

A few updates for things that changed recently, some things that were
wrong/missing, and hopefully some clarifications on some matters.

For reviewing, I recommend ignoring the auto-generated .html/.man files and focus on the .md/.adoc files.
2018-12-24 17:36:11 +00:00
bors
758cd5ca78 Auto merge of #6480 - ehuss:metadata-links, r=alexcrichton
Add `links` to `cargo metadata`.

This is needed for creating registry index entries.
2018-12-24 16:39:34 +00:00
Eric Huss
f78ab2ca4b Some minor documentation changes.
A few updates for things that changed recently, some things that were
wrong/missing, and hopefully some clarifications on some matters.
2018-12-23 14:11:12 -08:00
Eric Huss
53de08a57d Add links to cargo metadata.
This is needed for creating registry index entries.
2018-12-23 11:34:14 -08:00
bors
e593efc9cb Auto merge of #6476 - dwijnand:salvaged-semver-work, r=Eh2406
Salvaged semver work

None
2018-12-22 22:14:54 +00:00
Dale Wijnand
1606ab3a79
Replace PackageId::wrap with PackageId::pure 2018-12-22 22:04:03 +00:00
bors
8e547a7b14 Auto merge of #6470 - ehuss:warn-unused-patch, r=alexcrichton
Warn on unused patches.

Adds a warning when a `[patch]` entry fails to match anything.
I've hit this several times in the past, and it always takes me
5 minutes of confusion to figure out what's wrong.

Fixes #6444
2018-12-22 21:49:21 +00:00
Eric Huss
e35ecbe7ac Warn on unused patches. 2018-12-21 18:54:03 -08:00
bors
b61f3cc66b Auto merge of #6473 - Eh2406:rustc-0, r=alexcrichton
don't write a an incorrect rustc version to the fingerprint file

In making https://github.com/holmgr/cargo-sweep/pull/14 I noted that some fingerprint files related to build scripts report being built with a rustc that hashes to "0". To work around this I just marked them as still being needed, even though no rustc that hashes to "0" is currently installed.

I believe that this PR just filles in the correct info for the build script fingerprints. This makes it possible for outside tools to more reliably clean up after cargo, at basically no cost.
@ehuss Thanks again for the help.
2018-12-21 20:07:17 +00:00
Eh2406
eb8720a54c don't write a an incorrect rustc version to the fingerprint file 2018-12-21 12:04:37 -05:00
bors
1dff476dca Auto merge of #6466 - ehuss:registry-cleanup, r=alexcrichton
Rewrite `login` and registry cleanups.

- Login:
    - Change `login` so that it reads the API host from the registry config so it knows the `{api}/me` URL to display.
    - The `--host` flag is deprecated/unused. It wasn't used for much before.
    - `--registry` supports interactive entry of the token (does not require it on the command line).
    - Displays a message after saving the token (fixes #5868).
    - Because `login` now requires an index, some of the tests had to be updated.
- Fix so that if `api` is missing from the config, it will display a nice error message instead of panicking with unwrap.
2018-12-20 15:40:49 +00:00
Eric Huss
70f84bf3b0 Rewrite login and registry cleanups. 2018-12-20 04:34:35 -08:00
bors
d35f1bd6b2 Auto merge of #6462 - pavel-zhigulin:fix_issue_––#6461, r=ehuss
[issue#6461] Fix cargo commands list

Fixes #6461 -  cargo autocompletion script
2018-12-20 11:36:14 +00:00
Zhigulin Pavel
56fec5c07d Remove tail call 2018-12-20 14:01:22 +03:00
Dale Wijnand
cffd5b24dc
Use ToSemver more 2018-12-20 10:05:47 +00:00
bors
7cbf886ae9 Auto merge of #6469 - ehuss:registry-name, r=dwijnand
Restrict registry names to same style as package names.

See https://github.com/rust-lang/cargo/issues/4688#issuecomment-341114657
2018-12-20 08:02:10 +00:00
Eric Huss
080f0b34c4 Restrict registry names to same style as package names. 2018-12-19 20:36:13 -08:00
bors
0d1f1bbeab Auto merge of #6463 - dwijnand:rip-stale-bot, r=alexcrichton
Remove Stale bot's configuration

We couldn't get stale bot to operate as we'd like (poke up N
older-then-X-period tickets a day) and therefore we're tearing it down.

We've chosen to keep the "stale" label, so tickets closed by the bot
may be found with that label.

Closes #6035
2018-12-19 14:45:14 +00:00
bors
2a9f16da7f Auto merge of #6464 - dwijnand:add-labels-to-issue-templates, r=Eh2406
Add labels to issue templates

Make use of https://blog.github.com/changelog/2018-12-05-issue-template-automation-improvements/
2018-12-19 13:02:52 +00:00
Dale Wijnand
d52b3f8faf
Add labels to issue templates
Make use of https://blog.github.com/changelog/2018-12-05-issue-template-automation-improvements/
2018-12-19 12:03:32 +00:00
Dale Wijnand
047f8ab3a2
Remove Stale bot's configuration
We couldn't get stale bot to operate as we'd like (poke up N
older-then-X-period tickets a day) and therefore we're tearing it down.

We've chosen to keep the "stale" label, so tickets closed by the bot
may be found with that label.
2018-12-19 11:48:33 +00:00
Zhigulin Pavel
bc9e3f6750 Use awk to parse cargo --list 2018-12-19 12:37:18 +03:00
Pavel Zhigulin
6328860737 [issue#6161] Fix cargo commands list 2018-12-19 05:59:03 +03:00
bors
451f97ea0e Auto merge of #6459 - ehuss:fix-man-checks, r=alexcrichton
Fix new man page links.

The rustc link checker found some problems:
- The raw generated HTML files were being included when they shouldn't.
  Fixed by moving them out of the mdbook directory.
- The `print.html` file concatenates all the pages together, causing duplicate
  `id`'s.  Fix by giving each page a unique set of IDs.
2018-12-18 20:40:52 +00:00
Eric Huss
4338d34006 Fix new man page links.
The rustc link checker found some problems:
- The raw generated HTML files were being included when they shouldn't.
  Fixed by moving them out of the mdbook directory.
- The `print.html` file concatenates all the pages together, causing duplicate
  `id`'s.  Fix by giving each page a unique set of IDs.
2018-12-18 12:06:58 -08:00
bors
8ffc9606aa Auto merge of #6432 - ehuss:fix-metabuild-json, r=alexcrichton
Fix metabuild compile errors with --message-format=json.

If an error occurs while compiling a metabuild target with `--message-format=json`, it would panic because it was unable to serialize `Target`. This change makes it so that it places a fake "metabuild.rs" string in the `src_path` in this situation.

I'm very unhappy with this solution, but I'm unable to think of something better. Changing `src_path` to an `Option` (or something) would break existing tools (this might break, but maybe not catastrophically?). I tried implementing something that resets the `src_path` to the correct path in the target dir after the workspace is configured, but it felt very brittle – you have to fix up after all dependencies are downloaded, and there's not a good place to ensure that happens correctly. Any alternate ideas?

This adds a `with_json_contains_unordered` to help with tests.
2018-12-18 15:49:51 +00:00
bors
c684d0259a Auto merge of #6456 - ehuss:patch-alt-reg, r=alexcrichton
Support alt-registry names in [patch] table.

Closes #5149
2018-12-18 05:14:47 +00:00
Eric Huss
7eaa1cf70a Support alt-registry names in [patch] table. 2018-12-17 20:50:42 -08:00
Eric Huss
48d56a44cd Update metabuild test to 2018. 2018-12-17 19:58:32 -08:00
Eric Huss
2a0bb65a6f Switch SerializedTarget::src_path to None instead of using fake path. 2018-12-17 19:55:16 -08:00
Eric Huss
9a7fadf6bd Fix metabuild compile errors with --message-format=json.
If an error occurs while compiling a metabuild target with
`--message-format=json`, it would panic because it was unable to serialize
`Target`. This change makes it so that it places a fake "metabuild.rs" string in
the `src_path` in this situation.

I'm very unhappy with this solution, but I'm unable to think of something
better. Changing `src_path` to an `Option` (or something) would break existing
tools. I tried implementing something that resets the `src_path` to the correct
path in the target dir after the workspace is configured, but it felt very
brittle – you have to fix up after all dependencies are downloaded, and there's
not a good way to ensure that happens correctly.

This adds a `with_json_contains_unordered` to help with tests.
2018-12-17 19:55:16 -08:00
bors
9cb9eaedef Auto merge of #6455 - wezm:patch-1, r=dwijnand
Update the rustup URL

Yesterday at the Melbourne Rust meetup I helped someone install Rust on their Mac. They were following the instructions from the cargo book and I was surprised to see `rustup` and all the tools being installed globally in `/usr/local/bin`. Eventually we worked out that the URL in the cargo book was different from the one on the Rust website and on rustup.rs. After using the other URL the install proceeded as expected, installing into the user's home directory. It appears the old link is an old version of rustup/rust-init.

This PR updates the install command to match the Rust home page.
2018-12-17 23:53:39 +00:00
Wesley Moore
41b943a302
Update the rustup URL 2018-12-18 10:41:30 +11:00
bors
bd5b21e997 Auto merge of #6405 - ehuss:new-man, r=alexcrichton
New man pages.

This is a rewrite and update of the man pages. This also adds them to the website documentation. They are now in Asciidoc format to make it easy to output multiple formats and have decent formatting. There is a Makefile with instructions on how to rebuild the man pages.

Closes #5729.
2018-12-17 18:13:06 +00:00
bors
d8ff8ed8b5 Auto merge of #6451 - dwijnand:reify-DepFingerprint, r=alexcrichton
Reify the DepFingerprint type

I'm very slightly concerned I might've incompatibly changed the serialise/deserialise code with respect to existing serialised data, so please double-check my work.
2018-12-17 17:13:53 +00:00
Dale Wijnand
14f0f89b64
Reify the DepFingerprint type 2018-12-17 16:49:14 +00:00
bors
adf047d627 Auto merge of #6449 - dwijnand:extract-Fingerprint-new, r=alexcrichton
Extract Fingerprint::new

None
2018-12-17 16:42:56 +00:00
bors
db0bb7f7cd Auto merge of #6448 - dwijnand:upgrade-the-metabuild-to-rust-2018, r=ehuss
Upgrade the metabuild to Rust 2018

Just happened across the code that @ehuss mentioned in https://github.com/rust-lang/cargo/pull/6423#issuecomment-446807216 and thought of reviving that effort.

@ehuss says there's no reason to.  Let's see if it passes CI and we should land this change or not.
2018-12-17 15:42:58 +00:00
bors
b15d11aa63 Auto merge of #6450 - dwijnand:make-edition-comparing-code-consistent, r=Eh2406
Make edition comparing code consistent

Rather than sometimes comparing equality, sometimes using ordering and
sometimes pattern matching, consistently compare by equalty to 2015.
2018-12-17 13:32:59 +00:00
Dale Wijnand
37956e8c39
Extract Fingerprint::new 2018-12-17 08:56:16 +00:00
Dale Wijnand
b765fad1ed
Make edition comparing code consistent
Rather than sometimes comparing equality, sometimes using ordering and
sometimes pattern matching, consistently compare by equalty to 2015.
2018-12-17 08:12:24 +00:00
Dale Wijnand
e881e3ba98
Upgrade the metabuild to Rust 2018 2018-12-17 07:37:09 +00:00
bors
ff7f2bcb62 Auto merge of #6447 - ehuss:doc-name-authors, r=alexcrichton
Document `name` and `authors` in [package]

I don't think we need to take a principled stand on the exact meaning of
"authors", so I left it somewhat vague. Also, it was made optional in #3682 so
the existing docs were a little wrong.

Closes #5934
2018-12-17 03:28:16 +00:00
Eric Huss
e2074dfb41 Document name and authors in [package] 2018-12-16 10:05:52 -08:00
bors
5c3b8f2d9c Auto merge of #6443 - ehuss:ci-install-mdbook, r=alexcrichton
Travis: only use mdbook 0.1.7.

The latest mdbook does not build (https://github.com/rust-lang-nursery/mdBook/issues/852). Cargo uses 0.1.7, so force install only that version.
2018-12-14 23:14:58 +00:00
Eric Huss
0615d9102f On CI only use mdbook 0.1.7. 2018-12-14 14:11:24 -08:00
bors
8c2dd6e4a3 Auto merge of #6439 - rust-lang:dependabot/cargo/git2-curl-0.9.0, r=alexcrichton
Update git2-curl requirement from 0.8.1 to 0.9.0

Updates the requirements on [git2-curl](https://github.com/alexcrichton/git2-rs) to permit the latest version.
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/alexcrichton/git2-rs/commits)
</details>
<br />

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
2018-12-14 16:56:14 +00:00
dependabot[bot]
ed66cbc700
Update git2-curl requirement from 0.8.1 to 0.9.0
Updates the requirements on [git2-curl](https://github.com/alexcrichton/git2-rs) to permit the latest version.
- [Release notes](https://github.com/alexcrichton/git2-rs/releases)
- [Commits](https://github.com/alexcrichton/git2-rs/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-14 16:30:00 +00:00