]> git.proxmox.com Git - cargo.git/log
cargo.git
7 years agofix borrowing the shell twice
Ralf Jung [Fri, 18 Aug 2017 18:10:34 +0000 (20:10 +0200)]
fix borrowing the shell twice

7 years agoUsing required dep as a feature is a warning for now, not an error
Ralf Jung [Fri, 18 Aug 2017 17:37:12 +0000 (19:37 +0200)]
Using required dep as a feature is a warning for now, not an error

7 years agoimprove misleading error message
Ralf Jung [Sat, 5 Aug 2017 04:27:26 +0000 (21:27 -0700)]
improve misleading error message

7 years agodetect required dependencies used as features
Ralf Jung [Sat, 5 Aug 2017 04:21:09 +0000 (21:21 -0700)]
detect required dependencies used as features

7 years agotest for mandatory dependencies not to be considered features
Ralf Jung [Sat, 5 Aug 2017 03:21:38 +0000 (20:21 -0700)]
test for mandatory dependencies not to be considered features

7 years agoAuto merge of #4404 - parkovski:master, r=alexcrichton
bors [Mon, 14 Aug 2017 23:23:05 +0000 (23:23 +0000)]
Auto merge of #4404 - parkovski:master, r=alexcrichton

Fix #4370 - init panic in C:\ or /

This fixes the crash in this issue, but the error message is strange - unable to create directory 'C:\\.'. I don't have write permissions there without becoming admin, so I suspect it's just a permission issue, but the weird error can be fixed by calling Path::canonicalize on line 300.

7 years agoFix #4370 - init panic in C:\ or /
Parker Snell [Mon, 14 Aug 2017 18:02:07 +0000 (11:02 -0700)]
Fix #4370 - init panic in C:\ or /

7 years agoAuto merge of #4402 - bluss:doc-rustdocflags, r=alexcrichton
bors [Sun, 13 Aug 2017 12:40:53 +0000 (12:40 +0000)]
Auto merge of #4402 - bluss:doc-rustdocflags, r=alexcrichton

Document `RUSTDOCFLAGS`

Documentation for this environment variable was missing. It's supported in stable releases of Rust already.

7 years agoDocument `RUSTDOCFLAGS`
bluss [Sun, 13 Aug 2017 12:27:27 +0000 (14:27 +0200)]
Document `RUSTDOCFLAGS`

7 years agoAuto merge of #4389 - matklad:testless, r=alexcrichton
bors [Sat, 12 Aug 2017 22:08:54 +0000 (22:08 +0000)]
Auto merge of #4389 - matklad:testless, r=alexcrichton

Allow to skip test code during publishing

closes #4365

I don't have time to review this code carefully right now, but looks like it does the job.

7 years agoAllow to skip test code during publishing
Aleksey Kladov [Wed, 9 Aug 2017 21:54:09 +0000 (00:54 +0300)]
Allow to skip test code during publishing

7 years agoAuto merge of #4393 - burtonageo:update-cargo-new-template, r=matklad
bors [Sat, 12 Aug 2017 14:46:51 +0000 (14:46 +0000)]
Auto merge of #4393 - burtonageo:update-cargo-new-template, r=matklad

Update lib template for `cargo new` so that the placeholder test contains an assertion

