]> git.proxmox.com Git - cargo.git/log
cargo.git
6 years agoRename PackageSet::get to `get_one`
Alex Crichton [Mon, 10 Sep 2018 20:44:11 +0000 (13:44 -0700)]
Rename PackageSet::get to `get_one`

This commit removes the old `PackageSet::get` method (used for downloading
crates) to `PackageSet::get_one`. The new method explicitly indicates that only
one package is being fetched. Additionally this commit also adds support for an
API that allows supporting downloading multiple packages in parallel. Existing
callers are all updated to use the parallel API where appropriate except for
`BuildContext`, which will be updated in the next commit.

Also note that no parallel downloads are done yet, they're still synchronously
performed one at a time. A later commit will add support for truly downloading
in parallel.

6 years agoMove downloading crates higher up in Cargo
Alex Crichton [Fri, 7 Sep 2018 22:13:57 +0000 (15:13 -0700)]
Move downloading crates higher up in Cargo

This commit is intended to lay the groundwork for downloading crates in parallel
from crates.io. It starts out by lifting up the download operation from deep
within the `Source` trait to the `PackageSet`. This should allow us to maintain
a queue of downloads specifically in a `PackageSet` and arbitrate access through
that one type, making it easier for us to implement parallel downloads.

The `Source` trait's `download` method may now fail saying "go download this
data", and then the data is fed back into the trait object once it's complete to
actually get the `Package` out.

6 years agoAuto merge of #6048 - ehuss:no-master-ci, r=alexcrichton
bors [Tue, 18 Sep 2018 16:19:38 +0000 (16:19 +0000)]
Auto merge of #6048 - ehuss:no-master-ci, r=alexcrichton

Disable master in CI.

There's no need to build and test the exact same commit twice between
bors's auto branch and master. Hopefully this will help reduce the
bors timeouts due to waiting on appveyor.

6 years agoDisable master in CI.
Eric Huss [Tue, 18 Sep 2018 13:09:27 +0000 (06:09 -0700)]
Disable master in CI.

There's no need to build and test the exact same commit twice between
bors's auto branch and master. Hopefully this will help reduce the
bors timeouts due to waiting on appveyor.

6 years agoAuto merge of #6047 - alexcrichton:bump, r=Mark-Simulacrum
bors [Tue, 18 Sep 2018 06:16:27 +0000 (06:16 +0000)]
Auto merge of #6047 - alexcrichton:bump, r=Mark-Simulacrum

Bump cargo to 0.32.0

It's that time of every-6-weeks!

6 years agoAuto merge of #6046 - soenkehahn:sh/semver-doc-tweak, r=alexcrichton
bors [Tue, 18 Sep 2018 05:28:32 +0000 (05:28 +0000)]
Auto merge of #6046 - soenkehahn:sh/semver-doc-tweak, r=alexcrichton

use more common semver terminology for clarity in docs

`tiny` made me wonder whether that means `patch-level`, `minor` or both. I think `patch-level` is more common semver terminology.

6 years agoAuto merge of #6033 - dwijnand:run-cross-compile-disable-check-asap, r=alexcrichton
bors [Tue, 18 Sep 2018 04:51:12 +0000 (04:51 +0000)]
Auto merge of #6033 - dwijnand:run-cross-compile-disable-check-asap, r=alexcrichton

Run the cross-compile disable check ASAP

Fixes #5141

6 years agoBump cargo to 0.32.0
Alex Crichton [Tue, 18 Sep 2018 01:42:51 +0000 (18:42 -0700)]
Bump cargo to 0.32.0

It's that time of every-6-weeks!

6 years agoAuto merge of #5993 - alexcrichton:publish-renames, r=ehuss
bors [Tue, 18 Sep 2018 01:00:53 +0000 (01:00 +0000)]
Auto merge of #5993 - alexcrichton:publish-renames, r=ehuss

Fix publishing renamed dependencies to crates.io

This commit fixes publishing crates which contain locally renamed dependencies
to crates.io. Previously this lack of information meant that although we could
resolve the crate graph correctly it wouldn't work well with respect to optional
features and optional dependencies. The fix here is to persist this information
into the registry about the crate being renamed in `Cargo.toml`, allowing Cargo
to correctly deduce feature names as it does when it has `Cargo.toml` locally.

