]> git.proxmox.com Git - cargo.git/log
cargo.git
10 years agoauto merge of #285 : alexcrichton/cargo/fix-cargo-doc, r=wycats
bors [Tue, 29 Jul 2014 21:14:29 +0000 (21:14 +0000)]
auto merge of #285 : alexcrichton/cargo/fix-cargo-doc, r=wycats

The existing rustdoc behavior for working with an already-present directory is
good enough, so there's no need for cargo to help out by blowing things away.
This also makes the copy-back portion easier by just not having it.

Closes #284

10 years agoauto merge of #255 : michaelsproul/cargo/missing-pkg-error, r=alexcrichton
bors [Tue, 29 Jul 2014 20:44:31 +0000 (20:44 +0000)]
auto merge of #255 : michaelsproul/cargo/missing-pkg-error, r=alexcrichton

I've changed the error message that appears when a dependency can't be located. With my changes, mismatches between Cargo.toml dependency names and actual dependency package names are (slightly) more apparent. This doesn't change the error that appears when a dependency has an invalid source.

Example:

```toml
# Cargo.toml
...
[dependencies.foo]

path = "foo"
```

```toml
# foo/Cargo.toml
[package]

name = "not_foo"
```

Previously:

```
$ cargo build
No package named Dependency { name: foo, namespace: file:/home/michael/cargo_test, req: *, transitive: true } found
```

Now:

```
$ cargo build
No package named `foo` found (required by `bar`).
Location searched: /some/folder/not_foo
Version required: *
```

In verbose mode I think it would be also nice to print a list of packages that Cargo *does* know about. Something like: "Known packages amongst dependencies: not_foo, etc"

10 years agoauto merge of #286 : benizi/cargo/fix/update-build-in-readme, r=alexcrichton
bors [Tue, 29 Jul 2014 19:44:34 +0000 (19:44 +0000)]
auto merge of #286 : benizi/cargo/fix/update-build-in-readme, r=alexcrichton

- Remove outdated `git submodule` instructions
- Add new `./configure` build step

10 years agoImprove the error message for missing packages.
Michael Sproul [Thu, 24 Jul 2014 11:16:20 +0000 (21:16 +1000)]
Improve the error message for missing packages.

10 years agoauto merge of #283 : alexcrichton/cargo/fix-fresh-plugin-deps, r=wycats
bors [Tue, 29 Jul 2014 05:29:34 +0000 (05:29 +0000)]
auto merge of #283 : alexcrichton/cargo/fix-fresh-plugin-deps, r=wycats

When copying files over from the old root to the new root on a fresh
compilation, care must be taken to preserve the correct plugin/host version of
each dependency. The previous code copied back over at most one library, but
this commit fixes this behavior by copying over all targets necessary for
compilation.

10 years agoUpdate README with new build instructions
Benjamin R. Haskell [Tue, 29 Jul 2014 05:13:30 +0000 (01:13 -0400)]
Update README with new build instructions

- Remove outdated `git submodule` instructions
- Add new `./configure` build step

10 years agoDon't blow away target/doc
Alex Crichton [Tue, 29 Jul 2014 03:09:07 +0000 (20:09 -0700)]
Don't blow away target/doc

The existing rustdoc behavior for working with an already-present directory is
good enough, so there's no need for cargo to help out by blowing things away.
This also makes the copy-back portion easier by just not having it.

Closes #284

10 years agoCorrectly preserve plugin deps
Alex Crichton [Tue, 29 Jul 2014 02:35:08 +0000 (19:35 -0700)]
Correctly preserve plugin deps

When copying files over from the old root to the new root on a fresh
compilation, care must be taken to preserve the correct plugin/host version of
each dependency. The previous code copied back over at most one library, but
this commit fixes this behavior by copying over all targets necessary for
compilation.

10 years agoauto merge of #277 : alexcrichton/cargo/add-configure-script, r=wycats
bors [Tue, 29 Jul 2014 01:17:48 +0000 (01:17 +0000)]
auto merge of #277 : alexcrichton/cargo/add-configure-script, r=wycats

This configure script is similar to rust's in that it doesn't require anything
like autotools, it's just a meta-script to "generate" a makefile and perform
run-of-the-mill validation/discovery before the Makefile is run.

The main purpose of this rewrite is to support multi-target and targeted builds.
This will allow us to produce 32-bit snapshots for platforms as well as easily
providing `./configure --target $foo` for initialization.

cc #274

