9729 Commits

Author SHA1 Message Date
Alex Berghage
9cb1ef88b6 Allow both dashes and underscores for Z flags
This makes it a little easier to match whatever
the natural formatting is for where you're setting
unstable options -- CLI or config file.
2020-07-07 23:38:26 -06:00
Alex Berghage
4aede8c784 Allow setting unstable options in .cargo/config
Obviously this only works with nightlies and all
that, but if you're e.g. testing resolver v2, want
to always have Ztiming on in your workspace, or
something like that, this makes it easier to do.
2020-07-07 23:38:26 -06:00
Alex Berghage
1cea4cbe85 Allow populating CliUnstable from a HashMap
This makes it easier to populate unstable
options from configuration files. Might also
help make unstable option tests easier to write.
2020-07-07 23:38:26 -06:00
bors
729e5676a0 Auto merge of #8454 - GabrielMajeri:config-option-enum, r=ehuss
Add support for deserializing enums in config files

Implements `deserialize_enum` functionality to allow config options which are Rust enums.

@ehuss The code currently has some `todo!`s because I'm not sure how the custom `Deserializer` is supposed to do error handling.

Fixes #8450
2020-07-07 15:51:28 +00:00
Gabriel Majeri
65fc4cec8d Implement enum config options deserialization 2020-07-06 22:12:15 +03:00
bors
548eea773f Auto merge of #8453 - sourcefrog:name-length-limit-8452, r=alexcrichton
Write GNU tar files, supporting long names.

Fixes #8452

If I understand the previous bugs correctly, long trees packaged using Cargo with this patch will be misinterpreted by Cargo from before Jan 2016. (Without this patch, they can't be written at all.)

To me that seems like long enough ago that it's safe to land this now.

- [x] Add a test.
2020-07-06 15:27:16 +00:00
bors
c95c0b1c53 Auto merge of #8449 - jyn514:rustdoc, r=ehuss
Don't overwrite existing `rustdoc` args with --document-private-items

Instead, add that flag in addition to any existing flags.

Closes https://github.com/rust-lang/cargo/issues/8445
2020-07-06 14:50:12 +00:00
bors
299514d092 Auto merge of #8455 - ehuss:rustup-toolchain, r=Eh2406
Add some help about rustup's +toolchain syntax.

This tries to bring more attention to the `+toolchain` syntax from rustup.

Closes #8058
2020-07-06 14:04:54 +00:00
Eric Huss
337fd9f015 Add some help about rustup's +toolchain syntax. 2020-07-06 07:02:12 -07:00
bors
f236c35e56 Auto merge of #8451 - ehuss:metadata-man, r=Eh2406
Update metadata man page.

The man pages needed to be rebuilt after #8323.
2020-07-05 14:48:57 +00:00
Gabriel Majeri
4c7be8d4fb Add a test reproducing the issue 2020-07-05 10:04:24 +03:00
Martin Pool
0dfd4a88fd Add test for packaging long file names 2020-07-04 17:52:02 -07:00
Martin Pool
e9dba420c3 Write GNU tar files, supporting long names.
Fixes #8452
2020-07-04 17:36:18 -07:00
Eric Huss
dec7872acf Update metadata man page. 2020-07-04 15:06:58 -07:00
Joshua Nelson
1d1b344781 Use entry API instead of a match
This makes the code easier to read and also avoids looking up the
position in the map twice. The clone of `unit` is very cheap since it is
an Rc.
2020-07-04 15:47:26 -04:00
Joshua Nelson
0a975e96d8 Use a stable rustdoc option for testing 2020-07-04 15:04:51 -04:00
Joshua Nelson
bb95188093 Don't overwrite existing rustdoc args with --document-private-items
Instead, add that flag in addition to any existing flags.
2020-07-03 22:10:59 -04:00
bors
fede83ccf9 Auto merge of #8446 - ehuss:fix-usize-32, r=alexcrichton
Fix overflow error on 32-bit.

This fails to compile on 32-bit platforms with an overflow error ("attempt to shift right by 32_i32 which would overflow").

I think it would be highly unlikely for any value to be in the billions.  Alternatively it can be rewritten to something like `assert!(val <= u32::MAX as usize);`.
2020-07-02 21:51:34 +00:00
Eric Huss
fbee47a309 Fix overflow error on 32-bit. 2020-07-02 14:48:01 -07:00
bors
cf3bfc904d Auto merge of #8378 - jstasiak:backups, r=ehuss
Exclude the target directory from backups using CACHEDIR.TAG

This patch follows the lead of #4386 (which excludes target directories
from Time Machine backups) and is motived by the same reasons listen
in #3884. CACHEDIR.TAG is an OS-independent mechanism supported by Borg,
restic, GNU Tar and other backup/archiving solutions.