A dual side of this commit is to publish this information to crates.io. We'll
want to merge the associated PR (link to come soon) on crates.io first and make
sure that's deployed as well before we stabilize the crate renaming feature.

The index format is updated as well as part of this change. The `name` key for
dependencies is now unconditionally what was written in `Cargo.toml` as the
left-hand-side of the dependency specification. In other words this is the raw
crate name, but only for the local crate. A new key, `package`, is added to
dependencies (and it can be `None`). This key indicates the crates.io package is
being linked against, an represents the `package` key in `Cargo.toml`.

It's important to consider the interaction with older Cargo implementations
which don't support the `package` key in the index. In these situations older
Cargo binaries will likely fail to resolve entirely as the renamed name is
unlikely to exist on crates.io. For example the `futures` crate now has an
optional dependency with the name `futures01` which depends on an older version
of `futures` on crates.io. The string `futures01` will be listed in the index
under the `"name"` key, but no `futures01` crate exists on crates.io so older
Cargo will generate an error. If the crate does exist on crates.io, then even
weirder error messages will likely result.

Closes #5962

6 years agouse more common semver terminology for clarity in docs
Sönke Hahn [Tue, 18 Sep 2018 00:40:18 +0000 (20:40 -0400)]
use more common semver terminology for clarity in docs

6 years agoAuto merge of #6039 - ehuss:fix-all-targets, r=alexcrichton
bors [Tue, 18 Sep 2018 00:14:09 +0000 (00:14 +0000)]
Auto merge of #6039 - ehuss:fix-all-targets, r=alexcrichton

--all-targets fixes

- Fix: `cargo test --all-targets` was running lib tests three times.
- `--all-targets` help strings were wrong or misleading.
- Minor cleanup to add `Proposal` type to maybe make the code more readable.

Closes #5178.

6 years agoAuto merge of #5988 - Eh2406:explore_the_bug, r=alexcrichton
bors [Mon, 17 Sep 2018 22:01:12 +0000 (22:01 +0000)]
Auto merge of #5988 - Eh2406:explore_the_bug, r=alexcrichton

BUG fuzzing found a bug in the resolver, we need a complete set of conflicts to do backjumping

As mentioned in https://github.com/rust-lang/cargo/pull/5921#issuecomment-418890269, the new proptest found a live bug! This PR so far tracs my attempt to minimize the problematic input.

The problem turned out to be that we where backjumping on incomplete set of conflicts.

6 years agobump env_logger to a more minimal-versions compatible one
Eh2406 [Mon, 17 Sep 2018 21:58:38 +0000 (17:58 -0400)]
bump env_logger to a more minimal-versions compatible one

6 years agopull the has bad dep before `prop_flat_map`
Eh2406 [Mon, 17 Sep 2018 17:51:40 +0000 (13:51 -0400)]
pull the has bad dep before `prop_flat_map`

6 years ago--all-targets fixes
Eric Huss [Mon, 17 Sep 2018 02:41:57 +0000 (19:41 -0700)]
--all-targets fixes

- Fix: `cargo test --all-targets` was running lib tests three times.
- `--all-targets` help strings were wrong or misleading.
- Minor cleanup to add `Proposal` type to maybe make the code more readable.

6 years agogive intermediate steps names
Eh2406 [Mon, 17 Sep 2018 02:41:15 +0000 (22:41 -0400)]
give intermediate steps names

6 years agoAuto merge of #6037 - dwijnand:stop-test--doc-from-accepting-other-target-options...
bors [Mon, 17 Sep 2018 02:16:46 +0000 (02:16 +0000)]
Auto merge of #6037 - dwijnand:stop-test--doc-from-accepting-other-target-options, r=alexcrichton

Stop test --doc from silently ignoring other target selecting options

Fixes #5054

6 years agoAuto merge of #6038 - ehuss:bashcomp, r=alexcrichton
bors [Mon, 17 Sep 2018 01:38:13 +0000 (01:38 +0000)]
Auto merge of #6038 - ehuss:bashcomp, r=alexcrichton

Minor updates to bash completion

- Fix bash completion on mac.
- Support arbitrary toolchain names.

6 years agoBash completion: support arbitrary toolchain names.
Eric Huss [Sun, 16 Sep 2018 23:59:42 +0000 (16:59 -0700)]
Bash completion: support arbitrary toolchain names.