10 years agoAdd a configure script
Alex Crichton [Mon, 28 Jul 2014 15:01:54 +0000 (08:01 -0700)]
Add a configure script

This configure script is similar to rust's in that it doesn't require anything
like autotools, it's just a meta-script to "generate" a makefile and perform
run-of-the-mill validation/discovery before the Makefile is run.

The main purpose of this rewrite is to support multi-target and targeted builds.
This will allow us to produce 32-bit snapshots for platforms as well as easily
providing `./configure --target $foo` for initialization.

cc #274

10 years agoauto merge of #282 : alexcrichton/cargo/fix-some-cross-compile-with-plugins, r=wycats
bors [Tue, 29 Jul 2014 00:14:32 +0000 (00:14 +0000)]
auto merge of #282 : alexcrichton/cargo/fix-some-cross-compile-with-plugins, r=wycats

* Make sure plugins link to plugin dependencies, not target dependencies.
  Previously the --extern flag was being passed incorrectly but the dependency
  was being picked up by -L anyway.

* Fix a type and actually put the host dep directory into LD_LIBRARY_PATH, not
  the target directory. A test was added for this change.

10 years agoFix some dep errors with cross-compiled plugins
Alex Crichton [Tue, 29 Jul 2014 00:08:46 +0000 (17:08 -0700)]
Fix some dep errors with cross-compiled plugins

* Make sure plugins link to plugin dependencies, not target dependencies.
  Previously the --extern flag was being passed incorrectly but the dependency
  was being picked up by -L anyway.

* Fix a type and actually put the host dep directory into LD_LIBRARY_PATH, not
  the target directory. A test was added for this change.

10 years agoauto merge of #281 : alexcrichton/cargo/no-more-warnings, r=wycats
bors [Mon, 28 Jul 2014 21:14:32 +0000 (21:14 +0000)]
auto merge of #281 : alexcrichton/cargo/no-more-warnings, r=wycats

This helps keep the build a little cleaner and any breakage that happens due to
rust changing will likely be mitigated by nightlies.

10 years agoDeny all warnings when building cargo
Alex Crichton [Mon, 28 Jul 2014 20:57:57 +0000 (13:57 -0700)]
Deny all warnings when building cargo

This helps keep the build a little cleaner and any breakage that happens due to
rust changing will likely be mitigated by nightlies.

10 years agoauto merge of #266 : alexcrichton/cargo/docopt, r=wycats
bors [Mon, 28 Jul 2014 20:39:24 +0000 (20:39 +0000)]
auto merge of #266 : alexcrichton/cargo/docopt, r=wycats

The hammer library currently has some shortcomings such as the inability to
document individual options. Additionally our handling with hammer of extra
arguments is dodgy at best currently.

This commit moves the repository to BurntSushi's docopt.rs library which seems
to more feature-complete at this time. Additionally, docopt has the great
benefit of a "document once, use everywhere" documentation strategy.

This migration solves two primary issues:

* Comprehensive and useful CLI documentation
* Gracefully handling flavorful combinations of arguments in odd combinations

10 years agoMove from hammer to docopt for option parsing
Alex Crichton [Thu, 24 Jul 2014 19:43:10 +0000 (12:43 -0700)]
Move from hammer to docopt for option parsing

The hammer library currently has some shortcomings such as the inability to
document individual options. Additionally our handling with hammer of extra
arguments is dodgy at best currently.

This commit moves the repository to BurntSushi's docopt.rs library which seems
to more feature-complete at this time. Additionally, docopt has the great
benefit of a "document once, use everywhere" documentation strategy.

This migration solves two primary issues:

* Comprehensive and useful CLI documentation
* Gracefully handling flavorful combinations of arguments in odd combinations

Closes #218

10 years agoauto merge of #268 : alexcrichton/cargo/issue-267, r=wycats
bors [Mon, 28 Jul 2014 18:50:40 +0000 (18:50 +0000)]
auto merge of #268 : alexcrichton/cargo/issue-267, r=wycats

Previously a pipe was made which could mess with stdin like in #267.

Closes #267

10 years agoauto merge of #254 : alexcrichton/cargo/cargo-doc, r=wycats
bors [Mon, 28 Jul 2014 18:20:03 +0000 (18:20 +0000)]
auto merge of #254 : alexcrichton/cargo/cargo-doc, r=wycats

This is blocked until https://github.com/rust-lang/rust/pull/15939 lands, but in the meantime I figured I could get some eyes on this to make sure I'm sane.

Closes #130

