Commit graph

14 commits

Author SHA1 Message Date
Stephen Becker IV 1c439875e2 Remove color from the errors
I updated the error states to use say_status.
Add text to the empty error
The empty error looked odd with the say_status change.
Update all stderr messages
Switch them to format statements and create a helper for the error
status.
2016-03-12 11:37:59 -08:00
Alex Crichton 09847df8d3 Fix all tests with recent changes
The package id for path dependencies now has another path component pointing
precisely to the package being compiled, so lots of tests need their output
matches to get updated.
2016-03-03 13:35:46 -08:00
Alex Crichton 7dcedd85a4 Handle rerun-if-changed directives in dependencies
There was a failure mode of the handling of the rerun-if-changed directive where
it would rerun the build script twice before hitting a steady state of actually
processing the directives. The order of events that led to this were:

1. A project was built from a clean directory. Cargo recorded a fingerprint
   indicating this (for the build script), but the fingerprint indicated that
   the build script was a normal build script (no manually specified inputs)
   because Cargo had no prior knowledge.
2. A project was then rebuilt from the same directory. Cargo's new fingerprint
   for the build script now indicates that there is a custom list of
   dependencies, but the previous fingerprint indicates there wasn't, so the
   mismatch causes another rebuild.
3. All future rebuilds will agree that there are custom lists both before and
   after, so the directives are processed as one would expect.

This commit does a bit of refactoring in the fingerprint module to fix this
situation. The recorded fingerprint in step (1) is now recorded as a "custom
dependencies are specified" fingerprint if, after the build script is run,
custom dependencies were specified.

Closes #2267
2016-01-12 17:44:18 -08:00
Alex Crichton 71ff274341 Allow specifying profiles to cargo rustc
This should allow compiling the specified target in the various profiles that
are available to it, e.g. bench or test in addition to the standard
dev.

Closes #2120
2015-12-17 10:12:41 -08:00
Florian Hahn f0647ea26f Add support for multiple -p options to cargo update
closes #1528
2015-09-30 21:42:21 +02:00
Florian Hahn 9d301d6e9e Use docopt's new syntax for repeatable options 2015-09-30 21:30:53 +02:00
Sondre Lefsaker 2cd3c86276 Suggest adding flags to filter the package in the error message 2015-05-06 12:08:43 +02:00
Sondre Lefsaker c867813646 Add more tests:
- `build_with_args_to_one_of_multiple_binaries`, verify that only one bin gets built
- `fails_with_args_to_all_binaries`
- `build_with_args_to_one_of_multiple_tests`, same behavious as for the binaries
- `build_foo_with_bar_dependency`, verify that bar dependency gets built and only foo gets compiled with args
- `build_only_bar_dependency`, build the bar package, that foo depends, on with the extra args
2015-05-03 01:16:20 +02:00
Sondre Lefsaker bd4d15fe1e Cleanup tests - favor more explicit expected result instead of using helper functions 2015-05-03 00:49:58 +02:00
Sondre Lefsaker d8cd6f060b Modify test to build main like before, but lib also gets built as a dependency.
- The test verifies that the trailing arguments only gets passed to the binary being built
2015-05-02 18:18:05 +02:00
Sondre Lefsaker 582e9d94a8 Remove the arguments from BuildConfig and append them to the profile that's being compiled instead.
- An error will be returned if the length of `targets` is not 1
- The profile of `targets` gets cloned in order to append the extra arguments.
- The new test verifies that the build fails due to both `lib` and `main` being compiled
2015-05-02 17:43:11 +02:00
Sondre Lefsaker 512b217b0b Remove the pkgid arg and replace the profile flag with package. 2015-05-02 12:19:55 +02:00
Sondre Lefsaker b177d2ab56 Pass the arg_opts from the command line further on to the CompileOptions.
- The new tests verifies that the extra arguments gets appended to the command. One is for lib and one is for main
- Currently the arguments gets passed on to *every* target that gets built, so the tests only contain one file each
2015-05-02 01:21:10 +02:00
Sondre Lefsaker 754938ffb8 Add new subcommand rustc.
- `cargo rustc` is starting out based on `cargo build`
2015-05-01 23:19:43 +02:00