6 years agoFix bash completion on mac.
Eric Huss [Sun, 16 Sep 2018 23:50:19 +0000 (16:50 -0700)]
Fix bash completion on mac.

For some bizarro reason, mac's bash doesn't like negative indexes,
even though its version of bash should support it.

6 years agoStop test --doc from silently ignoring other target selecting options
Dale Wijnand [Sun, 16 Sep 2018 20:33:32 +0000 (21:33 +0100)]
Stop test --doc from silently ignoring other target selecting options

6 years agoAuto merge of #6036 - dwijnand:link-stale-bot-to-tracking-issue, r=alexcrichton
bors [Sun, 16 Sep 2018 20:15:56 +0000 (20:15 +0000)]
Auto merge of #6036 - dwijnand:link-stale-bot-to-tracking-issue, r=alexcrichton

Link stale bot to its tracking issue

Refs #6035

6 years agotypo
Dale Wijnand [Sun, 16 Sep 2018 20:04:15 +0000 (21:04 +0100)]
typo

6 years agoLink stale bot to its tracking issue
Dale Wijnand [Sun, 16 Sep 2018 19:44:44 +0000 (20:44 +0100)]
Link stale bot to its tracking issue

6 years agoRun the cross-compile disable check ASAP
Dale Wijnand [Sun, 16 Sep 2018 09:07:24 +0000 (10:07 +0100)]
Run the cross-compile disable check ASAP

6 years agoAuto merge of #6030 - dwijnand:tweak-stale-bot-message, r=alexcrichton
bors [Sat, 15 Sep 2018 18:32:35 +0000 (18:32 +0000)]
Auto merge of #6030 - dwijnand:tweak-stale-bot-message, r=alexcrichton

Add newline spacing to stale bot's message

So our first incantation produced:

https://github.com/rust-lang/cargo/issues/4866#issuecomment-421597598

Perhaps there's a better indicator to use, but for now let's just fix
this with more newlines.

r? @alexcrichton

6 years agoTwo newlines will do
Dale Wijnand [Sat, 15 Sep 2018 17:44:20 +0000 (18:44 +0100)]
Two newlines will do

6 years agoUse indentation, it's Super Effective!
Dale Wijnand [Sat, 15 Sep 2018 17:43:18 +0000 (18:43 +0100)]
Use indentation, it's Super Effective!

6 years agoI think "6 months" reads better than "180 days"
Dale Wijnand [Sat, 15 Sep 2018 17:28:34 +0000 (18:28 +0100)]
I think "6 months" reads better than "180 days"

6 years agoGrammar
Dale Wijnand [Sat, 15 Sep 2018 17:26:53 +0000 (18:26 +0100)]
Grammar

6 years agoAdd newline spacing to stale bot's message
Dale Wijnand [Sat, 15 Sep 2018 17:20:40 +0000 (18:20 +0100)]
Add newline spacing to stale bot's message

So our first incantation produced:

https://github.com/rust-lang/cargo/issues/4866#issuecomment-421597598

Perhaps there's a better indicator to use, but for now let's just fix
this with more newlines.

r? @alexcrichton

6 years agoAuto merge of #6004 - zachlute:fix-ctrlc-handling2, r=alexcrichton
bors [Sat, 15 Sep 2018 16:18:14 +0000 (16:18 +0000)]
Auto merge of #6004 - zachlute:fix-ctrlc-handling2, r=alexcrichton

Add empty ctrlc handler on Windows.

Fixes #6000.

This is a 'better' version of PR #6002 that accomplishes the same thing using only `winapi` calls without the dependency on the `ctrlc` crate or spawning an additional thread.

----

When exec_replacing the cargo process, we want the new process to get any signals. This already works fine on Unix.

On Windows, pressing ctrlc kills the cargo process and doesn't pass the signal on to the child process. By adding an empty handler, we allow the child process to handle the signal instead.

6 years agoAuto merge of #6027 - GuillaumeGomez:remove-error-code-check, r=alexcrichton
bors [Fri, 14 Sep 2018 23:32:07 +0000 (23:32 +0000)]
Auto merge of #6027 - GuillaumeGomez:remove-error-code-check, r=alexcrichton

Remove error code check in doc test