See https://bford.info/cachedir/ for more information about the
specification. This has been discussed in Rust Internals earlier this
year[1] and it seems like it's an uncontroversial improvement so I went
ahead with the patch.

One thing I'm wondering is whether this should maybe cover the whole main target directory (right now it applies to `target/debug`, `target/release` etc. but not to target root).

[1] https://internals.rust-lang.org/t/pre-rfc-put-cachedir-tag-into-target/12262/11
2020-07-02 14:49:38 +00:00
bors
ea32d80b41 Auto merge of #8436 - joshtriplett:zulip, r=alexcrichton
CONTRIBUTING.md: Link to Zulip rather than Discord

Discussed and approved by all members of the Cargo team.
2020-07-02 14:13:55 +00:00
Josh Triplett
552c664c2e CONTRIBUTING.md: Link to Zulip rather than Discord
Discussed and approved by all members of the Cargo team.
2020-07-01 15:10:43 -07:00
Jakub Stasiak
5f2ba2bec8 Remove no longer needed cleanup code 2020-07-01 23:44:14 +02:00
Jakub Stasiak
092781c1fa Compress two tests into one 2020-07-01 22:48:02 +02:00
Jakub Stasiak
f34b086949 Exclude whole target/ from backups
This is following the discussion on GitHub. The doc tests are no longer
necessary because Layout::new() creates CACHEDIR.TAG directly in target
root, no doc-specific code is necessary anymore.
2020-07-01 22:47:59 +02:00
bors
40550b9ea0 Auto merge of #8433 - giraffate:update_built-in_help_for_features, r=alexcrichton
Update built-in help for features

Fixed #8381.
2020-07-01 16:03:23 +00:00
Jakub Stasiak
1b5f749739 Exclude target/doc from backups as well 2020-07-01 14:14:29 +02:00
Takayuki Nakata
a00b5ac867 Update built-in help for features
Fixed #8381.
2020-07-01 08:28:20 +09:00
bors
305eaf0dc5 Auto merge of #8432 - rust-lang:dependabot/cargo/core-foundation-0.9.0, r=alexcrichton
Update core-foundation requirement from 0.7.0 to 0.9.0

Updates the requirements on [core-foundation](https://github.com/servo/core-foundation-rs) to permit the latest version.
<details>
<summary>Commits</summary>
<ul>
<li><a href="a57ca7f976"><code>a57ca7f</code></a> Major version update for core-foundation-sys and all other dependencies.</li>
<li><a href="aa69b91def"><code>aa69b91</code></a> Add missing major version changes.</li>
<li><a href="7487580958"><code>7487580</code></a> Publish core-foundation-sys 0.7.2.</li>
<li><a href="40a787f0e6"><code>40a787f</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/core-foundation-rs/issues/397">#397</a> - servo:major-bump, r=jdm</li>
<li><a href="56d8b6c161"><code>56d8b6c</code></a> Major version change for core-foundation, core-graphics, io-surface, core-tex...</li>
<li><a href="3754007311"><code>3754007</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/core-foundation-rs/issues/395">#395</a> - bryanburgers:timezone-name, r=jdm</li>
<li><a href="a4e2983219"><code>a4e2983</code></a> Add <code>CFTimeZone::name</code></li>
<li><a href="749c0855ad"><code>749c085</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/core-foundation-rs/issues/394">#394</a> - anp:releases, r=jdm</li>
<li><a href="9c264d2904"><code>9c264d2</code></a> Bump core-foundation(-sys) to 0.7.1 for release.</li>
<li><a href="d196c0c4c8"><code>d196c0c</code></a> Publish core-graphics 0.19.2.</li>
<li>Additional commits viewable in <a href="https://github.com/servo/core-foundation-rs/compare/core-foundation-v0.7.0...core-foundation-v0.9.0">compare view</a></li>
</ul>
</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 squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor 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)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