10 years agoauto merge of #265 : alexcrichton/cargo/issue-261, r=wycats
bors [Mon, 28 Jul 2014 17:54:13 +0000 (17:54 +0000)]
auto merge of #265 : alexcrichton/cargo/issue-261, r=wycats

Receiving a signal is normally indicative of violent termination, so the
subcommand can't be relied upon to have printed some status information. As a
result, signals now have some extra errors printed to stderr when they fail.

Closes #261. The actual signal is still a bug, but it's an upstream rust bug.

10 years agoauto merge of #276 : alexcrichton/cargo/fix-exe, r=carllerche
bors [Mon, 28 Jul 2014 17:39:38 +0000 (17:39 +0000)]
auto merge of #276 : alexcrichton/cargo/fix-exe, r=carllerche

There was a bug when this was written in rustc that prevented this, but it has
since been fixed.

10 years agoCorrectly discover exe suffix through rustc
Alex Crichton [Mon, 28 Jul 2014 17:32:14 +0000 (10:32 -0700)]
Correctly discover exe suffix through rustc

There was a bug when this was written in rustc that prevented this, but it has
since been fixed.

10 years agoAdd a cargo-doc command
Alex Crichton [Tue, 22 Jul 2014 15:06:36 +0000 (08:06 -0700)]
Add a cargo-doc command

10 years agoauto merge of #256 : alexcrichton/cargo/bootstrap, r=wycats
bors [Sat, 26 Jul 2014 04:21:30 +0000 (04:21 +0000)]
auto merge of #256 : alexcrichton/cargo/bootstrap, r=wycats

This is extracted from #234 for sanity.

Cargo will inevitably pick up more dependencies over time such as flate compression, tarfile management, an external liburl, etc. These dependencies quickly get out of hand when using submodules, and it's much easier to rely on cargo to just build all these projects.

This is strategy is not guaranteed to work 100% of the time as rust's bootstrapping strategy does. The version of rust being used for a snapshot is not locked down, and a snapshot is not necessarily compatible with all versions of rust. In the worse case scenario we can either create a wrapper `rustc` to be compatible with the last snapshot, or we can have an escape hatch to build everything with Makefiles manually.

This transition seems inevitable, however, and it seems prudent to get the process underway sooner rather than later to smooth out the kinks.

10 years agoBootstrap cargo with cargo
Alex Crichton [Wed, 16 Jul 2014 00:51:49 +0000 (17:51 -0700)]
Bootstrap cargo with cargo

10 years agoInherit stdin when using `cargo run`
Alex Crichton [Sat, 26 Jul 2014 04:10:43 +0000 (21:10 -0700)]
Inherit stdin when using `cargo run`

Previously a pipe was made which could mess with stdin like in #267.

Closes #267

10 years agoPrint a message when a command receives a signal
Alex Crichton [Fri, 25 Jul 2014 22:38:06 +0000 (15:38 -0700)]
Print a message when a command receives a signal

Receiving a signal is normally indicative of violent termination, so the
subcommand can't be relied upon to have printed some status information. As a
result, signals now have some extra errors printed to stderr when they fail.

Closes #261. The actual signal is still a bug, but it's an upstream rust bug.

10 years agoauto merge of #263 : rust-lang/cargo/transitive-deps-unfiltered, r=wycats
bors [Fri, 25 Jul 2014 20:42:14 +0000 (20:42 +0000)]
auto merge of #263 : rust-lang/cargo/transitive-deps-unfiltered, r=wycats

10 years agoPass in initialized Source types into compile op
Carl Lerche [Fri, 25 Jul 2014 18:35:11 +0000 (11:35 -0700)]
Pass in initialized Source types into compile op

10 years agoauto merge of #260 : alexcrichton/cargo/issue-229, r=wycats
bors [Fri, 25 Jul 2014 02:37:57 +0000 (02:37 +0000)]
auto merge of #260 : alexcrichton/cargo/issue-229, r=wycats

The fingerprinting code was erroneously using all sources from a manifest when
calculating the fingerprint which meant that sources not yet downloaded were
attempted to be fingerprinted.

The correct source to fingerprint is located in the SourceId field of the
resolved PackageId.

Closes #259

10 years agoBase get_fingerprint on a PackageId
Alex Crichton [Fri, 25 Jul 2014 02:14:18 +0000 (19:14 -0700)]
Base get_fingerprint on a PackageId

The fingerprinting code was erroneously using all sources from a manifest when
calculating the fingerprint which meant that sources not yet downloaded were
attempted to be fingerprinted.