Needed by https://github.com/rust-lang/rust/pull/53933

cc @alexcrichton

6 years agoAuto merge of #6020 - dwijnand:stale-bot, r=alexcrichton
bors [Fri, 14 Sep 2018 22:15:50 +0000 (22:15 +0000)]
Auto merge of #6020 - dwijnand:stale-bot, r=alexcrichton

Setup Stale Probot

r?  @alexcrichton
/cc @Eh2406

6 years agocargo fmt
Eh2406 [Fri, 14 Sep 2018 21:39:05 +0000 (17:39 -0400)]
cargo fmt

6 years agoonly skip in the `backtrack_stack` if the `conflicting_activations` is complete
Eh2406 [Fri, 14 Sep 2018 21:23:46 +0000 (17:23 -0400)]
only skip in the `backtrack_stack` if the `conflicting_activations` is complete

6 years agorevert b1d6a7e changes
Guillaume Gomez [Fri, 14 Sep 2018 21:17:05 +0000 (23:17 +0200)]
revert b1d6a7e changes

6 years agoAdd possibility to remove process exit code
Guillaume Gomez [Fri, 14 Sep 2018 21:06:17 +0000 (23:06 +0200)]
Add possibility to remove process exit code

6 years agoRemove error code check in doc test
Guillaume Gomez [Fri, 14 Sep 2018 21:05:35 +0000 (23:05 +0200)]
Remove error code check in doc test

6 years agosmall clean up
Eh2406 [Fri, 14 Sep 2018 20:02:38 +0000 (16:02 -0400)]
small clean up

6 years agorename deps
Eh2406 [Fri, 14 Sep 2018 19:48:35 +0000 (15:48 -0400)]
rename deps

6 years agoremove debs leading to remove now unused crates
Eh2406 [Fri, 14 Sep 2018 19:35:36 +0000 (15:35 -0400)]
remove debs leading to remove now unused crates

6 years agoa new one to minimized
Eh2406 [Fri, 14 Sep 2018 19:25:51 +0000 (15:25 -0400)]
a new one to minimized

6 years agoOften it's not the issue author that needs to comment
Dale Wijnand [Fri, 14 Sep 2018 17:54:38 +0000 (18:54 +0100)]
Often it's not the issue author that needs to comment

6 years agoclean up commas
Eh2406 [Fri, 14 Sep 2018 17:08:53 +0000 (13:08 -0400)]
clean up commas

6 years agorename deps
Eh2406 [Fri, 14 Sep 2018 15:49:18 +0000 (11:49 -0400)]
rename deps

6 years agoremove debs leading to remove now unused crates
Eh2406 [Fri, 14 Sep 2018 14:58:51 +0000 (10:58 -0400)]
remove debs leading to remove now unused crates

6 years agoSpelling
Dale Wijnand [Fri, 14 Sep 2018 14:57:35 +0000 (15:57 +0100)]
Spelling

6 years agoTry using an active voice in the stale bot messages
Dale Wijnand [Fri, 14 Sep 2018 06:30:30 +0000 (07:30 +0100)]
Try using an active voice in the stale bot messages

6 years agoremove debs leading to remove now unused crates
Eh2406 [Thu, 13 Sep 2018 22:49:19 +0000 (18:49 -0400)]
remove debs leading to remove now unused crates

6 years agoAllow PRs to be marked stale & be closed
Dale Wijnand [Thu, 13 Sep 2018 19:44:37 +0000 (20:44 +0100)]
Allow PRs to be marked stale & be closed

6 years agoKeep C-feature-request from going stale
Dale Wijnand [Thu, 13 Sep 2018 19:43:35 +0000 (20:43 +0100)]
Keep C-feature-request from going stale

6 years agoAuto merge of #6021 - zachlute:validate-package-name, r=alexcrichton
bors [Thu, 13 Sep 2018 19:14:15 +0000 (19:14 +0000)]
Auto merge of #6021 - zachlute:validate-package-name, r=alexcrichton

Validate that the package name contains no invalid characters.

Fixes #2388.

Invalid characters are currently defined as alphanumeric, _, and -. This matches the rustc restrictions but is not as restrictive as `cargo new` or crates.io.

Mostly this is just so there will be better error messages in the case where characters in the package name aren't valid path characters.