</details>
2020-06-30 14:16:08 +00:00
dependabot-preview[bot]
c4629eb93e
Update core-foundation requirement from 0.7.0 to 0.9.0
Updates the requirements on [core-foundation](https://github.com/servo/core-foundation-rs) to permit the latest version.
- [Release notes](https://github.com/servo/core-foundation-rs/releases)
- [Commits](https://github.com/servo/core-foundation-rs/compare/core-foundation-v0.7.0...core-foundation-v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-30 05:24:50 +00:00
bors
77b40585a9 Auto merge of #8421 - alexcrichton:read-env-dep, r=ehuss
Parse `# env-dep` directives in dep-info files

This commit updates Cargo's parsing of rustc's dep-info files to account
for changes made upstream in rust-lang/rust#71858. This means that if
`env!` or `option_env!` is used in crate files Cargo will correctly
rebuild the crate if the env var changes.

Closes #8417
2020-06-30 02:40:18 +00:00
bors
f12d72e11b Auto merge of #8419 - est31:string_interning, r=ehuss
Move string interning to util

Code that handles string interning is rather an util functionality than
a core functionality.
2020-06-29 23:56:15 +00:00
Alex Crichton
0750a6f504 Handle env var escaping 2020-06-29 12:57:09 -07:00
Alex Crichton
a6bf36e0ac Bump hashed metadata version 2020-06-29 12:39:44 -07:00
Alex Crichton
643f12efcf Address review feedback 2020-06-29 11:32:37 -07:00
Alex Crichton
68200151da Get past internal test on CI 2020-06-29 08:52:05 -07:00
Alex Crichton
784ea96e8e Filter env vars to check against 2020-06-29 08:26:10 -07:00
Alex Crichton
f666b19a8f Parse # env-dep directives in dep-info files
This commit updates Cargo's parsing of rustc's dep-info files to account
for changes made upstream in rust-lang/rust#71858. This means that if
`env!` or `option_env!` is used in crate files Cargo will correctly
rebuild the crate if the env var changes.

Closes #8417
2020-06-29 08:15:15 -07:00
bors
67075be626 Auto merge of #8418 - bdonlan:cdylib-out-path, r=alexcrichton
Expose built cdylib artifacts in the Compilation structure

This change makes it much easier to find these artifacts in a
platform-independent way when writing automation around the cargo API.
2020-06-26 19:35:23 +00:00
est31
836e91ce4c Make leak function private
The leak function is never used outside of interning.rs
and I don't think it makes any sense to use it.
2020-06-26 19:55:29 +02:00
est31
7f73a6c782 Move string interning to util
Code that handles string interning is rather an util functionality than
a core functionality.
2020-06-26 19:55:29 +02:00
Bryan Donlan
d19ff18347 Expose built cdylib artifacts in the Compilation structure
This change makes it much easier to find these artifacts in a
platform-independent way when writing automation around the cargo API.
2020-06-26 17:23:34 +00:00
bors
2f4097aa6b Auto merge of #8416 - est31:remove_derive, r=alexcrichton
Remove unused serde_derive dependency from the crates.io crate
2020-06-26 16:33:12 +00:00
est31
65591e8144 Remove unused serde_derive dependency 2020-06-26 17:29:09 +02:00
bors
85e38cafbe Auto merge of #8412 - est31:remove_remove, r=alexcrichton
Remove unused remove_dir_all dependency

Originally part of #8384 but sadly the PR got rejected.
2020-06-26 14:13:00 +00:00
est31
da86eaad8f Remove unused remove_dir_all dependency
Need to research why it isn't detected by cargo-udeps.
2020-06-26 06:37:40 +02:00
bors
8fc3da5e4a Auto merge of #8409 - alexcrichton:git-instead-of, r=Eh2406
Improve git error messages a bit

This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.
2020-06-25 18:47:08 +00:00
Alex Crichton
6514c289d2 Improve git error messages a bit
This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.
2020-06-25 08:47:15 -07:00
bors
3b142db791 Auto merge of #8408 - jstasiak:improve-home-path-documentation, r=alexcrichton
Improve the description of Config.home_path

I poked around and it seems it's not the user's home directory but Cargo
home (which may or may not be in user's home).
2020-06-25 14:12:00 +00:00
Jakub Stasiak
daa053c933 Improve the description of Config.home_path
I poked around and it seems it's not the user's home directory but Cargo
home (which may or may not be in user's home).
2020-06-25 15:19:40 +02:00