The correct source to fingerprint is located in the SourceId field of the
resolved PackageId.

Closes #259

10 years agoauto merge of #257 : alexcrichton/cargo/ld-lib-path, r=wycats
bors [Thu, 24 Jul 2014 19:44:41 +0000 (19:44 +0000)]
auto merge of #257 : alexcrichton/cargo/ld-lib-path, r=wycats

At runtime rustc will dlopen() plugins, and if plugins have dynamic dependencies
they're likely to be in target/deps, so we need to make sure that directory is
in the right search path.

10 years agoEnsure LD_LIBRARY_PATH is correct for plugins
Alex Crichton [Thu, 24 Jul 2014 19:30:47 +0000 (12:30 -0700)]
Ensure LD_LIBRARY_PATH is correct for plugins

At runtime rustc will dlopen() plugins, and if plugins have dynamic dependencies
they're likely to be in target/deps, so we need to make sure that directory is
in the right search path.

10 years agoauto merge of #253 : jdeseno/cargo/find-root-manifest, r=alexcrichton
bors [Thu, 24 Jul 2014 18:44:40 +0000 (18:44 +0000)]
auto merge of #253 : jdeseno/cargo/find-root-manifest, r=alexcrichton

A few of the sub-commands seem to use the same code for loading the project manifest.

I'd like to get rid of the nested matches but, I can't figure how to use something like `and_then` & `or_else` where the type is promoted (Option -> CargoResult etc.)

10 years agoauto merge of #252 : rust-lang/cargo/pkg-version-env-var, r=wycats
bors [Thu, 24 Jul 2014 06:29:38 +0000 (06:29 +0000)]
auto merge of #252 : rust-lang/cargo/pkg-version-env-var, r=wycats

10 years agoSupply the crate version via ENV vars
Carl Lerche [Thu, 24 Jul 2014 00:57:49 +0000 (17:57 -0700)]
Supply the crate version via ENV vars

10 years agoReplace duplicate code for loading project manifest
Joshua DeSeno [Thu, 24 Jul 2014 01:54:28 +0000 (10:54 +0900)]
Replace duplicate code for loading project manifest

10 years agoauto merge of #251 : alexcrichton/cargo/print-the-failure, r=wycats
bors [Wed, 23 Jul 2014 20:10:26 +0000 (20:10 +0000)]
auto merge of #251 : alexcrichton/cargo/print-the-failure, r=wycats

This previously relied on the test itself printing failure, but this is not
always the case for test which, for example, segfault. Instead this ensures that
*something* is always printed when a test fails, normally a short blurb about
what executable failed to run.

10 years agoEnsure a message is printed on test failure
Alex Crichton [Wed, 23 Jul 2014 19:49:32 +0000 (12:49 -0700)]
Ensure a message is printed on test failure

This previously relied on the test itself printing failure, but this is not
always the case for test which, for example, segfault. Instead this ensures that
*something* is always printed when a test fails, normally a short blurb about
what executable failed to run.

10 years agoAllow omitting part of the output of a process
Alex Crichton [Wed, 23 Jul 2014 19:47:59 +0000 (12:47 -0700)]
Allow omitting part of the output of a process

Sometimes it's a pain to match the *exact* output of a process, so this adds a
placeholder where `[..]` indicates "any more input on this line". It can in
theory be used multiple times in a input string.

10 years agoauto merge of #249 : alexcrichton/cargo/fix-test-twice, r=wycats
bors [Wed, 23 Jul 2014 19:20:15 +0000 (19:20 +0000)]
auto merge of #249 : alexcrichton/cargo/fix-test-twice, r=wycats

These are both related to destroying the build directory and then recreating it.

10 years agoOnly copy over the native output directory once
Alex Crichton [Wed, 23 Jul 2014 16:36:49 +0000 (09:36 -0700)]
Only copy over the native output directory once

Previously it was copying once per target, not once per package.

10 years agoPrint unknown errors with --verbose
Alex Crichton [Wed, 23 Jul 2014 16:35:22 +0000 (09:35 -0700)]
Print unknown errors with --verbose

10 years agoFix `cargo test` with a dylib when run twice
Alex Crichton [Wed, 23 Jul 2014 16:09:33 +0000 (09:09 -0700)]
Fix `cargo test` with a dylib when run twice

The filename of the test for a dylib wasn't being calcuated correctly, so when
freshness was copying data over it ended up copying the same file twice.