6 years agoAuto merge of #6022 - ehuss:fix-doc-priv, r=alexcrichton
bors [Thu, 13 Sep 2018 15:45:01 +0000 (15:45 +0000)]
Auto merge of #6022 - ehuss:fix-doc-priv, r=alexcrichton

Fix --document-private-items for multiple targets.

Closes #5958.

6 years agoFix --document-private-items for multiple targets.
Eric Huss [Thu, 13 Sep 2018 13:19:35 +0000 (06:19 -0700)]
Fix --document-private-items for multiple targets.

Closes #5958.

6 years agoValidate that the package name contains no invalid characters.
Zach Lute [Thu, 13 Sep 2018 02:39:16 +0000 (19:39 -0700)]
Validate that the package name contains no invalid characters.

Invalid characters are currently defined as alphanumeric, _, and -. This matches the rustc restrictions but is not as restrictive as `cargo new` or crates.io.

Mostly this is just so there will be better error messages in the case where characters in the package name aren't valid path characters.

6 years agoRestrict stale bot to just issues
Dale Wijnand [Thu, 13 Sep 2018 01:50:31 +0000 (02:50 +0100)]
Restrict stale bot to just issues

6 years agoConfigure a close comment message for stale bot
Dale Wijnand [Thu, 13 Sep 2018 01:49:12 +0000 (02:49 +0100)]
Configure a close comment message for stale bot

6 years agoI-nominated/P-high issues can go stale
Dale Wijnand [Thu, 13 Sep 2018 01:47:02 +0000 (02:47 +0100)]
I-nominated/P-high issues can go stale

If they haven't had any activity (or been solved) in long enough,
they're probably just as stale as every other issue.

6 years agoE-easy/E-help-wanted issues can go stale
Dale Wijnand [Thu, 13 Sep 2018 01:45:32 +0000 (02:45 +0100)]
E-easy/E-help-wanted issues can go stale

Makes sense to let these be closed as it's likely they aren't easy or
don't have good enough mentoring instructions.

6 years agoTweak stale bots initial comment wording
Dale Wijnand [Thu, 13 Sep 2018 01:43:14 +0000 (02:43 +0100)]
Tweak stale bots initial comment wording

6 years agoRaise threshold to 180 days until issues are stale (6 months)
Dale Wijnand [Thu, 13 Sep 2018 01:39:17 +0000 (02:39 +0100)]
Raise threshold to 180 days until issues are stale (6 months)

6 years agoLimit to 1 stale bot action per hour (24 per day)
Dale Wijnand [Thu, 13 Sep 2018 01:38:04 +0000 (02:38 +0100)]
Limit to 1 stale bot action per hour (24 per day)

6 years agoSetup Stale Probot
Dale Wijnand [Thu, 13 Sep 2018 00:37:58 +0000 (01:37 +0100)]
Setup Stale Probot

6 years agoremove unused crates
Eh2406 [Wed, 12 Sep 2018 21:27:56 +0000 (17:27 -0400)]
remove unused crates

6 years agoa new one to minimized
Eh2406 [Wed, 12 Sep 2018 20:33:38 +0000 (16:33 -0400)]
a new one to minimized

6 years agothis oddly worked
Eh2406 [Wed, 12 Sep 2018 18:02:15 +0000 (14:02 -0400)]
this oddly worked

6 years agoAuto merge of #6010 - ehuss:winsize, r=alexcrichton
bors [Wed, 12 Sep 2018 17:50:19 +0000 (17:50 +0000)]
Auto merge of #6010 - ehuss:winsize, r=alexcrichton

Get window size on more Windows terminals.

This is an alternate approach to determining the window size that works on more Windows terminals.

Terminals with accurate width detection: Normal Windows console, cmder, ConEmu, VS Code, Hyper, etc.

mintty-based terminals will always be 60 characters wide. Cygwin in a command console is ok, but
running under x-windows will also always be 60.

Tested on Windows 8 and Windows 10.

Closes #5124.

6 years agoGet window size on more Windows terminals.
Eric Huss [Tue, 11 Sep 2018 19:40:02 +0000 (12:40 -0700)]
Get window size on more Windows terminals.

This is an alternate approach to determining the window size that works on more Windows terminals.

Terminals with accurate width detection: Normal Windows console, cmder, ConEmu, VS Code, Hyper, etc.

