Commit graph

30 commits

Author SHA1 Message Date
Jethro Beekman 53cc3ce81d Tests: fix grammar and extra semicolon 2016-04-19 11:59:55 -07:00
Alex Crichton bc8e3322c5 Make a test a bit more robust to the environment
Don't filter out PATH as `rustc` may be in that directory (e.g. when using
rustup) and otherwise just have a longer subcommand.

Closes #2553
2016-04-08 13:31:16 -07:00
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 1a1d8f8c19 Fix output matching in tests
Right now we only match a suffix of the line, assuming all lines start with
`[..]`. Instead this ensures that the first match is anchored at the start.
2016-03-03 10:19:56 -08:00
Alex Crichton 26a5eeffa9 Consolidate creating processes in tests
Each test wants to be sure to reset HOME and remove CARGO_HOME from the
environment, but this was done inconsistently throughout the test suite. This
commit consolidates process creation so there's only one point for creating a
process ready to execute the Cargo that's being tested.
2015-12-17 10:06:28 -08:00
Alex Crichton 20b768e6ba Probe $CARGO_HOME/bin for subcommands by default
Don't require PATH modifications for new cargo subcommands by looking
specifically in $CARGO_HOME/bin for installed commands.

Closes #2189
2015-12-04 10:24:48 -08:00
Marvin Löbel c6607054f7 Fixed testsuite 2015-10-28 12:15:37 +01:00
Alex Crichton 2ff5f53b98 Re-fix the help command's implementation
This was accidentally broken in a recent refactoring.

Closes #1421
2015-03-16 06:32:50 -07:00
Alex Crichton a6dad62221 Update to rust master and std::{io, path} 2015-02-27 15:34:13 -08:00
Andrew Paseltiner 1384050eea update Rust 2015-02-12 23:10:25 -05:00
Alex Crichton ee5e24ff8b Update to rust master 2015-02-06 15:10:05 -08:00
Gabriel Souza Franco af45e08862 std::io → std::old_io 2015-01-30 16:03:53 -02:00
Alex Crichton 5d0cb3f2e9 Overhaul how Config is passed around
This commit started out by moving the hash map of configuration values into
`Config` and then removing all calls to config::all_configs in favor of taking a
`&Config` argument. This initial step was taken to prevent reloading
configuration many times from disk, but it also provides a nice house for
configuration to be loaded from.

The commit snowballed into purging `MultiShell` as an argument all over the
place and passing around `Config` instead. Along the way a few other breaking
changes were made:

* The `config_for_key` and `config_list` subcommands have been removed. These
  commands are not ready to be stabilized and need some more work. In general
  the `cargo config` system needs to be cleaned out and built back up with a new
  interface, at which point these subcommands can return.
* The old and deprecated behavior of `cargo update foo` has been removed.
2015-01-16 08:45:07 -08:00
bors cff6aadb5e Auto merge of #1148 - FlaPer87:change-home, r=alexcrichton
Users changing cargo's home directory expect it to be used as top path
instead of there being a `.cargo` hidden dir in it. There are some cases
following this pattern one of them is python's virtualenvwrapper, which
uses `WORK_HOME` as a home dir for everything.

This patch removes the extra `.cargo` and assumes that CARGO_HOME is the
real path a user wants to use as a homedir for cargo.
2015-01-11 05:18:59 +00:00
Flavio Percoco bef8095b26 Don't use .cargo for custom CARGO_HOME
Users changing cargo's home directory expect it to be used as top path
instead of there being a `.cargo` hidden dir in it. There are some cases
following this pattern one of them is python's virtualenvwrapper, which
uses `WORK_HOME` as a home dir for everything.

This patch removes the extra `.cargo` and assumes that CARGO_HOME is the
real path a user wants to use as a homedir for cargo.
2015-01-11 00:44:12 +01:00
Alex Crichton ba2800478d Update to rust master 2015-01-05 11:17:01 -08:00
Alex Crichton 9ed3a6ea1d Clean up Cargo's util::errors module
This commit cleans up cargo's error module to reduce the duplication of
`CargoError` and the standard library's `Error` trait. The `CargoError` trait
remains, but only has one methods, `is_human`.

A number of other modifications were made:

* ChainError was altered to work over unboxed closures
* Wrap and Require were removed as they're duplicates of the ChainError
  functionality.
* Many public error types are now private from util::errors as they're only
  returned as boxed trait objects.
* The `concrete` was removed, all calls to `make_human` are now done through a
  newtype `Human` wrapper.
* Cargo's custom `try!` macro was removed.
2014-12-29 18:59:15 -08:00
Brian Anderson 2badab8c83 Allow the location of ~/.cargo to be overridden via CARGO_HOME env var.
I intend to use this to allow many copies of the Rust toolchain to coexist.
2014-12-22 19:54:41 -08:00
Alex Crichton 157d639afc Update rust and all deps 2014-12-19 20:55:17 -08:00
Jakub Bukaj df9cf06663 Update to newest Rust 2014-11-23 17:02:45 -05:00
Ian Connolly 21e94a4608 Missed backtick fix 2014-11-14 09:57:01 +00:00
Paul Woolcock 12f5de8e9b Add 'did you mean...' message when a subcommand is not found. 2014-11-06 09:23:44 -05:00
Joshua DeSeno db134e958e Fix warnings for constant names 2014-10-07 09:25:05 +09:00
Alex Crichton dfae53c406 Fix some more deprecation warnings 2014-09-17 08:27:41 -07:00
Alex Crichton a09ad635cc Update to rust master 2014-09-15 08:31:21 -07:00
Alex Crichton f3cb4232d8 Slim down the cargo --list test
This test has been flaky on the bots for quite some time now, and the cause has
now been discovered. The root cause of the failure is that the execve for the
`cargo --list` command was failing with ETXTBUSY. In querying the manpage, this
means:

    Executable was open for writing by one or more processes.

This error can be explained by the following trace:

1. Thread A, running the `cargo --list` test, opens the destination executable
   for writing because it's copying the current executable into a different
   location.
2. Thread B, some other test, forks the process. The file descriptor of the
   destination executable of thread A is now duplicated in this process.
3. Thread A closes all files and such, and then goes to fork/exec
   `cargo --list`.
4. Thread B has not had time to close all its descriptors. so it still has the
   executable open for writing, causing the `execve` of thread A to fail.

This commit just removes these tested portions of the test, only testing that
cargo probes PATH.
2014-09-02 11:49:36 -07:00
Alex Crichton 8cce8996be Remove all subcommand executables
This commit removes all distributed executables except for `cargo`. All
builtin subcommands are implemented through library calls, and the fallback
methods are retained to maintain extensability through new subcommands.

Closes #393
2014-08-26 18:25:28 -07:00
Alex Crichton fff5de375a Make a timing test a little less flaky 2014-08-18 23:47:57 -07:00
Alex Crichton db3823a83f Fix the --list tests for windows 2014-08-11 21:22:29 -07:00
xanxys a3f6a404be Add "--list" option to cargo, that shows lists of installed (sub)commands by searching
directories for executables with name cargo-*.
2014-08-09 14:37:50 +09:00