10 years agoauto merge of #250 : alexcrichton/cargo/test-deps, r=wycats
bors [Wed, 23 Jul 2014 19:03:33 +0000 (19:03 +0000)]
auto merge of #250 : alexcrichton/cargo/test-deps, r=wycats

* Ensure that binaries are present for integration tests (as well as libraries)
* Ensure that same-named binaries/libs/tests never clash. Examples are excluded for now because they should probably be built to a separate directory.

10 years agoEnsure binaries are present for tests
Alex Crichton [Wed, 23 Jul 2014 18:58:09 +0000 (11:58 -0700)]
Ensure binaries are present for tests

Also make sure that binaries are named appropriately so they don't clash.

10 years agoFix integration tests with same names as libs
Alex Crichton [Wed, 23 Jul 2014 18:44:15 +0000 (11:44 -0700)]
Fix integration tests with same names as libs

Use extra-filename mixins to ensure that these names never clash.

10 years agoFix dependencies during tests
Alex Crichton [Wed, 23 Jul 2014 18:31:47 +0000 (11:31 -0700)]
Fix dependencies during tests

A library target is needed for testing if any examples or integration tests are
being built, similarly with bin targets.

10 years agoDon't pass around Option<&[T]> for libs/bins
Alex Crichton [Wed, 23 Jul 2014 18:27:02 +0000 (11:27 -0700)]
Don't pass around Option<&[T]> for libs/bins

These ended up being Some([]) much of the time which was confusing because it
was being interpreted incorrectly. By passing just slices we know when there's
an element or not.

10 years agoauto merge of #248 : alexcrichton/cargo/issue-225, r=wycats
bors [Wed, 23 Jul 2014 15:53:49 +0000 (15:53 +0000)]
auto merge of #248 : alexcrichton/cargo/issue-225, r=wycats

The current package being built should never be overridden, only its
dependencies.

Closes #225

10 years agoAdd `cargo new` to the `cargo help` message
Alex Crichton [Wed, 23 Jul 2014 15:52:32 +0000 (08:52 -0700)]
Add `cargo new` to the `cargo help` message

10 years agoFilter the current package out of override paths
Alex Crichton [Wed, 23 Jul 2014 15:49:02 +0000 (08:49 -0700)]
Filter the current package out of override paths

The current package being built should never be overridden, only its
dependencies.

Closes #225

10 years agoauto merge of #246 : alexcrichton/cargo/issue-227, r=wycats
bors [Wed, 23 Jul 2014 15:29:36 +0000 (15:29 +0000)]
auto merge of #246 : alexcrichton/cargo/issue-227, r=wycats

Test by @EdShaw!

Closes #227

10 years agoauto merge of #247 : alexcrichton/cargo/extern-myself-please, r=carllerche
bors [Wed, 23 Jul 2014 00:59:40 +0000 (00:59 +0000)]
auto merge of #247 : alexcrichton/cargo/extern-myself-please, r=carllerche

The test and bin executables weren't getting the correct --extern flags when
tested and built, so the names were conflicting. This passes --extern for the
local crate to ensure the right crate is picked up.

10 years agoFix crates with the same name as standard crates
Alex Crichton [Wed, 23 Jul 2014 00:53:38 +0000 (17:53 -0700)]
Fix crates with the same name as standard crates

The test and bin executables weren't getting the correct --extern flags when
tested and built, so the names were conflicting. This passes --extern for the
local crate to ensure the right crate is picked up.

10 years agoauto merge of #240 : alexcrichton/cargo/cargo-new, r=wycats
bors [Tue, 22 Jul 2014 17:44:39 +0000 (17:44 +0000)]
auto merge of #240 : alexcrichton/cargo/cargo-new, r=wycats

This command is used to create a new cargo repository at a destination that
previously does not exist. A separate command, cargo-init, will be implemented
to initialize an already-existing repository.

cc #21

This is currently rebased on #238

10 years agoImplement cargo-new
Alex Crichton [Tue, 22 Jul 2014 05:19:31 +0000 (22:19 -0700)]
Implement cargo-new

This command is used to create a new cargo repository at a destination that
previously does not exist. A separate command, cargo-init, will be implemented
to initialize an already-existing repository.

cc #21

10 years agoDon't rename a directory to a directory
Alex Crichton [Tue, 22 Jul 2014 17:21:27 +0000 (10:21 -0700)]
Don't rename a directory to a directory

Test by @EdShaw!

Closes #227

