Commit graph

2375 commits

Author SHA1 Message Date
Dale Wijnand d0679c7f8e
Specify crates.io is the default registry & print index 2018-09-08 09:25:41 +01:00
Alex Crichton 51be74244b fix: Fix unusual errors with RUSTC_WRAPPER
This commit fixes the interaction of `cargo fix` and `RUSTC_WRAPPER`, ensuring
that Cargo at least doesn't die internally. For now `RUSTC_WRAPPER` is
overridden for normal execution but we can eventually one day probably support
`RUSTC_WRAPPER`!

Closes #5981
2018-09-05 15:18:40 -07:00
Eric Huss e29aacca86 Add a way to skip the use_the_cli test for rust repo. 2018-09-04 14:01:49 -07:00
Tobias Bucher 54159e84ce Fix a doc link 2018-09-04 10:36:50 +02:00
Matthias Krüger 2cd9cce6e3 clippy: resolve all warnings about useless format!() 2018-09-03 11:38:29 +02:00
Jorge Aparicio 942e3672a6 fix unit test 2018-09-01 18:16:49 +02:00
Jorge Aparicio e53d31ed91 fix test source 2018-09-01 18:12:22 +02:00
Jorge Aparicio e620865633 make cargo install ignore .cargo/config
closes #5850
2018-09-01 18:12:22 +02:00
bors aecaef3e23 Auto merge of #5944 - dwijnand:fix-force-rebuild, r=alexcrichton
Force `cargo fix` to rebuild

Fixes #5736

This is a resubmit of @killercup's #5750, rebased on current master.

@alexcrichton From browsing the code I feel like `-p` would still restrict the packages to rebuild, despite the rebuild flag added. But I might be misreading or not-fully-reading the code. Could you give me some mentoring instructions for the test cases you're concerned with?
2018-08-31 22:43:25 +00:00
bors e954520156 Auto merge of #5952 - dwijnand:fix-path-deep_dependencies_trigger_rebuild, r=alexcrichton
Fix path::deep_dependencies_trigger_rebuild often failing in CI

A shallow fix for `path::deep_dependencies_trigger_rebuild` in particular as it's failed my PRs often.

See https://github.com/rust-lang/cargo/pull/5935#issuecomment-417148372, and #5940 for the bigger picture.
2018-08-30 18:47:24 +00:00
bors 9ab347d220 Auto merge of #5950 - dwijnand:cwd, r=alexcrichton
Introduce the CWD macro in test output asserting

Avoids dealing with things like CWD changing.

Mentioned in #5742
2018-08-30 09:47:09 +00:00
Dale Wijnand d5fc8dc3a7
Introduce the CWD macro in test output asserting
Avoids dealing with things like CWD changing.
2018-08-30 11:05:29 +02:00
Dale Wijnand 274c162b2a
Fix path::deep_dependencies_trigger_rebuild often failing in CI 2018-08-30 07:31:51 +02:00
Dale Wijnand 7a42790a7c
Assert fix::doesnt_rebuild_dependencies stderr fully
Gives more confidence.
2018-08-30 07:28:20 +02:00
Dale Wijnand b98ba8e289
Test that cargo fix doesn't aggressively rebuild 2018-08-29 21:24:16 +02:00
bors 8b2082ba50 Auto merge of #5943 - dwijnand:fix-allow-staged, r=alexcrichton
Add `--allow-staged` to `cargo fix`

Fixes #5737

This is @jljusten's branch, adapted to the testsuite changes in master.
Submitted as an alternative to #5910 to expedite #5737 resolution in time for Edition RC 1.
2018-08-29 17:08:25 +00:00
Dale Wijnand a88a6377db
Actually delete the hamcrest module.. 2018-08-29 17:09:39 +02:00
Dale Wijnand 3495e96168
Remove further references to hamcrest in the docs 2018-08-29 17:08:42 +02:00
Dale Wijnand 3b25ab3cb3
Replace some assert_that usage in doc comments 2018-08-29 10:26:12 +02:00
Dale Wijnand 473babc5dd
Move MatchResult from hamcrest to testsuite/support 2018-08-29 10:26:12 +02:00
Dale Wijnand 01dccf1d26
Remove hamcrest Matcher 2018-08-29 10:26:12 +02:00
Dale Wijnand f009dc4e1b
Remove hamcrest has_installed_exe & is_not 2018-08-29 10:26:12 +02:00
Dale Wijnand 570fe8927d
Remove hamcrest existing_file() 2018-08-29 10:26:12 +02:00
Dale Wijnand 6fd1b54c65
Remove hamcrest existing_dir() 2018-08-29 07:53:01 +02:00
Dale Wijnand a5de2c0ce7
Remove hamcrest contains() 2018-08-29 07:42:03 +02:00
Dale Wijnand 63b34b6498
Revert back to some .exec_with_output() usage
Avoids difference in indentations across different PATHs.
2018-08-29 02:04:32 +02:00
Pascal Hertleif 616e0ad3bf
Always rebuild targets when using cargo-fix 2018-08-29 01:57:52 +02:00
Dale Wijnand 8c2d0dffa4
Merge branch 'master' into fix-allow-staged
* master: (25 commits)
  Migrate from tests fom assert_that/execs to .run()
  Wrap ProcessBuilder in Execs & make .cargo return that
  Make old Execs methods take not consume self
  Extract Execs::match_process
  Add #[must_use] to Execs
  Inline Execs::_with_stderr
  Remove an unrun "cargo build" ProcessBuilder
  Add documentation for creating test dependencies.
  Only use non-absolute paths for `path` dependencies
  Fix test failure on nightly due to `codemap::Span` change.
  New metabuild strategy using custom src_path enum.
  Remove unnecessary change.
  Address review comments.
  Metabuild (RFC 2196)
  Handle Window's missing file error message
  Make "cargo uninstall" uninstall the cwd bins
  update comment based on further research
  List URL in HTTP download failures
  Fix compilation error
  Improve the `cargo install` deprecation messaging
  ...