mintty-based terminals will always be 60 characters wide. Cygwin in a command console is ok, but
running under x-windows will also always be 60.

Tested on Windows 8 and Windows 10.

Closes #5124.

6 years agoAuto merge of #5995 - kennytm:stabilize-compile-progress, r=alexcrichton
bors [Wed, 12 Sep 2018 06:56:12 +0000 (06:56 +0000)]
Auto merge of #5995 - kennytm:stabilize-compile-progress, r=alexcrichton

Stabilize -Zcompile-progress.

Closes #2536.

6 years agoDo not add --color to rustdoc if it doesn't support it.
kennytm [Wed, 12 Sep 2018 03:32:27 +0000 (11:32 +0800)]
Do not add --color to rustdoc if it doesn't support it.

We detect this by executing `rustdoc --color never -V` and see if the
result is successful. To avoid repeatedly creating a new process, we
cache the result into `.rustc_info.json`.

6 years agoUpdate the testsuite to include the explicit '--color' flags.
kennytm [Sun, 9 Sep 2018 17:39:55 +0000 (01:39 +0800)]
Update the testsuite to include the explicit '--color' flags.

6 years agoStabilize -Zcompile-progress.
kennytm [Sat, 8 Sep 2018 12:18:04 +0000 (20:18 +0800)]
Stabilize -Zcompile-progress.

Closes #2536.

6 years agoAuto merge of #6006 - EPashkin:master, r=alexcrichton
bors [Tue, 11 Sep 2018 17:10:35 +0000 (17:10 +0000)]
Auto merge of #6006 - EPashkin:master, r=alexcrichton

Fix example for usage still not published uuid 2.0.0

IMHO There some inconsistency in https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#prepublishing-a-breaking-change
We have unpublished version 2.0.0 for uuid crate in branch with same name.
Now we can test it in `my-library` without waiting for publish as written in docs.
But if `my-library` changes committed to its master, for `my-binary` patch need be same as in library,
as uuid 2.0.0 still not published.

6 years agoFix example for usage still not published uuid 2.0.0
Evgenii Pashkin [Tue, 11 Sep 2018 07:20:48 +0000 (10:20 +0300)]
Fix example for usage still not published uuid 2.0.0

6 years agoAuto merge of #5994 - zachlute:convert-file-uris, r=alexcrichton
bors [Tue, 11 Sep 2018 05:11:40 +0000 (05:11 +0000)]
Auto merge of #5994 - zachlute:convert-file-uris, r=alexcrichton

Print file paths instead of file:// URLs.

Fixes #4661.

This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.

6 years agoAdd empty ctrlc handler on Windows.
Zach Lute [Mon, 10 Sep 2018 23:50:11 +0000 (16:50 -0700)]
Add empty ctrlc handler on Windows.

When exec_replacing the cargo process, we want the new process to get any signals. This already works fine on Unix.

On Windows, pressing ctrlc kills the cargo process and doesn't pass the signal on to the child process. By adding an empty handler, we allow the child process to handle the signal instead.

6 years agoResolve conflicts from upstream.
Zach Lute [Sun, 9 Sep 2018 23:59:48 +0000 (16:59 -0700)]
Resolve conflicts from upstream.

6 years agoFixed CWD templates in tool_path tests.
Zach Lute [Sun, 9 Sep 2018 23:51:23 +0000 (16:51 -0700)]
Fixed CWD templates in tool_path tests.

6 years agoResolve merge conflicts with test string changes.
Zach Lute [Sun, 9 Sep 2018 23:48:57 +0000 (16:48 -0700)]
Resolve merge conflicts with test string changes.

6 years agoAuto merge of #5997 - dwijnand:no-libgit2-user-agent-testing, r=alexcrichton
bors [Sun, 9 Sep 2018 22:53:25 +0000 (22:53 +0000)]
Auto merge of #5997 - dwijnand:no-libgit2-user-agent-testing, r=alexcrichton

Drop the libgit2 User-Agent testing from http_auth_offered

Fixes #5306

6 years agoAuto merge of #5990 - dwijnand:no-crates.io-index-url, r=alexcrichton
bors [Sun, 9 Sep 2018 21:06:13 +0000 (21:06 +0000)]
Auto merge of #5990 - dwijnand:no-crates.io-index-url, r=alexcrichton