10 years agoauto merge of #245 : alexcrichton/cargo/fix-fresh, r=wycats
bors [Tue, 22 Jul 2014 17:08:50 +0000 (17:08 +0000)]
auto merge of #245 : alexcrichton/cargo/fix-fresh, r=wycats

This ends up serving the same purpose, but a critical change is that it
canonicalizes the relevant git url (if one is used) to ensure that the same
package from two slightly different locations is always built the same way.

Sadly I'm not quite sure how to add a test for this as it involves using remote
git urls which are unusable during tests.

10 years agoFix travis builds
Alex Crichton [Tue, 22 Jul 2014 15:08:55 +0000 (08:08 -0700)]
Fix travis builds

10 years agoUse a hash for -C metadata instead of a string
Alex Crichton [Tue, 22 Jul 2014 15:33:47 +0000 (08:33 -0700)]
Use a hash for -C metadata instead of a string

This ends up serving the same purpose, but a critical change is that it
canonicalizes the relevant git url (if one is used) to ensure that the same
package from two slightly different locations is always built the same way.

Sadly I'm not quite sure how to add a test for this as it involves using remote
git urls which are unusable during tests.

10 years agoauto merge of #242 : alexcrichton/cargo/issue-111, r=wycats
bors [Tue, 22 Jul 2014 16:42:04 +0000 (16:42 +0000)]
auto merge of #242 : alexcrichton/cargo/issue-111, r=wycats

This was fixed when rustc properly added extra-filename to all temp outputs as
opposed to just libraries.

Closes #111

10 years agoauto merge of #241 : alexcrichton/cargo/fix, r=wycats
bors [Tue, 22 Jul 2014 16:11:07 +0000 (16:11 +0000)]
auto merge of #241 : alexcrichton/cargo/fix, r=wycats

If a build was canceled halfway-through, this would lead to problems when the
project was rebuilt again.

10 years agoauto merge of #238 : alexcrichton/cargo/cstr-builder, r=wycats
bors [Tue, 22 Jul 2014 15:44:51 +0000 (15:44 +0000)]
auto merge of #238 : alexcrichton/cargo/cstr-builder, r=wycats

At the same time, remove a bunch of `path.display().to_string()` and friends.

10 years agoAdd a test for closed issue #111
Alex Crichton [Tue, 22 Jul 2014 14:45:46 +0000 (07:45 -0700)]
Add a test for closed issue #111

This was fixed when rustc properly added extra-filename to all temp outputs as
opposed to just libraries.

Closes #111

10 years agoCorrect a typo in layout preparation
Alex Crichton [Tue, 22 Jul 2014 14:38:01 +0000 (07:38 -0700)]
Correct a typo in layout preparation

If a build was canceled halfway-through, this would lead to problems when the
project was rebuilt again.

10 years agoauto merge of #237 : cburgdorf/cargo/fix_deprecation_warning, r=alexcrichton
bors [Tue, 22 Jul 2014 14:29:43 +0000 (14:29 +0000)]
auto merge of #237 : cburgdorf/cargo/fix_deprecation_warning, r=alexcrichton

10 years agoremove deprecated lexical_ordering() usage
Christoph Burgdorf [Mon, 21 Jul 2014 22:30:54 +0000 (00:30 +0200)]
remove deprecated lexical_ordering() usage

10 years agoauto merge of #235 : rust-lang/cargo/better-test-output, r=alexcrichton
bors [Tue, 22 Jul 2014 05:22:22 +0000 (05:22 +0000)]
auto merge of #235 : rust-lang/cargo/better-test-output, r=alexcrichton

@alexcrichton r?

10 years agoFix windows tests
Alex Crichton [Tue, 22 Jul 2014 05:21:16 +0000 (22:21 -0700)]
Fix windows tests

10 years agoUse Path::display().to_string() less often
Alex Crichton [Tue, 22 Jul 2014 02:33:02 +0000 (19:33 -0700)]
Use Path::display().to_string() less often

Unfortunately this cannot yet have a test for it as rustc itself does not work
if it is run on non-utf8 paths.

10 years agoMove git macros to using `arg()`
Alex Crichton [Tue, 22 Jul 2014 02:18:23 +0000 (19:18 -0700)]
Move git macros to using `arg()`

10 years agoSimplify the ProcessBuilder struct
Alex Crichton [Tue, 22 Jul 2014 02:06:52 +0000 (19:06 -0700)]
Simplify the ProcessBuilder struct

