9492 Commits

Author SHA1 Message Date
bors
8e8c62b1c5 Auto merge of #8135 - ehuss:allows-dashes, r=Eh2406
Rename allows_underscores to allows_dashes.

I think this better reflects what it means.
2020-04-19 16:47:38 +00:00
Eric Huss
65274ea7d5 Add a warning when using registry.token with source replacement. 2020-04-19 09:25:32 -07:00
Eric Huss
b4c374039f Do not implicitly load registry.token with --index.
The intent is to avoid leaking the crates.io token to other servers.
2020-04-19 09:20:54 -07:00
Eric Huss
2599071110 Don't allow both --index and --registry to be specified at the same time.
Otherwise --index was being silently ignored.
2020-04-19 09:20:54 -07:00
Eric Huss
9d00f9f07f Make setting registry.index a hard error.
This has been deprecated for 4 years. This helps simplify this code.
2020-04-19 09:20:54 -07:00
Eric Huss
7956f03dbc Add some doc-strings to registry functions. 2020-04-19 09:16:10 -07:00
Eric Huss
2a14979dc7 Rename allows_underscores to allows_dashes. 2020-04-19 09:15:04 -07:00
Eric Huss
323d7a8896 Put default ResolveBehavior in one place. 2020-04-19 09:04:12 -07:00
Eric Huss
787e75b797 Add resolver opt-in for new feature resolver. 2020-04-19 08:45:18 -07:00
bors
235beb01c9 Auto merge of #8130 - hbina:needless_borrow, r=ehuss
Fixed a needless borrow.

Mentioned by rust-clippy.
2020-04-19 15:43:59 +00:00
Nicholas Nethercote
cb48e3a37b Change -Cembed-bitcode=no use to -Cbitcode-in-rlib=no.
Because the latter will replace the planned use of the former in rustc.
2020-04-19 20:34:52 +10:00
Hanif Bin Ariffin
fb48de8ccc Fixed a needless borrow. 2020-04-17 20:22:49 -04:00
bors
f044cf9fb0 Auto merge of #8126 - ehuss:link-changelog, r=alexcrichton
Add link to changelog in the Cargo book.
2020-04-17 16:45:26 +00:00
bors
6d76d7cc98 Auto merge of #8094 - Freax13:fix-target, r=ehuss
Fix target for doc test cross compilation

- for target paths `Compilation::target` only contains the shortened file name, but we need to pass the full path to rustdoc
2020-04-17 16:27:48 +00:00
bors
03f11e8e8c Auto merge of #8125 - ehuss:doc-config-toml, r=alexcrichton
Add note about .cargo/config support.

I think it would be good to have some mention that Cargo also supports `.cargo/config` files.  This is still the predominant way Cargo is used, and there is a ton of documentation, projects, and examples that still use the old form.
2020-04-17 16:00:52 +00:00
Eric Huss
022915dd48 Add link to changelog in the Cargo book. 2020-04-17 08:49:36 -07:00
bors
1638705700 Auto merge of #8123 - ehuss:fix-windows-pdb-dash, r=alexcrichton
Fix pdb uplift when executable has dashes.

Windows `.pdb` files were not being uplifted for executables with dashes in their name. `rustc` calls the linker with the crate name (with underscores), which creates a pdb with underscores. Cargo renames the executable (`foo_bar.exe` to `foo-bar.exe`), and it was expecting the pdb to have the same form, but it doesn't.

Note: There shouldn't be any effect for using a debugger. Because the pdb path is embedded in the executable, the debugger was already looking in the `deps/` folder.  Uplifting is only useful if you want to copy the exe/pdb pair to some other machine.  In that case, it looks in the same directory as the `exe` for the pdb file.

Fixes #8117
2020-04-17 15:39:25 +00:00
Eric Huss
d20d395c8b Add note about .cargo/config support. 2020-04-17 08:37:03 -07:00
Tom Dohrmann
e5d9b034ec add test for doctests with custom target paths 2020-04-17 17:35:10 +02:00
bors
b04345c21b Auto merge of #8122 - kornelski:future-edition, r=Eh2406
Hint upgrading for future edition keys

A more specific error message for potentially-future edition values.

This error is likely to be seen by people who are not regular Rust users and are just trying to build someone's crate. It may be helpful to stronger hint at upgrading Cargo, rather than display a more general message about an unknown value.

I know Cargo plans to fix it better with explicit MSRV eventually, but that's not ready yet, so it's better to land something sooner.
2020-04-17 15:20:04 +00:00
bors
85fd2865fc Auto merge of #8124 - ehuss:fs-cleanup, r=Eh2406
Use some fs shorthand functions.

This is just some cleanup, using some fs convenience functions that I think make the code more readable.

Note: While going through these, I found the `out_dir_is_preserved` test was broken and not doing what it was supposed to.
2020-04-17 15:02:35 +00:00
Eric Huss
4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Kornel
f57c4c9ba3 Hint upgrading for future edition keys 2020-04-17 15:23:59 +01:00
Eric Huss
4367ec4d11 Use Path methods instead of fs::metadata. 2020-04-16 22:00:22 -07:00
Eric Huss
3acd15eb47 Fix pdb uplift when executable has dashes. 2020-04-16 18:02:47 -07:00
bors
f9047dc2d6 Auto merge of #8121 - huangjiahua:update-documentation, r=alexcrichton
Update documentation to mention "config.toml" instead of "config"

I searched for the reference of `config` and `credentials` in `src/doc` and changed to `config.toml` and `credentials.toml` accroding to the context.