Don't print crates.io-index URL when Updating

Following the lead from PackageId's Display, only display the registry's
URL if it's not the default registry (aka crates.io).

Before:

    $ cargo install lazy_static
        Updating registry `https://github.com/rust-lang/crates.io-index`

After:

    $ dcargo install lazy_static
        Updating crates.io index

Fixes #4208

6 years agoAuto merge of #5959 - japaric:cfg-runner, r=alexcrichton
bors [Sun, 9 Sep 2018 20:01:06 +0000 (20:01 +0000)]
Auto merge of #5959 - japaric:cfg-runner, r=alexcrichton

add support for `target.'cfg(..)'.runner`

`cfg` can be used to reduce the number of `runner`s one needs to type in
`.cargo/config`. So instead of writing this:

``` toml
[target.thumbv6m-none-eabi]
runner = "arm-none-eabi-gdb"

[target.thumbv7m-none-eabi]
runner = "arm-none-eabi-gdb"

[target.thumbv7em-none-eabi]
runner = "arm-none-eabi-gdb"

[target.thumbv7em-none-eabihf]
runner = "arm-none-eabi-gdb"
```

one can write:

``` toml
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "arm-none-eabi-gdb"
```

Handling of edge cases:

- When `target.$triple.runner` matches it will be chosen regardless of the
  existence of others `target.'cfg(..)'.runner`s.

- If more than one `target.'cfg(..)'.runner` matches the target the command will
  fail.

closes #5946

---

Does this sound like a reasonable feature / implementation?

6 years agoDrop the libgit2 User-Agent testing from http_auth_offered
Dale Wijnand [Sun, 9 Sep 2018 08:17:07 +0000 (09:17 +0100)]
Drop the libgit2 User-Agent testing from http_auth_offered

6 years agodeduplicate logic shared with `build_context::env_args`
Jorge Aparicio [Sat, 8 Sep 2018 12:50:35 +0000 (14:50 +0200)]
deduplicate logic shared with `build_context::env_args`

6 years agoadd support for `target.'cfg(..)'.runner`
Jorge Aparicio [Sat, 1 Sep 2018 16:01:47 +0000 (18:01 +0200)]
add support for `target.'cfg(..)'.runner`

`cfg` can be used to reduce the number of `runner`s one needs to type in
`.cargo/config`. So instead of writing this:

``` toml
[target.thumbv6m-none-eabi]
runner = "arm-none-eabi-gdb"

[target.thumbv7m-none-eabi]
runner = "arm-none-eabi-gdb"

[target.thumbv7em-none-eabi]
runner = "arm-none-eabi-gdb"

[target.thumbv7em-none-eabihf]
runner = "arm-none-eabi-gdb"
```

one can write:

``` toml
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "arm-none-eabi-gdb"
```

Handling of edge cases:

- When `target.$triple.runner` matches it will be chosen regardless of the
  existence of others `target.'cfg(..)'.runner`s.

- If more than one `target.'cfg(..)'.runner` matches the target the command will
  fail.

closes #5946

6 years agoUpdate tests to new Updating msg format
Dale Wijnand [Sat, 8 Sep 2018 09:23:57 +0000 (10:23 +0100)]
Update tests to new Updating msg format

6 years agoSpecify crates.io is the default registry & print index
Dale Wijnand [Sat, 8 Sep 2018 08:25:41 +0000 (09:25 +0100)]
Specify crates.io is the default registry & print index

6 years agoPrint file paths instead of file:// URLs.
Zach Lute [Sat, 8 Sep 2018 02:42:26 +0000 (19:42 -0700)]
Print file paths instead of file:// URLs.

This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.

6 years agoAuto merge of #5991 - alexcrichton:bump, r=alexcrichton
bors [Fri, 7 Sep 2018 17:00:19 +0000 (17:00 +0000)]
Auto merge of #5991 - alexcrichton:bump, r=alexcrichton

Bump Cargo to 0.30.0

Looks like we accidentally forgot to do this!

6 years agoFix publishing renamed dependencies to crates.io
Alex Crichton [Fri, 7 Sep 2018 16:37:06 +0000 (09:37 -0700)]
Fix publishing renamed dependencies to crates.io