This changes many bounds to ToCStr to stay in line with the since-introduced
Command structure. The builder remains separate of command to have control over
executing and Show.

Path-related methods have been removed and env-initialization/management are
left to Command, ProcessBuilder only keeps track of the delta.

10 years agoauto merge of #236 : cburgdorf/cargo/kill_lifetimes, r=alexcrichton
bors [Mon, 21 Jul 2014 22:29:41 +0000 (22:29 +0000)]
auto merge of #236 : cburgdorf/cargo/kill_lifetimes, r=alexcrichton

This commit removes lifetime annotations
that are now automatically inferred by
the compiler.

10 years agokill unnecessary lifetime annotations
Christoph Burgdorf [Mon, 21 Jul 2014 21:36:08 +0000 (23:36 +0200)]
kill unnecessary lifetime annotations

This commit removes lifetime annotations
that are now automatically inferred by
the compiler.

10 years agoImprove test output
Yehuda Katz [Mon, 21 Jul 2014 19:23:01 +0000 (12:23 -0700)]
Improve test output

10 years agoImprove error message on failed compile
Yehuda Katz [Fri, 18 Jul 2014 11:49:34 +0000 (04:49 -0700)]
Improve error message on failed compile

10 years agoauto merge of #224 : alexcrichton/cargo/canonical-hash, r=wycats
bors [Mon, 21 Jul 2014 16:40:50 +0000 (16:40 +0000)]
auto merge of #224 : alexcrichton/cargo/canonical-hash, r=wycats