When you run `rustfmt` on the default generated lib template, it modifies it as shown [here](https://play.rust-lang.org/?gist=bd44610731e26e76719e75d47e598990&version=undefined)

7 years agoAuto merge of #4398 - debris:url_4394, r=alexcrichton
bors [Fri, 11 Aug 2017 17:12:45 +0000 (17:12 +0000)]
Auto merge of #4398 - debris:url_4394, r=alexcrichton

Fixed panic when canonicalizing not-a-base-url, fixes #4394

Fixes #4394. Majority of the changes are caused by propagating error upstream to `SourceId` and `GitSource`.

7 years agoFix implementation and tests for cannot-be-a-base-url canonicalization
debris [Fri, 11 Aug 2017 15:39:18 +0000 (17:39 +0200)]
Fix implementation and tests for cannot-be-a-base-url canonicalization

7 years agoFixed panic when canonicalizing not-a-base-url, fixes #4394
debris [Fri, 11 Aug 2017 14:25:19 +0000 (16:25 +0200)]
Fixed panic when canonicalizing not-a-base-url, fixes #4394

7 years agoAuto merge of #4396 - vignesh-sankaran:documentation-blacklist-list-fix, r=matklad
bors [Fri, 11 Aug 2017 07:28:15 +0000 (07:28 +0000)]
Auto merge of #4396 - vignesh-sankaran:documentation-blacklist-list-fix, r=matklad

Fix list rendering in manifest.md

Fixes a list rendering problem introduced in #4237.

7 years agoFix list rendering for blacklisted hosts
Vignesh [Fri, 11 Aug 2017 05:18:21 +0000 (15:18 +1000)]
Fix list rendering for blacklisted hosts

7 years agoAdd a placeholder assertion in the new lib project template
George Burton [Thu, 10 Aug 2017 22:30:33 +0000 (23:30 +0100)]
Add a placeholder assertion in the new lib project template

7 years agoFix tests
George Burton [Thu, 10 Aug 2017 21:19:41 +0000 (22:19 +0100)]
Fix tests

7 years agoUpdate lib template for `cargo new` so that it conforms to rustfmt style by default
George Burton [Thu, 10 Aug 2017 20:50:41 +0000 (21:50 +0100)]
Update lib template for `cargo new` so that it conforms to rustfmt style by default

7 years agoAuto merge of #4390 - alexcrichton:read-hard-links, r=matklad
bors [Thu, 10 Aug 2017 09:04:21 +0000 (09:04 +0000)]
Auto merge of #4390 - alexcrichton:read-hard-links, r=matklad

Use `same-file` to avoid unnecessary hard links

This is targeted at removing the need for a workaround in rust-lang/rust#39518,
allowing the main rust build system to move back to hard links which should be
much more efficient.

7 years agoAuto merge of #4386 - pornel:backups, r=alexcrichton
bors [Thu, 10 Aug 2017 05:11:28 +0000 (05:11 +0000)]
Auto merge of #4386 - pornel:backups, r=alexcrichton

Exclude target directory from Time Machine

Fixes #3884

7 years agoExclude target directory from Time Machine
Kornel [Wed, 9 Aug 2017 14:41:53 +0000 (15:41 +0100)]
Exclude target directory from Time Machine

Temporary/derived files outside dedicated system directories should be explicitly excluded from backups to prevent undesirable bloat and churn.

7 years agoUse `same-file` to avoid unnecessary hard links
Alex Crichton [Thu, 10 Aug 2017 00:22:34 +0000 (17:22 -0700)]
Use `same-file` to avoid unnecessary hard links

This is targeted at removing the need for a workaround in rust-lang/rust#39518,
allowing the main rust build system to move back to hard links which should be
much more efficient.

7 years agoAuto merge of #4384 - ivanbakel:unused_mut, r=alexcrichton
bors [Wed, 9 Aug 2017 17:42:20 +0000 (17:42 +0000)]
Auto merge of #4384 - ivanbakel:unused_mut, r=alexcrichton

Fixed some variables being unnecessarily mutable

### Changes

Some variables are marked `mut` when they don't need to be. This PR changes those variables to no longer be `mut`.

### Context

PR on https://github.com/rust-lang/rust/pull/43582

tl:dr; There's a bug with the mutability checker that sometimes marks mutable ref variables as being used when they're not.

7 years agoAuto merge of #4382 - Xanewok:expose-filter-rule, r=alexcrichton
bors [Wed, 9 Aug 2017 16:30:21 +0000 (16:30 +0000)]
Auto merge of #4382 - Xanewok:expose-filter-rule, r=alexcrichton

Expose ops::cargo_compile::FilterRule

I've been mindlessly copying and consuming the Cargo API to work on the build plan prototype for RLS and I noticed that, it seems, pub `ops::cargo_compile::CompileFilter` is exported, but not the `ops::cargo_compile::FilterRule`, which `CompileFilter` uses, as a part of a public API.

If I'm wrong and missing something, feel free to ignore/close it. It was possible to match/destructure `CompileFilter` before, but with this change it's possible to use the underlying type.

7 years agoFixed instance in Windows cfg.
Isaac van Bakel [Wed, 9 Aug 2017 15:11:04 +0000 (16:11 +0100)]
Fixed instance in Windows cfg.

7 years agoFixed variables being unnecessarily mut.
Isaac van Bakel [Wed, 9 Aug 2017 14:37:54 +0000 (15:37 +0100)]
Fixed variables being unnecessarily mut.

7 years agoAuto merge of #4378 - behnam:ignore, r=alexcrichton
bors [Wed, 9 Aug 2017 14:33:51 +0000 (14:33 +0000)]
Auto merge of #4378 - behnam:ignore, r=alexcrichton

[sources/path] Support leading slash in glob patterns

Background: https://github.com/rust-lang/cargo/issues/4268

This diff takes us to **Stage 1.1** of the migration plan by allowing
glob patterns to include a leading slash, so that glob patterns can be
updated, if needed, to start with a slash, closer to the future behavior
with gitignore-like matching.

Why is this stage needed?

It's common to have `package.include` set like this:
```
include = ["src/**"]
```
In old interpretation, this would only include all files under the `src`
directory under the package root. With the new interpretation, this
would match any path with some directory called `src`, even if it's not
directly under the package root.

After this patch, package owners can start marking glob patters with a
leading slash to fix the warning thrown, if any.

One thing to notice here is that there are no extra matchings, but, if
a manifest has already a pattern with a leading slash, this would
silently start matching it with the paths. I believe this is fine, since
the old behavior would have been for the pattern to not match anything,
therefore the item was useless.

See also <https://github.com/rust-lang/cargo/issues/4377> for suggestion
to throw warning on useless/invalid patterns in these fields.

7 years agoAuto merge of #3611 - tylerwhall:stable-metadata, r=alexcrichton
bors [Wed, 9 Aug 2017 14:10:12 +0000 (14:10 +0000)]
Auto merge of #3611 - tylerwhall:stable-metadata, r=alexcrichton

Stable metadata hashes across workspaces

Currently a crate from a path source will have its metadata hash incorporate its absolute path on the system where it is built. This always impacts top-level crates, which means that compiling the same source with the same dependencies and compiler version will generate libraries with symbol names that vary depending on where the workspace resides on the machine.

This is hopefully a general solution to the hack we've used in meta-rust to make dynamic linking reliable.
meta-rust/meta-rust@0e6cf94

For paths inside the Cargo workspace, hash their SourceId relative to the root of the workspace. Paths outside of a workspace are still hashed as absolute.

This stability is important for reproducible builds as part of a larger build system that employs caching of artifacts, such as OpenEmbedded.

OpenEmbedded tightly controls all inputs to a build and its caching assumes that an equivalent artifact will always result from the same set of inputs. The workspace path is not considered to be an influential input, however.

For example, if Cargo is used to compile libstd shared objects which downstream crates link to dynamically, it must be possible to rebuild libstd given the same inputs and produce a library that is at least link-compatible with the original. If the build system happens to cache the downstream crates but needs to rebuild libstd and the user happens to be building in a different workspace path, currently Cargo will generate a library incompatible with the original and the downstream executables will fail at runtime on the target.

7 years agoExpose ops::cargo_compile::FilterRule
Igor Matuszewski [Tue, 8 Aug 2017 11:01:44 +0000 (13:01 +0200)]
Expose ops::cargo_compile::FilterRule

7 years agoAuto merge of #4376 - behnam:virtual, r=alexcrichton
bors [Tue, 8 Aug 2017 00:58:29 +0000 (00:58 +0000)]
Auto merge of #4376 - behnam:virtual, r=alexcrichton

[docs/manifest] Add Virtual Manifest section

Current documentation does not mention Virtual Manifests at all, which
can be confusing because they appear in error messages.

Here we add the definition, and provide a hint about `--all` option for
most cargo commands, which allow the command to work in the way most
probably expected.

Fixes <https://github.com/rust-lang/cargo/issues/3526>

7 years agoAuto merge of #4374 - behnam:new-init, r=alexcrichton
bors [Tue, 8 Aug 2017 00:05:36 +0000 (00:05 +0000)]
Auto merge of #4374 - behnam:new-init, r=alexcrichton

[cargo_new] Hint to use `cargo init` on existing dir

The `new` command always expects a non-existing path. The `init` command
always expects an existing path. Therefore, it makes sense to hint to
use `init` if the pre-condition to `new` is not satisfied.

Fixes <#4366>

7 years agoAuto merge of #4375 - behnam:root-vs-repo, r=alexcrichton
bors [Mon, 7 Aug 2017 23:40:25 +0000 (23:40 +0000)]
Auto merge of #4375 - behnam:root-vs-repo, r=alexcrichton

[docs] Update language regarding repository vs package root

In the current documentation, there are many places with language that
assumes a *repository* (as in VCS) is the same as *package root* (the
directory where `Cargo.toml` sits).

With the new workspace features, this is far from true now, and the
inaccurate language makes it difficault for newbies or developers
without much familiarity with the cargo internals with authoring their
manifest files.

This diff tries to use the right terms for places any of these concepts
is referred to:

* Package root,
* Workspace root,
* VCS repository, and
* Package repository/index, like crates.io.

Fixes <https://github.com/rust-lang/cargo/issues/4367>

7 years ago[sources/path] Support leading slash in glob patterns
Behnam Esfahbod [Mon, 7 Aug 2017 19:48:12 +0000 (12:48 -0700)]
[sources/path] Support leading slash in glob patterns

Background: https://github.com/rust-lang/cargo/issues/4268

This diff takes us to **Stage 1.1** of the migration plan by allowing
glob patterns to include a leading slash, so that glob patterns can be
updated, if needed, to start with a slash, closer to the future behavior
with gitignore-like matching.

Why is this stage needed?

It's common to have `package.include` set like this:
```
include = ["src/**"]
```
In old interpretation, this would only include all files under the `src`
directory under the package root. With the new interpretation, this
would match any path with some directory called `src`, even if it's not
directly under the package root.

After this patch, package owners can start marking glob patters with a
leading slash to fix the warning thrown, if any.

One thing to notice here is that there are no extra matchings, but, if
a manifest has already a pattern with a leading slash, this would
silently start matching it with the paths. I believe this is fine, since
the old behavior would have been for the pattern to not match anything,
therefore the item was useless.

See also <https://github.com/rust-lang/cargo/issues/4377> for suggestion
to throw warning on useless/invalid patterns in these fields.

7 years ago[docs/manifest] Add Virtual Manifest section
Behnam Esfahbod [Mon, 7 Aug 2017 18:44:34 +0000 (11:44 -0700)]
[docs/manifest] Add Virtual Manifest section

Current documentation does not mention Virtual Manifests at all, which
can be confusing because they appear in error messages.

Here we add the definition, and provide a hint about `--all` option for
most cargo commands, which allow the command to work in the way most
probably expected.

Fixes <https://github.com/rust-lang/cargo/issues/3526>

7 years ago[docs] Wrap long lines
Behnam Esfahbod [Mon, 7 Aug 2017 18:26:53 +0000 (11:26 -0700)]
[docs] Wrap long lines

7 years ago[docs] Update language regarding repository vs package root
Behnam Esfahbod [Mon, 7 Aug 2017 18:11:36 +0000 (11:11 -0700)]
[docs] Update language regarding repository vs package root

In the current documentation, there are many places with language that
assumes a *repository* (as in VCS) is the same as *package root* (the
directory where `Cargo.toml` sits).

With the new workspace features, this is far from true now, and the
inaccurate language makes it difficault for newbies or developers
without much familiarity with the cargo internals with authoring their
manifest files.

This diff tries to use the right terms for places any of these concepts
is referred to:

* Package root,
* Workspace root,
* VCS repository, and
* Package repository/index, like crates.io.

7 years ago[cargo_new] Hint to use `cargo init` on existing dir
Behnam Esfahbod [Mon, 7 Aug 2017 16:31:32 +0000 (09:31 -0700)]
[cargo_new] Hint to use `cargo init` on existing dir

The `new` command always expects a non-existing path. The `init` command
always expects an existing path. Therefore, it makes sense to hint to
use `init` if the pre-condition to `new` is not satisfied.

Fixes <https://github.com/rust-lang/cargo/issues/4366>

7 years ago[bin/init] Update USAGE
Behnam Esfahbod [Mon, 7 Aug 2017 16:05:02 +0000 (09:05 -0700)]
[bin/init] Update USAGE

7 years agoAuto merge of #4372 - frankmcsherry:patch-1, r=alexcrichton
bors [Mon, 7 Aug 2017 04:12:18 +0000 (04:12 +0000)]
Auto merge of #4372 - frankmcsherry:patch-1, r=alexcrichton

Modernize explanation of `build.rs`

After some recent head-banging, it was explained to me that `"build.rs"` is a special file name, and that Cargo will build such a file even if you do not expect it to, for example if `Cargo.toml` contains the commented out line

```
#build = "build.rs"
```

Some experimentation lead me to the described behavior, but if it misses any subtle details please feel free to correct. The old text is incorrect, though.

7 years agoAuto merge of #4369 - Wallacoloo:specifying-dependencies-typo, r=alexcrichton
bors [Mon, 7 Aug 2017 03:49:33 +0000 (03:49 +0000)]
Auto merge of #4369 - Wallacoloo:specifying-dependencies-typo, r=alexcrichton

Fix repeated "to to" in Specifying Dependencies

Fixes the typo:

> [...] boil down to the ability to **to** work with a crate [...]

7 years agoModernize explanation of `build.rs`
Frank McSherry [Sun, 6 Aug 2017 20:57:13 +0000 (16:57 -0400)]
Modernize explanation of `build.rs`

After some recent head-banging, it was explained to me that `"build.rs"` is a special file name, and that Cargo will build such a file even if you do not expect it to, for example if `Cargo.toml` contains the commented out line

```
#build = "build.rs"
```

Some experimentation lead me to the described behavior, but if it misses any subtle details please feel free to correct. The old text is incorrect, though.

7 years agoFix repeated "to to" in Specifying Dependencies
Colin Wallace [Sun, 6 Aug 2017 02:01:24 +0000 (19:01 -0700)]
Fix repeated "to to" in Specifying Dependencies

7 years agoAuto merge of #4355 - pornel:docs, r=alexcrichton
bors [Fri, 4 Aug 2017 09:28:33 +0000 (09:28 +0000)]
Auto merge of #4355 - pornel:docs, r=alexcrichton

Expand profile settings descriptions

Flags were described in the format `foobar = true # controls foobar, passes '--foobar' flag`, but this doesn't actually say what `foobar` does. I've expanded the descriptions a little to provide more context.

7 years agoAuto merge of #4360 - sid0:members, r=matklad
bors [Fri, 4 Aug 2017 08:21:55 +0000 (08:21 +0000)]
Auto merge of #4360 - sid0:members, r=matklad

workspace: export Members as part of the public interface

This struct is returned by `Workspace::members`, but there's no way to
refer to it since it's not exported.

7 years agoworkspace: export Members as part of the public interface
Siddharth Agarwal [Fri, 4 Aug 2017 05:33:27 +0000 (22:33 -0700)]
workspace: export Members as part of the public interface

This struct is returned by `Workspace::members`, but there's no way to
refer to it since it's not exported.

7 years agoAuto merge of #4359 - sid0:debug, r=alexcrichton
bors [Fri, 4 Aug 2017 03:52:35 +0000 (03:52 +0000)]
Auto merge of #4359 - sid0:debug, r=alexcrichton

derive Debug for more data structures

This makes it easier for wrappers around Cargo to inspect the contents
of these data structures.

7 years agoderive Debug for more data structures
Siddharth Agarwal [Fri, 4 Aug 2017 01:45:59 +0000 (18:45 -0700)]
derive Debug for more data structures

This makes it easier for wrappers around Cargo to inspect the contents
of these data structures.

7 years agoAuto merge of #4237 - vignesh-sankaran:blacklist-url-doc, r=carols10cents
bors [Thu, 3 Aug 2017 15:01:06 +0000 (15:01 +0000)]
Auto merge of #4237 - vignesh-sankaran:blacklist-url-doc, r=carols10cents

Added documentation blacklisting notes

Added notes regarding [documentation domain blacklisting](https://github.com/rust-lang/crates.io/issues/626) on crates.io

7 years agoExpand profile settings descriptions
Kornel [Wed, 2 Aug 2017 17:11:02 +0000 (18:11 +0100)]
Expand profile settings descriptions

7 years agoAuto merge of #4345 - froydnj:use-noop-more, r=alexcrichton
bors [Mon, 31 Jul 2017 21:31:02 +0000 (21:31 +0000)]
Auto merge of #4345 - froydnj:use-noop-more, r=alexcrichton

use Work::noop() more

Using Work::noop() in these places is clearer.

7 years agoAuto merge of #4344 - froydnj:cargo-rustc-spelling-fixes, r=alexcrichton
bors [Mon, 31 Jul 2017 20:31:58 +0000 (20:31 +0000)]
Auto merge of #4344 - froydnj:cargo-rustc-spelling-fixes, r=alexcrichton

fix some spelling errors in cargo_rustc

7 years agouse Work::noop() more
Nathan Froyd [Mon, 31 Jul 2017 19:59:14 +0000 (15:59 -0400)]
use Work::noop() more

Using Work::noop() in these places is clearer.

7 years agoAuto merge of #4342 - sid0:hgignore, r=alexcrichton
bors [Mon, 31 Jul 2017 19:42:41 +0000 (19:42 +0000)]
Auto merge of #4342 - sid0:hgignore, r=alexcrichton

new: fix hgignore for real

There was an attempt to fix hgignore in #4158, but unfortunately the fix
was incorrect -- hgignore glob syntax is not in fact identical to
gitignore syntax.

To get rooted ignores in Mercurial we must use the regex-based syntax,
so we have no choice but to define a separate set of ignores.

7 years agofix some spelling errors in cargo_rustc
Nathan Froyd [Mon, 31 Jul 2017 19:26:44 +0000 (15:26 -0400)]
fix some spelling errors in cargo_rustc

7 years agoAuto merge of #4343 - sid0:debug, r=alexcrichton
bors [Mon, 31 Jul 2017 19:13:35 +0000 (19:13 +0000)]
Auto merge of #4343 - sid0:debug, r=alexcrichton

derive/impl Debug for a few data structures

I found this to be extremely useful while trying to write a wrapper on
top of cargo.

7 years agoderive/impl Debug for a few data structures
Siddharth Agarwal [Mon, 31 Jul 2017 16:38:43 +0000 (09:38 -0700)]
derive/impl Debug for a few data structures

I found this to be extremely useful while trying to write a wrapper on
top of cargo.

7 years agonew: fix hgignore for real
Siddharth Agarwal [Mon, 31 Jul 2017 01:15:24 +0000 (18:15 -0700)]
new: fix hgignore for real

There was an attempt to fix hgignore in #4158, but unfortunately the fix
was incorrect -- hgignore glob syntax is not in fact identical to
gitignore syntax.

To get rooted ignores in Mercurial we must use the regex-based syntax,
so we have no choice but to define a separate set of ignores.

7 years agoAuto merge of #4340 - debris:fixed_4310, r=alexcrichton
bors [Sun, 30 Jul 2017 17:51:50 +0000 (17:51 +0000)]
Auto merge of #4340 - debris:fixed_4310, r=alexcrichton

Fixed #4310, print useful message when dependency contains a malformed Cargo.toml

fixed #4310

7 years agoRemoved redundant unwrap
debris [Sun, 30 Jul 2017 14:15:35 +0000 (16:15 +0200)]
Removed redundant unwrap

7 years agofixed #4310, print useful information when git Cargo.toml is malformed
debris [Sun, 30 Jul 2017 14:12:18 +0000 (16:12 +0200)]
fixed #4310, print useful information when git Cargo.toml is malformed

7 years agoAuto merge of #4338 - GuillaumeGomez:lint, r=alexcrichton
bors [Fri, 28 Jul 2017 22:40:15 +0000 (22:40 +0000)]
Auto merge of #4338 - GuillaumeGomez:lint, r=alexcrichton

Update to rc error chain

In order to make https://github.com/rust-lang/rust/pull/43009 works, I needed some small updates that are now in error-chain.

7 years agoUpdate error-chain dep for crates-io as well
Guillaume Gomez [Fri, 28 Jul 2017 19:37:08 +0000 (21:37 +0200)]
Update error-chain dep for crates-io as well

7 years agoUpdate to rc error chain
Guillaume Gomez [Fri, 28 Jul 2017 19:12:05 +0000 (21:12 +0200)]
Update to rc error chain

7 years agoAuto merge of #4216 - durka:install-multi, r=alexcrichton
bors [Fri, 28 Jul 2017 16:07:08 +0000 (16:07 +0000)]
Auto merge of #4216 - durka:install-multi, r=alexcrichton

cargo install multiple crates

rust-lang-nursery/rustup.rs#986 for `cargo install`

Revives #2601 @pwoolcoc, replaces #3075 @esclear, closes #2585 @kindlychung @cyplo

Avoids the sticking point of the previous two PRs (multiple registry updates) by threading through a first-run boolean flag to decide whether `select_pkg` needs to call `source.update()`.

There is still the issue that flags such as `--git` and `--vers` are "global" to the multiple packages you may be installing. The workaround is just to run `cargo install` separately. In the future we could add syntax like `cargo install foo=1.0 bar=2.5 quux=git://github.com/durka/quux#dev-branch` or something.

7 years agoAuto merge of #4335 - debris:rebased_4021, r=matklad
bors [Fri, 28 Jul 2017 11:55:38 +0000 (11:55 +0000)]
Auto merge of #4335 - debris:rebased_4021, r=matklad

Rebased and fixed 4025: Apply --all if workspace is virtual

- fixes #4021
- rebased #4025
- fixed issue issue described by @matklad in https://github.com/rust-lang/cargo/pull/4025#pullrequestreview-40660570
- added test `build_virtual_manifest_one_project` which covers the fix

7 years agoUpdated build_virtual_manifest_one_project test
debris [Fri, 28 Jul 2017 11:51:16 +0000 (13:51 +0200)]
Updated build_virtual_manifest_one_project test

7 years agoFixed test_virtual_manifest_all_implied test
debris [Fri, 28 Jul 2017 09:19:54 +0000 (11:19 +0200)]
Fixed test_virtual_manifest_all_implied test

7 years agoFixed bench_virtual_manifest_all_implied test
debris [Thu, 27 Jul 2017 21:20:34 +0000 (23:20 +0200)]
Fixed bench_virtual_manifest_all_implied test

7 years agoProper building virtual manifest with -p flag
debris [Thu, 27 Jul 2017 20:44:45 +0000 (22:44 +0200)]
Proper building virtual manifest with -p flag

7 years agoAdds tests
Romain Sertelon [Fri, 26 May 2017 21:00:45 +0000 (23:00 +0200)]
Adds tests

7 years agoApply --all if workspace is virtual
Romain Sertelon [Wed, 10 May 2017 21:30:32 +0000 (23:30 +0200)]
Apply --all if workspace is virtual

Should help close #4021

7 years agoAuto merge of #4331 - joshtriplett:fix-notices, r=matklad
bors [Thu, 27 Jul 2017 07:04:32 +0000 (07:04 +0000)]
Auto merge of #4331 - joshtriplett:fix-notices, r=matklad

Remove inaccurate (misattributed) copyright notices

As discussed with @aturon, who took it to @rust-lang/core.

LICENSE-MIT and one source file contain inaccurate copyright notices of
the form "Copyright (c) (years) The Rust Project Developers", which
implies that an entity called "The Rust Project Developers" holds
copyrights in Rust. Rust contributors retain their copyrights, and do
not assign them to anyone by contributing.  Remove the inaccurate
notices.

7 years agoCleaned up notes about documentation blacklisting
Vignesh Sankaran [Thu, 27 Jul 2017 05:02:16 +0000 (15:02 +1000)]
Cleaned up notes about documentation blacklisting

7 years agoAdded documentation blacklisting notes
Vignesh [Wed, 28 Jun 2017 13:19:50 +0000 (23:19 +1000)]
Added documentation blacklisting notes

7 years agoRemove inaccurate (misattributed) copyright notices
Josh Triplett [Thu, 27 Jul 2017 00:19:24 +0000 (17:19 -0700)]
Remove inaccurate (misattributed) copyright notices

LICENSE-MIT and one source file contain inaccurate copyright notices of
the form "Copyright (c) (years) The Rust Project Developers", which
implies that an entity called "The Rust Project Developers" holds
copyrights in Rust. Rust contributors retain their copyrights, and do
not assign them to anyone by contributing.  Remove the inaccurate
notices.

7 years agoAuto merge of #4329 - behnam:dev, r=matklad
bors [Wed, 26 Jul 2017 07:34:23 +0000 (07:34 +0000)]
Auto merge of #4329 - behnam:dev, r=matklad

[doc/manifest] Add build-dependencies to Dependency sections list

The `[build-dependencies]` section was missing from the Dependency
sections list, making it hard to find its existence and link to
`specifying-dependencies` page. This puts the section title in the list,
so a normal find works.

Background: https://github.com/rust-lang/cargo/issues/4309#issuecomment-317965620

7 years ago[doc/manifest] Add build-dependencies to Dependency sections list
Behnam Esfahbod [Wed, 26 Jul 2017 06:59:56 +0000 (00:59 -0600)]
[doc/manifest] Add build-dependencies to Dependency sections list

The `[build-dependencies]` section was missing from the Dependency
sections list, making it hard to find its existence and link to
`specifying-dependencies` page. This puts the section title in the list,
so a normal find works.

Background: https://github.com/rust-lang/cargo/issues/4309#issuecomment-317965620

7 years agononzero exit code if some crates didn't install
Alex Burka [Tue, 25 Jul 2017 19:36:42 +0000 (15:36 -0400)]
nonzero exit code if some crates didn't install

7 years agouse top level err handling
Alex Burka [Tue, 25 Jul 2017 19:36:01 +0000 (15:36 -0400)]
use top level err handling

7 years agodon't continue if single install errors
Alex Burka [Mon, 24 Jul 2017 23:25:46 +0000 (19:25 -0400)]
don't continue if single install errors

7 years agoAuto merge of #4317 - iKevinY:options-unit-struct, r=matklad
bors [Sat, 22 Jul 2017 20:53:06 +0000 (20:53 +0000)]
Auto merge of #4317 - iKevinY:options-unit-struct, r=matklad

Convert Options struct into unit struct

Unit struct support was added in Docopt 0.8.1 via docopt/docopt.rs#217. Fixes #4174.

7 years agoConvert Options struct into unit struct
Kevin Yap [Sat, 22 Jul 2017 19:57:55 +0000 (12:57 -0700)]
Convert Options struct into unit struct

Unit struct support was added in Docopt 0.8.1 via
docopt/docopt.rs#217. Fixes #4174.

7 years agoAuto merge of #4305 - nodakai:fix-4278-tests-on-empty-ld_library_path, r=matklad
bors [Fri, 21 Jul 2017 20:52:24 +0000 (20:52 +0000)]
Auto merge of #4305 - nodakai:fix-4278-tests-on-empty-ld_library_path, r=matklad

tests/build.rs: remove empty components from LD_LIBRARY_PATH to fix #4278

The tests intended to ensure Cargo wouldn't mistakenly add empty components to `LD_LIBRARY_PATH` (or its equivalents) but they could fail when the test runner already had empty components in `LD_LIBRARY_PATH` from their environment.

7 years agotests/build.rs: remove empty components from LD_LIBRARY_PATH
NODA, Kai [Wed, 19 Jul 2017 13:59:50 +0000 (21:59 +0800)]
tests/build.rs: remove empty components from LD_LIBRARY_PATH

This is to amend PR #4278

The tests intended to ensure Cargo wouldn't mistakenly add empty
components to LD_LIBRARY_PATH (or its equivalents) but they could fail
when the test runner already had empty components in LD_LIBRARY_PATH
from their environment.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
7 years agoAuto merge of #4303 - bluetech:doc-env-cfg, r=alexcrichton
bors [Thu, 20 Jul 2017 17:06:30 +0000 (17:06 +0000)]
Auto merge of #4303 - bluetech:doc-env-cfg, r=alexcrichton

Document the CARGO_CFG_* environment variables - fixes #4302

In order to keep the paragraph brief, I have omitted:

- examples of actual variable names - though adding those might help google.
- mention of `rustc --print cfg` - I think the link to the reference is enough.
- reference to the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md#lowering-cfg-values-to-cargo-build-script-environment-variables) - I don't think it's needed.

7 years agoAuto merge of #4308 - alexcrichton:bump, r=alexcrichton
bors [Thu, 20 Jul 2017 16:03:36 +0000 (16:03 +0000)]
Auto merge of #4308 - alexcrichton:bump, r=alexcrichton

Bump to 0.22.0 and update deps

7 years agoWork around AppVeyor for now
Alex Crichton [Thu, 20 Jul 2017 15:56:49 +0000 (08:56 -0700)]
Work around AppVeyor for now

7 years agoBump to 0.22.0 and update deps
Alex Crichton [Thu, 20 Jul 2017 15:34:13 +0000 (08:34 -0700)]
Bump to 0.22.0 and update deps

7 years agoDocument the CARGO_CFG_* environment variables - fixes #4302
Ran Benita [Wed, 19 Jul 2017 22:30:32 +0000 (01:30 +0300)]
Document the CARGO_CFG_* environment variables - fixes #4302

7 years agoAuto merge of #4299 - brson:home, r=alexcrichton
bors [Wed, 19 Jul 2017 02:10:52 +0000 (02:10 +0000)]
Auto merge of #4299 - brson:home, r=alexcrichton

Replace homedir definition with home crate

This pulls out the definitions of these functions into a single crate, [home](https://github.com/brson/home), to act as their canonical definition.

This has a bigger impact on rustup, since it is using  definitions of all these things, where cargo is just defining cargo_home in terms of std's wrong home_dir.

The [definition of cargo_home](https://github.com/brson/home/blob/master/src/lib.rs#L179) used here is slightly different than what cargo has today in that it contains a bit of defensive code to avoid allowing `CARGO_HOME` to be set to `.multirust/cargo` - this is backwards compatibility code from rustup.

7 years agoAuto merge of #4298 - behnam:ignore, r=alexcrichton
bors [Wed, 19 Jul 2017 00:57:30 +0000 (00:57 +0000)]
Auto merge of #4298 - behnam:ignore, r=alexcrichton

[src/doc/manifest] Add section on Migrating to `gitignore`-like pattern matching

Tracking issue: https://github.com/rust-lang/cargo/issues/4268

7 years ago[src/doc/manifest] Add section on Migrating to `gitignore`-like pattern matching
Behnam Esfahbod [Tue, 18 Jul 2017 23:16:50 +0000 (17:16 -0600)]
[src/doc/manifest] Add section on Migrating to `gitignore`-like pattern matching

Tracking issue: https://github.com/rust-lang/cargo/issues/4268

7 years agoReplace homedir definition with home crate
Brian Anderson [Tue, 18 Jul 2017 23:42:51 +0000 (16:42 -0700)]
Replace homedir definition with home crate

7 years agoAuto merge of #4123 - alexcrichton:augment, r=matklad
bors [Tue, 18 Jul 2017 18:51:34 +0000 (18:51 +0000)]
Auto merge of #4123 - alexcrichton:augment, r=matklad

Implement the [patch] section of the manifest

This is an implementation of [RFC 1969] which adds a new section to top-level
manifests: `[patch]`. This section allows you to augment existing sources with
new versions of crates, possibly replacing the versions that already exist in
the source. More details about this feature can be found in the RFC itself.

[RFC 1969]: https://github.com/rust-lang/rfcs/pull/1969

7 years agoImplement the [patch] section of the manifest
Alex Crichton [Fri, 12 May 2017 18:07:46 +0000 (11:07 -0700)]
Implement the [patch] section of the manifest

This is an implementation of [RFC 1969] which adds a new section to top-level
manifests: `[patch]`. This section allows you to patch existing sources with
new versions of crates, possibly replacing the versions that already exist in
the source. More details about this feature can be found in the RFC itself.

[RFC 1969]: https://github.com/rust-lang/rfcs/pull/1969

7 years agoAuto merge of #4270 - behnam:ignore, r=alexcrichton
bors [Tue, 18 Jul 2017 16:04:11 +0000 (16:04 +0000)]
Auto merge of #4270 - behnam:ignore, r=alexcrichton

[sources/path] Add gitignore-like pattern matching and warn on mismatches

Add gitignore-like pattern matching logic to `list_files()` and throw
warnings for paths getting different inclusion/exclusion results from
the old and the new methods.

Migration Tracking: <#4268>

7 years agoAuto merge of #4295 - xftroxgpx:use_full_path_in_warning_for_issue4293, r=matklad
bors [Tue, 18 Jul 2017 14:09:10 +0000 (14:09 +0000)]
Auto merge of #4295 - xftroxgpx:use_full_path_in_warning_for_issue4293, r=matklad

Fixes #4293

locally tested with:
`cargo test legacy_ many_crate_types_old_style_lib_location`

7 years agoremove leftover { }
xftroxgpx [Tue, 18 Jul 2017 14:05:50 +0000 (16:05 +0200)]
remove leftover { }