This commit fixes publishing crates which contain locally renamed dependencies
to crates.io. Previously this lack of information meant that although we could
resolve the crate graph correctly it wouldn't work well with respect to optional
features and optional dependencies. The fix here is to persist this information
into the registry about the crate being renamed in `Cargo.toml`, allowing Cargo
to correctly deduce feature names as it does when it has `Cargo.toml` locally.

A dual side of this commit is to publish this information to crates.io. We'll
want to merge the associated PR (link to come soon) on crates.io first and make
sure that's deployed as well before we stabilize the crate renaming feature.

The index format is updated as well as part of this change. The `name` key for
dependencies is now unconditionally what was written in `Cargo.toml` as the
left-hand-side of the dependency specification. In other words this is the raw
crate name, but only for the local crate. A new key, `package`, is added to
dependencies (and it can be `None`). This key indicates the crates.io package is
being linked against, an represents the `package` key in `Cargo.toml`.

It's important to consider the interaction with older Cargo implementations
which don't support the `package` key in the index. In these situations older
Cargo binaries will likely fail to resolve entirely as the renamed name is
unlikely to exist on crates.io. For example the `futures` crate now has an
optional dependency with the name `futures01` which depends on an older version
of `futures` on crates.io. The string `futures01` will be listed in the index
under the `"name"` key, but no `futures01` crate exists on crates.io so older
Cargo will generate an error. If the crate does exist on crates.io, then even
weirder error messages will likely result.

Closes #5962

6 years agoBump Cargo to 0.30.0
Alex Crichton [Fri, 7 Sep 2018 15:43:02 +0000 (08:43 -0700)]
Bump Cargo to 0.30.0

Looks like we accidentally forgot to do this!

6 years agoDon't print crates.io-index URL when Updating
Dale Wijnand [Fri, 7 Sep 2018 08:49:30 +0000 (09:49 +0100)]
Don't print crates.io-index URL when Updating

Following the lead from PackageId's Display, only display the registry's
URL if it's not the default registry (aka crates.io).

Before:

    $ cargo install lazy_static
        Updating registry `https://github.com/rust-lang/crates.io-index`

After:

    $ dcargo install lazy_static
        Updating registry

6 years agoAuto merge of #5989 - alexcrichton:change-default, r=Mark-Simulacrum
bors [Fri, 7 Sep 2018 00:15:42 +0000 (00:15 +0000)]
Auto merge of #5989 - alexcrichton:change-default, r=Mark-Simulacrum

Change the default edition for `cargo new` to 2018

As it says on the tin! Some tests were updated to explicitly pass 2015 so they
can continue to work on stable, and otherwise `cargo new` should now by default
generate a 2018 project.

6 years agoChange the default edition for `cargo new` to 2018
Alex Crichton [Fri, 7 Sep 2018 00:01:20 +0000 (17:01 -0700)]
Change the default edition for `cargo new` to 2018

As it says on the tin! Some tests were updated to explicitly pass 2015 so they
can continue to work on stable, and otherwise `cargo new` should now by default
generate a 2018 project.

6 years agoAuto merge of #5984 - alexcrichton:stabilize-edition, r=ehuss
bors [Thu, 6 Sep 2018 22:17:24 +0000 (22:17 +0000)]
Auto merge of #5984 - alexcrichton:stabilize-edition, r=ehuss

Stabilize `edition` key and add `cargo new --edition`

This commit stabilizes the `edition` key in `Cargo.toml`, both in the
`[package]` section and inside subtargets. Additionally the `cargo new` and
`cargo init` subcommands have been enhanced with a `--edition` flag to allow
explicitly specifying the edition to be generated.

This commit does not yet change the default edition that's generated.

Closes #5980

6 years agotime to investigate the bug
Eh2406 [Thu, 6 Sep 2018 19:44:48 +0000 (15:44 -0400)]
time to investigate the bug

6 years agosplit up some names
Eh2406 [Thu, 6 Sep 2018 19:34:29 +0000 (15:34 -0400)]
split up some names

6 years agorenumber things
Eh2406 [Thu, 6 Sep 2018 18:47:35 +0000 (14:47 -0400)]
renumber things

6 years agorename things
Eh2406 [Thu, 6 Sep 2018 17:59:26 +0000 (13:59 -0400)]
rename things