This should prevent some weird bugs where if you have slightly different sources that you occasionally have to recompile them when cargo switches between one or the other (thinking they're different)

10 years agoauto merge of #222 : alexcrichton/cargo/no-cargo-toml-in-target, r=wycats
bors [Mon, 21 Jul 2014 15:59:39 +0000 (15:59 +0000)]
auto merge of #222 : alexcrichton/cargo/no-cargo-toml-in-target, r=wycats

When cargo is building itself, it just ends up getting confused because the test
directory is in this location.

10 years agoauto merge of #232 : bkoropoff/cargo/fix-repeated-cargo-test, r=alexcrichton
bors [Mon, 21 Jul 2014 00:57:04 +0000 (00:57 +0000)]
auto merge of #232 : bkoropoff/cargo/fix-repeated-cargo-test, r=alexcrichton

Generate the right target filename for rlibs built in test
mode so that they are correctly moved back out of the old-root
directory.

10 years agoAdd regression test for running `cargo test` twice
Brian Koropoff [Mon, 21 Jul 2014 00:02:09 +0000 (17:02 -0700)]
Add regression test for running `cargo test` twice

10 years agoFix failure on second run of 'cargo test'
Brian Koropoff [Sun, 20 Jul 2014 22:11:41 +0000 (15:11 -0700)]
Fix failure on second run of 'cargo test'

Generate the right target filename for rlibs built in test
mode so that they are correctly moved back out of the old-root
directory.

10 years agoauto merge of #231 : alexcrichton/cargo/burningtree, r=burningtree
bors [Sun, 20 Jul 2014 19:03:41 +0000 (19:03 +0000)]
auto merge of #231 : alexcrichton/cargo/burningtree, r=burningtree

10 years agoFactor the metadata into test filenames
Alex Crichton [Sun, 20 Jul 2014 19:00:01 +0000 (12:00 -0700)]
Factor the metadata into test filenames

Closes #221
Closes #226

10 years agofix deprecated usage
Steve Klabnik [Fri, 18 Jul 2014 15:25:15 +0000 (11:25 -0400)]
fix deprecated usage

10 years agoDon't look inside target/ for sub-packages
Alex Crichton [Fri, 18 Jul 2014 15:29:40 +0000 (08:29 -0700)]
Don't look inside target/ for sub-packages

When cargo is building itself, it just ends up getting confused because the test
directory is in this location.

10 years agoCanonicalize URLs when hashing sources
Alex Crichton [Sat, 19 Jul 2014 05:38:30 +0000 (22:38 -0700)]
Canonicalize URLs when hashing sources

10 years agoauto merge of #216 : alexcrichton/cargo/issue-205, r=wycats
bors [Sat, 19 Jul 2014 01:08:05 +0000 (01:08 +0000)]
auto merge of #216 : alexcrichton/cargo/issue-205, r=wycats

As discovered in #205, cargo wasn't properly ensuring a fresh build state for new builds. As commented in #205, this is an easy way to have a non deterministic build which is one of cargo's major goals to avoid. These commits rectify the situation.

All build output is now "obliterated" by moving to a location unknown to the compiler as soon as a build starts. All fresh output is moved back into place automatically, and all dirty output will only have known artifacts available to it.

The major consequence of this strategy is that the location of the output of the `build` command must also change. Instead of spraying into a shared directory, build commands are now contained to their own build directory which is entirely removed on rebuild or entirely preserved on a fresh build. There's more documentation in the new `layout.rs` about the build directory structure.

In general this should not have much impact as a user-facing change.

10 years agoHouse all native build output in a per-package dir
Alex Crichton [Fri, 18 Jul 2014 03:50:16 +0000 (20:50 -0700)]
House all native build output in a per-package dir

In order to ensure there are no stale artifacts as part of a build, this commit
houses all output of native build commands in their own directories. Each
directory is on a per-package basis, and the output is preserved if the package
is fresh or discarded if it is not.

This does not remove the DEPS_DIR environment variable, it just wires it to the
same value as OUT_DIR.

10 years agoBlow away all directories/files on each build
Alex Crichton [Fri, 18 Jul 2014 02:53:47 +0000 (19:53 -0700)]
Blow away all directories/files on each build

And aftewards selectively move them back into place if they're fresh. This
prevents stale files from showing up from old builds.

This currently breaks anyone build `build=` scripts, the fix is coming in the
next commit.

Closes #205

10 years agoauto merge of #220 : erickt/cargo/master, r=alexcrichton
bors [Fri, 18 Jul 2014 15:32:10 +0000 (15:32 +0000)]
auto merge of #220 : erickt/cargo/master, r=alexcrichton

Please don't land this until https://github.com/wycats/hammer.rs/pull/12 is landed, or else it will break the build.

10 years agoauto merge of #217 : gchp/cargo/docs, r=alexcrichton
bors [Fri, 18 Jul 2014 15:07:19 +0000 (15:07 +0000)]
auto merge of #217 : gchp/cargo/docs, r=alexcrichton

There were inconsistencies in the manifest file between using `[[bin]]` and `[[executable]]`. I've changed the examples to use `[[bin]]` for consistency.

10 years agoUpdate hammer to fix `cargo build -h`.
Erick Tryzelaar [Fri, 18 Jul 2014 14:59:13 +0000 (07:59 -0700)]
Update hammer to fix `cargo build -h`.

10 years agoauto merge of #212 : fhahn/cargo/version, r=alexcrichton
bors [Fri, 18 Jul 2014 14:53:17 +0000 (14:53 +0000)]
auto merge of #212 : fhahn/cargo/version, r=alexcrichton

This PR adds a rustc style version command

10 years agoauto merge of #219 : alexcrichton/cargo/update-to-mater, r=burningtree
bors [Fri, 18 Jul 2014 14:41:19 +0000 (14:41 +0000)]
auto merge of #219 : alexcrichton/cargo/update-to-mater, r=burningtree

10 years agoUpdate to master
Alex Crichton [Fri, 18 Jul 2014 14:40:15 +0000 (07:40 -0700)]
Update to master

10 years agoAdd version command, closes #201
Florian Hahn [Thu, 17 Jul 2014 20:00:58 +0000 (22:00 +0200)]
Add version command, closes #201

10 years agoUse [[bin]] instead of [[executable]] in manifest examples
Greg Chapple [Fri, 18 Jul 2014 11:53:48 +0000 (12:53 +0100)]
Use [[bin]] instead of [[executable]] in manifest examples

10 years agoauto merge of #213 : fhahn/cargo/fix-warnings-2, r=alexcrichton
bors [Thu, 17 Jul 2014 20:59:42 +0000 (20:59 +0000)]
auto merge of #213 : fhahn/cargo/fix-warnings-2, r=alexcrichton

This patch replaces `get()` calls with indexing for vectors and `str::from_utf8_lossy` with `String::from_ut8_lossy` to silence recent rustc warnings

10 years agoUse indexing instead of get() function to access Vec
Florian Hahn [Thu, 17 Jul 2014 20:20:13 +0000 (22:20 +0200)]
Use indexing instead of get() function to access Vec

10 years agoauto merge of #208 : alexcrichton/cargo/fix-main-name, r=wycats
bors [Thu, 17 Jul 2014 19:44:40 +0000 (19:44 +0000)]
auto merge of #208 : alexcrichton/cargo/fix-main-name, r=wycats

The crate name should be the package name, not `main`.

Closes #207