2018-08-29 01:20:18 +02:00
Dale Wijnand e509118f4d
Enable Drop for Execs 2018-08-29 00:46:14 +02:00
Dale Wijnand b611750a7a
Allow .build_command() to set Execs to ran 2018-08-29 00:45:19 +02:00
Dale Wijnand f16b95e492
Make last two .exec_with_output() usages set Execs to ran 2018-08-29 00:45:19 +02:00
Dale Wijnand a173fc0abe
Replace .exec_with_output() usage with .with_stdout_contains 2018-08-29 00:45:19 +02:00
Dale Wijnand 66262110a2
Replace .exec_with_output() usage with .run() 2018-08-29 00:45:18 +02:00
Dale Wijnand 21ee66ecab
Remove a dead comment in testsuite/support/mod.rs 2018-08-28 23:50:03 +02:00
Dale Wijnand b63e0e63d5
Replace Output hamcrest matchers for Execs 2018-08-28 23:24:10 +02:00
Dale Wijnand 21d9c4ae89
Replace some bare ProcessBuilder usage with Execs 2018-08-28 23:05:39 +02:00
Dale Wijnand 2554afe764
Make Project::process return Execs 2018-08-28 22:38:26 +02:00
Dale Wijnand 85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
Dale Wijnand b5ee3635ef
Wrap ProcessBuilder in Execs & make .cargo return that 2018-08-28 09:24:37 +01:00
Dale Wijnand 76e840bb45
Make old Execs methods take not consume self 2018-08-28 09:15:25 +01:00
Dale Wijnand e8841eeceb
Extract Execs::match_process 2018-08-28 09:15:25 +01:00
Dale Wijnand dd0400ec75
Add #[must_use] to Execs 2018-08-28 09:15:25 +01:00
Dale Wijnand e9bfe8fa04
Inline Execs::_with_stderr 2018-08-28 08:28:09 +01:00
Dale Wijnand 035b5b9d5a
Remove an unrun "cargo build" ProcessBuilder 2018-08-28 08:27:59 +01:00
Eric Huss d970d05f06 Add documentation for creating test dependencies.
Using `Package` has always been a little unclear to me. I think I understand
it now. Maybe this will help.
2018-08-24 15:09:38 -07:00
Alex Crichton 6e57be5160 Only use non-absolute paths for path dependencies
Previously Cargo would use a non-absolute path for any dependency contained
within the workspace root but this switches Cargo to only using relative paths
for `path` dependencies. In practice this shouldn't make much difference, but
for vendored crates and moving around `CARGO_HOME` it can produce more
consistent results when target directories are shared.

Closes #5923
2018-08-24 11:02:13 -07:00
bors 90fc9f6201 Auto merge of #5628 - ehuss:metabuild, r=alexcrichton
Metabuild (RFC 2196)
2018-08-24 17:14:10 +00:00
Eric Huss 91a33a0e84 Fix test failure on nightly due to codemap::Span change.
Update due to rust-lang/rust#52953.
2018-08-23 23:56:50 -07:00
Eric Huss ecc87b1795 New metabuild strategy using custom src_path enum.
- Use new enum `TargertSourcePath` for Target::src_path to make it explicit that metabuild has a special path.
- `cargo metadata` now skips the metabuild Target.
- JSON artifacts include the true path to the metabuild source file. This may not be the best solution, but it's unclear what it should be, and I would prefer to avoid breaking the output. Alternatively it could just not emit anything? I'm not completely familiar with the use case of these artifact messages.
- Place the file in `target/.metabuild/metabuild-pkgname-HASH.rs` instead of in the debug/release directory.  Its contents do not depend on the profile.
- Fix bug in write_if_changed.
- More tests.
2018-08-23 23:01:30 -07:00
Eric Huss 2be857af59 Metabuild (RFC 2196) 2018-08-23 13:31:50 -07:00