#7323
2020-04-16 19:15:44 +00:00
huangjiahua
25409e56bb Update documentation to mention "config.toml" and "credentials.toml" instead of "config" and "credentials"
Cargo now support loading 'config.toml' and 'credentials.toml' in place of the same files without extension, which used to be the default. Files with extensions are easier for people to edit due to syntax highlighting, etc.
2020-04-16 23:18:34 +08:00
bors
ebda5065ee Auto merge of #8119 - ehuss:new-err-formatting, r=alexcrichton
Don't use debug display for error object.

When `cargo new` displays a workspace validation warning, it was using the debug display which we probably shouldn't rely on.

This also consolidates a similar usage when `cargo doc --open` fails.

Closes #8118
2020-04-16 14:28:43 +00:00
Tom Dohrmann
4785b64642 fix test 2020-04-16 13:08:00 +02:00
Tom Dohrmann
6fc37f5611 make test use nightly 2020-04-16 12:07:15 +02:00
Tom Dohrmann
60a61d471a add tests for doctests with cross compilation 2020-04-16 11:48:12 +02:00
Tom Dohrmann
ecffdcc2b0 add clarifying comment 2020-04-16 11:35:38 +02:00
Eric Huss
b64d0f3645 Don't use debug display for error object. 2020-04-15 17:29:19 -07:00
bors
2cb9243c02 Auto merge of #8115 - ehuss:tree-backwards-compat, r=alexcrichton
Add backwards-compatibility for old cargo-tree flags.

Add backwards compatibility for the flags that were removed.

`--invert` is still not backwards compatible because it was fundamentally changed to take an argument.

Requested via https://github.com/rust-lang/cargo/pull/8062#issuecomment-613829752.
2020-04-15 20:52:38 +00:00
Eric Huss
b0fa64b5e5 Add backwards-compatibility for old cargo-tree flags. 2020-04-15 13:48:58 -07:00
bors
f22d17c938 Auto merge of #8114 - alexcrichton:change-condition, r=Eh2406
Try to avoid panics on buggy (?) clocks

Try to avoid panics with `Instant` by only performing infallible
operations. This tweaks a comparison located in #8042 to use `Instant`
comparisons rather than `Duration` comparisons which should hopefully
eliminate a source of panics in the face of buggy (maybe?) clocks.

I'm not sure whether this actually fixes the original issue, but seeing
that we have a pretty low chance of the issue recurring, it's probably
fine to go ahead and say...

Closes #8042
2020-04-15 15:39:33 +00:00
Alex Crichton
be020a55d6 Try to avoid panics on buggy (?) clocks
Try to avoid panics with `Instant` by only performing infallible
operations. This tweaks a comparison located in #8042 to use `Instant`
comparisons rather than `Duration` comparisons which should hopefully
eliminate a source of panics in the face of buggy (maybe?) clocks.

I'm not sure whether this actually fixes the original issue, but seeing
that we have a pretty low chance of the issue recurring, it's probably
fine to go ahead and say...

Closes #8042
2020-04-15 07:54:15 -07:00
Tom Dohrmann
86d857ec58 Revert "remove host & target attributes"
This reverts commit 5a051ebe08d51c0188a4c3bbb41789c0d4cb0f82.
2020-04-15 12:51:37 +02:00
Tom Dohrmann
b365b0fa06 Revert "fix running doctest for host target"
This reverts commit 060c5e13e123683bce605c420bff95b2205fd131.
2020-04-15 12:51:22 +02:00
Tom Dohrmann
060c5e13e1 fix running doctest for host target 2020-04-14 16:41:18 +02:00
Daniel Wagner-Hall
4432ac3d10 Add a little docstring 2020-04-14 00:25:03 +01:00
Daniel Wagner-Hall
7b8d9b3189 Merge branch 'master' into trywithout 2020-04-14 00:22:23 +01:00
bors
74e3a7d5b7 Auto merge of #8093 - pfmooney:illumos-deps, r=alexcrichton
Update dependencies to support illumos target

Several dependencies of cargo require updates in order to build with illumos as the `target_os` platform (rust-lang/rust#55553).  Most are patch revisions to include `#[cfg()]` updates.  In the case of `fs2`, the maintainer does not appear to be minding activity on the project, so it was forked into `fs3`, maintaining the same interfaces and logic (but featuring the widened platform support).
2020-04-13 20:41:52 +00:00
Patrick Mooney
c04a87c192 Update dependencies to support illumos target
This inlines the flock() logic from danburkert/fs2, which in its current
state does not compile on illumos (or certain other cfg(unix) targets).
2020-04-13 14:18:00 -05:00
bors
15d8044f05 Auto merge of #8102 - alexcrichton:more-spurious, r=Eh2406
Whitelist another known spurious curl error

Seen recently in comments on #6788
2020-04-13 16:45:48 +00:00
Alex Crichton
f54ac5a26c Whitelist another known spurious curl error
Seen recently in comments on #6788
2020-04-13 09:42:26 -07:00
bors
9def590c3c Auto merge of #8098 - ehuss:fix-exported_priv_warning, r=alexcrichton
Fix nightly test matching rustc "warning" output.

https://github.com/rust-lang/rust/pull/69926 changed the warning output from rustc.  https://github.com/rust-lang/cargo/pull/8080 attempted to compensate for it, but missed one of the cases.  I don't think this test needs to be quite so exhaustive about checking the output.
2020-04-13 14:12:49 +00:00
Eric Huss
75e7b41823 Fix nightly test matching rustc "warning" output. 2020-04-12 21:09:39 -07:00
Daniel Wagner-Hall
0a381961f0 Merge branch 'master' into trywithout 2020-04-13 03:07:57 +01:00
Daniel Wagner-Hall
bf6a6278d7 select_pkg takes Dependency _or_ list_all not both
It only ever actually uses one, so let's reflect that in the types.
2020-04-13 02:50:46 +01:00