Commit graph

3341 commits

Author SHA1 Message Date
Takayuki Nakata 5e152863f4 Load credentials and add tests for yank and owner commands 2020-01-09 22:22:32 +09:00
bors 6dd57b2045 Auto merge of #7779 - ehuss:fix-cargo-lock-ignore, r=alexcrichton
Fix .gitignore of Cargo.lock in a subdirectory.

The code for checking if `Cargo.lock` is ignored was erroneously assuming it was at the root of the git repo.  This would cause a problem if `Cargo.lock` is in `.gitignore` in a subdirectory.

Fixes issue noted in https://github.com/rust-lang/cargo/issues/7705#issuecomment-572027382
2020-01-08 22:28:54 +00:00
Eric Huss 3cedb8e33c Fix .gitignore of Cargo.lock in a subdirectory. 2020-01-08 10:40:17 -08:00
Alex Crichton 3a18c89a55 Migrate from the failure crate to anyhow
The `anyhow` crate interoperates with the `std::error::Error` trait
rather than a custom `Fail` trait, and this is the general trend of
error handling in Rust as well.

Note that this is mostly mechanical (sed) and intended to get the test
suite passing. As usual there's still more idiomatic cleanup that can
happen, but that's left to later commits.
2020-01-07 16:50:09 -08:00
Takayuki Nakata 4b70f14903 Load credentials only when needed
Credentials are always loaded, even if these are not used. If
access to confidential files such as credentials is not given,
`cargo build` fails despite not using credentials.

Fixes #7624.
2020-01-07 23:40:58 +09:00
bors 5cca88f0c6 Auto merge of #7763 - ehuss:fix-target-cfg-env, r=alexcrichton
Fix CARGO_TARGET_triple_LINKER environment variable.

#7649 caused an unfortunate regression where the `CARGO_TARGET_triple_LINKER` environment variable stopped working. I did not realize `serde(flatten)` caused serde to switch to `deserialize_map` which does not support environment variables.

The solution here is to essentially revert back to how the `[target]` table used to be loaded by loading each key individually.

This also removes the `ar` field which is not used by `rustc`.
2020-01-06 17:18:52 +00:00
bors 1081bc7e66 Auto merge of #7756 - ehuss:dep-kinds-dedup, r=alexcrichton
Remove metadata dep_kinds duplicates.

In `cargo metadata`, an entry could appear multiple times in the `dep_kinds` array if it is used by multiple workspace members with different features activated.  This fixes it by de-duplicating the entries.

This is kinda related to `cargo metadata` not handling workspaces and features very well. But workspaces and features are a bit awkward overall.

Fixes #7752
2020-01-06 16:25:33 +00:00
bors 801942b74a Auto merge of #7751 - ehuss:multiple-source-definition, r=alexcrichton
Check for a source defined multiple times.

There is a bug where if a source is defined in multiple `[source]` tables, it causes a key collision in `SourceConfigMap::id2name`.  This can result in random behavior depending on which key is inserted first.

I decided to just make it an error.  I can't think of a way to make it work since the `replace-with` chain walking depends on unique sourceid->name mappings.  If anyone has ideas how to support it, I can try, but I don't immediately see how.

Closes #7692
2020-01-06 16:00:45 +00:00
bors f7c5b1f839 Auto merge of #7748 - ehuss:fix-config-env-var-prefix, r=alexcrichton
Fix config env vars that are prefix of another with underscore.

This fixes the CARGO_BUILD_TARGET_DIR and CARGO_PROFILE_DEV_DEBUG_ASSERTIONS environment variables.  Hopefully the big comment explains everything, but to review:

`deserialize_option` does not know the type of the value it is about to deserialize.  The type could be a struct, in which case it needs to check if `CARGO_FOO_BAR_*` environment variables are set. However, when deserializing something like `build.target`, this prefix check will incorrectly match `CARGO_BUILD_TARGET_DIR` which happens to be a prefix of `CARGO_BUILD_TARGET_*`.  It attempts to call `visit_some` which fails if `CARGO_BUILD_TARGET` is not set.

The solution here is to detect scenarios where one field is a prefix of another, and skip the environment prefix check (by setting `Deserializer::env_prefix_ok` appropriately).  This means we cannot have `Option<SomeStruct>` be a prefix of another field with an underscore.  I think that's fine, and we should try to probably avoid these kinds a prefixes anyways.

Closes #7253.
2020-01-06 15:20:09 +00:00
Eric Huss 35b924db5a Fix CARGO_TARGET_triple_LINKER environment variable. 2020-01-02 11:50:00 -08:00
Eric Huss 7acf376d78 Remove metadata dep_kinds duplicates. 2019-12-30 10:58:24 -08:00
bors 4111e1a11f Auto merge of #7741 - giraffate:add_test_for_cargo_pkgid, r=ehuss
Add test for `cargo pkgid`

There was no test for `cargo pkgid` command.
2019-12-29 17:42:45 +00:00
Takayuki Nakata a28d9a1e2a Add test for cargo pkgid 2019-12-29 20:42:50 +09:00
Eric Huss 30cc7cebfc Check for a source defined multiple times. 2019-12-28 12:51:56 -08:00
Jonas Platte 2166db8c49
Add a note to the error message for using --feature / --no-default-features in a virtual workspace 2019-12-24 14:46:16 +01:00
Eric Huss 829ddf0dc8 Fix config env vars that are prefix of another with underscore. 2019-12-23 18:13:50 -08:00
bors 86134e7666 Auto merge of #7739 - giraffate:follow_up_d1d083789, r=Eh2406
Correct reference link

Follow up d1d083789.
2019-12-23 16:08:07 +00:00
bors b42bec7f99 Auto merge of #7706 - matthiaskrgr:bump_git, r=Eh2406
bump git2 dependencies

This required some manual code changes which dependabot could not perform.
2019-12-23 15:10:46 +00:00
Takayuki Nakata 22db875b0e Correct reference link
Follow up d1d083789.
2019-12-23 12:00:22 +09:00
Yuki Okushi 0dd60d5df9 Use issue = "none" instead of "0" 2019-12-22 17:21:13 +09:00
Matthias Krüger 8245e02924 bump git2 dependencies 2019-12-19 23:29:41 +01:00
Eric Huss 00a47302dd Fixes for some test errors on Windows. 2019-12-19 09:44:02 -08:00
Eric Huss e7eda2f91f Implement config-include. 2019-12-19 09:44:02 -08:00
Eric Huss 91015d52ce Add --config CLI option. 2019-12-19 09:44:02 -08:00
Eric Huss 2e5796d4e8 Store Definition in ConfigValue. 2019-12-19 09:44:02 -08:00
Eric Huss 6d95721ec5 Add a ConfigBuilder for tests. 2019-12-19 09:44:01 -08:00
Eric Huss 381251aa1f Config refactoring. 2019-12-19 09:44:01 -08:00
bors 4647b1d142 Auto merge of #7718 - ehuss:fix-vendor-alt-reg, r=alexcrichton
vendor: support alt registries

Adds support for alt registries to `cargo vendor`. It mostly worked before, but panicked when trying to display the `.cargo/config` instructions.

This isn't entirely elegant, as the source replacement looks like this:

```toml
[source.crates-io]
replace-with = "vendored-sources"

[source."file:///Users/eric/Proj/rust/cargo/target/cit/t0/alternative-registry"]
registry = "file:///Users/eric/Proj/rust/cargo/target/cit/t0/alternative-registry"
replace-with = "vendored-sources"

[source."file:///Users/eric/Proj/rust/cargo/target/cit/t0/gitdep"]
git = "file:///Users/eric/Proj/rust/cargo/target/cit/t0/gitdep"
branch = "master"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
```

The duplication of the URLs is a little unfortunate.  It could use the name of the registry, but that is not readily available and is tricky to obtain.  I feel like that is a challenge for another day.

Closes #7674.
2019-12-19 09:59:33 +00:00
Eric Huss 723748fabf vendor: support alt registries 2019-12-17 17:44:37 -08:00
Takayuki Nakata ad2969f084 Update the output of cargo -Z help
`--registry` flag is already stabilized at 737382d7e.
2019-12-18 10:28:48 +09:00
bors fc29c9cae1 Auto merge of #7708 - giraffate:fix_overwriting_credentials, r=ehuss
Fix overwriting alternate registry token

When executing `cargo login`, 2nd alternate registry token overwrites
1st alternate registry token.

Fixes #7701.
2019-12-17 22:28:09 +00:00
Takayuki Nakata b7bc069fbb Refactoring of creating registry 2019-12-17 14:12:27 +09:00
Takayuki Nakata 2a4d1dc40a Append registries to config 2019-12-17 09:59:45 +09:00
Takayuki Nakata 75d06de80c Remove unneeded flags 2019-12-17 08:33:48 +09:00
bors ad4122a4c8 Auto merge of #7700 - ehuss:proc-macro-extern-prelude, r=alexcrichton
Add proc_macro to the extern prelude.

This makes it so that a proc-macro library can use the `proc_macro` crate without the `extern crate proc_macro;` item on the 2018 edition.  This is the Cargo half of https://github.com/rust-lang/rust/pull/64882.
2019-12-16 16:29:59 +00:00
bors 414ec709df Auto merge of #7631 - jsgf:explicit-version, r=alexcrichton
vendor: implement --versioned-dirs

Implement `--explicit-version` from standalone cargo-vendor. This helps with vendoring
performance as it avoids redundantly deleting and re-copying already vendored packages.

For example, re-vendoring cargo's dependencies it makes a big difference in wallclock
time. For initial vendoring it makes no difference, but re-vendoring (ie, when most or all dependencies haven't changed) without explicit versions is actually slightly slower
(5.8s -> 6s), but with explicit versions it goes from 5.8s -> 1.6s.

Timings:

Without explicit versions, initial vendor
real	0m5.810s
user	0m0.924s
sys	0m2.491s

Re-vendor:
real	0m6.083s
user	0m0.937s
sys	0m2.654s

With explicit versions, initial vendor:
real	0m5.810s
user	0m0.937s
sys	0m2.461s

Re-vendor:
real	0m1.567s
user	0m0.578s
sys	0m0.967s

Its interesting to look at the syscall summary:

Without explicit versions:
```
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 25.17    1.104699          18     59432      1065 openat
 19.86    0.871574          21     41156     13825 unlink
 13.64    0.598739           2    210510           lstat
  9.02    0.395948          29     13208           copy_file_range
  8.00    0.351242          11     30245           read
  6.36    0.279005           3     72487      4476 statx
  5.35    0.235027           6     37219           write
  4.02    0.176267           3     58368           close
```
with explicit versions:
```
 29.38    0.419068          15     27798     13825 unlink
 25.52    0.364021           1    209586           lstat
 20.67    0.294788          16     17967      1032 openat
 10.42    0.148586           4     35646           write
  3.53    0.050350           3     13825           chmod
  3.14    0.044786           2     16701      1622 statx
  2.19    0.031171           1     16936           close
  1.86    0.026538          24      1078           rmdir
```

Specifically, there are a lot fewer opens, copy_file_ranges, and unlinks.
2019-12-16 15:29:53 +00:00
Takayuki Nakata a718ed61d6 Refactoring 2019-12-14 23:16:45 +09:00
Takayuki Nakata 6cbde6e2bf Fix overwriting alternate registry token
When executing `cargo login`, 2nd alternate registry token overwrites
1st alternate registry token.

Fixes #7701.
2019-12-13 22:42:49 +09:00
Eric Huss 4d64eb99a4 Add proc_macro to the extern prelude. 2019-12-12 16:56:38 -08:00
bors 5694e7cbda Auto merge of #7695 - giraffate:add_and_update_tests_for_jobs_of_cargo_build, r=ehuss
Add and move tests for jobs of `cargo build`

A test when argument is negative is added. In addition, `default_cargo_config_jobs` and `good_cargo_config_jobs` is moved from `testsuite/bad_config.rs` to `testsuite/build.rs` because these tests are not for `bad config`.
2019-12-12 18:39:29 +00:00
bors c8595e8897 Auto merge of #7680 - stefanhoelzl:issue-7183, r=ehuss
include dotfiles in packages

This PR solves #7183

It changes the behavior of `cargo package` to also include dotfiles by default.

It should be discussed if this is intended or if the implementation should be changed to only include dotfiles which are specified in the `include` section.

From the [existing comment](40885dfab4/src/cargo/sources/path.rs (L358)) it is a little bit unclear to me, but I supposed it was intended only to exclude directories starting with a dot?
2019-12-12 18:19:57 +00:00
Eric Huss 1c779ac5d4 Switch build-std to use --extern 2019-12-12 08:18:15 -08:00
Matthias Krüger 34f2d4710b fix a couple of typos 2019-12-11 15:31:26 +01:00
Takayuki Nakata 4956d3e778 Add and move tests for jobs of cargo build
A test when argument is negative is added. In addition,
`default_cargo_config_jobs` and `good_cargo_config_jobs` is moved from
`testsuite/bad_config.rs` to `testsuite/build.rs` because these tests
are not for `bad config`.
2019-12-11 18:01:01 +09:00
Takayuki Nakata ba74297c20 Add a test for cargo locate-project 2019-12-10 09:18:12 +09:00
Stefan Hoelzl 5c5d1718e3 test variant to exclude dot-files/dirs by default 2019-12-08 16:03:17 +01:00
Stefan Hoelzl 7662c2d8bb added dotfile to include test
got rid of extra test for dotfiles
2019-12-08 12:10:13 +01:00
Stefan Hoelzl 60db94c056 fix format issues 2019-12-07 20:19:17 +01:00
Stefan Hoelzl 525e250be5 added testcase 2019-12-06 22:21:14 +01:00
Jeremy Fitzhardinge fd80795503 Convert --explicit-version -> --versioned-dirs 2019-12-06 00:53:29 -08:00
Jeremy Fitzhardinge 3235a3de3a vendor: implement --explicit-version
Implement --explicit-version from standalone cargo-vendor. This helps with
vendoring performance as it avoids redundantly deleting and re-copying
already vendored packages.

For example, when re-vendoring cargo's dependencies it makes a big
improvement on wallclock time. For initial vendoring it makes no
difference, but re-vendoring (ie, when most or all dependencies haven't
changed) without explicit versions is actually slightly slower (5.8s ->
6s), but with explicit versions it goes from 5.8s -> 1.6s.

Timings:

Without explicit versions, initial vendor
real	0m5.810s
user	0m0.924s
sys	0m2.491s

Re-vendor:
real	0m6.083s
user	0m0.937s
sys	0m2.654s

With explicit versions, initial vendor:
real	0m5.810s
user	0m0.937s
sys	0m2.461s

Re-vendor:
real	0m1.567s
user	0m0.578s
sys	0m0.967s

The summaries of syscalls executed shows why:

Revendoring without explicit versions:
```
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 25.17    1.104699          18     59432      1065 openat
 19.86    0.871574          21     41156     13825 unlink
 13.64    0.598739           2    210510           lstat
  9.02    0.395948          29     13208           copy_file_range
  8.00    0.351242          11     30245           read
  6.36    0.279005           3     72487      4476 statx
  5.35    0.235027           6     37219           write
  4.02    0.176267           3     58368           close
```
with explicit versions:
```
 29.38    0.419068          15     27798     13825 unlink
 25.52    0.364021           1    209586           lstat
 20.67    0.294788          16     17967      1032 openat
 10.42    0.148586           4     35646           write
  3.53    0.050350           3     13825           chmod
  3.14    0.044786           2     16701      1622 statx
  2.19    0.031171           1     16936           close
  1.86    0.026538          24      1078           rmdir
```

Specifically, there are a lot fewer opens, copy_file_ranges, and unlinks.
2019-12-06 00:53:29 -08:00
bors abba15f95a Auto merge of #7667 - giraffate:add_test_for_name_when_cargo_new, r=alexcrichton
Add test for `NAME` environment variable when `cargo new`

Looks like there was no test for `NAME` environment variable when `cargo new`.
2019-12-06 01:14:07 +00:00
Takayuki Nakata 2fb90adc73 Add test for NAME environment variable when cargo new 2019-12-06 09:30:13 +09:00
Takayuki Nakata 058937f018 Add test for GIT_COMMITTER_EMAIL when cargo new
There was no test for `GIT_COMMITER_EMAIL`, so I add the test for
this. In addition, I update the name of some tests.
2019-12-05 12:39:10 +09:00
bors 76cdf9314a Auto merge of #7655 - ehuss:offline-patched-error, r=alexcrichton
Remove --offline empty index error.

This reverts the error added in #6871 which attempts to provide a "nicer" error message if `--offline` is used with an empty index. I was concerned about false positives, and sure enough someone found one. If all deps are patched, it is OK for the index to be empty, because the resolver will just use the patched entries.

I considered trying to move the error to another location, but I think it would require significant changes to the registry API (which is already hard to follow). I figure the "not found" error message is good enough with the "don't use --offline" hint.

Closes #7582
2019-12-04 00:59:24 +00:00
Eric Huss 14379767ee Remove --offline empty index error. 2019-12-03 11:52:10 -08:00
Eric Huss 237051fbff Add a --offline hint. 2019-12-03 10:47:32 -08:00
Josh Triplett 997a6d5ab9 Stop ignoring .rs.bk files; rustfmt hasn't generated them in years
cargo currently generates a .gitignore file that ignores .rs.bk files,
historically because rustfmt would sometimes generate such files.
However, rustfmt and cargo fmt don't generate backup files by default
(only when requested), and even when requested, they generate .bk files,
not .rs.bk files (as of rustfmt commit
fad903fd14ad0df045dc574cac0717312860c380 in 2017). And nobody seems to
have noticed or complained since then, likely because rustfmt doesn't
generate backup files by default.

rustfmt also plans to deprecate the --backup option entirely, in rustfmt
2.0, and instead always rely on version control to track changes.

In addition, these types of ignores, just like ignores of editor backup
files, don't belong in .gitignore; they belong in people's personal
ignore files, such as ~/.config/git/ignore.  See
https://julien.danjou.info/properly-managing-your-gitignore/ for further
explanation of that.

Given all three of those factors, drop the code to add **/*.rs.bk to
.gitignore, and update tests accordingly.
2019-12-02 12:40:38 -08:00
bors b35bb1b9b7 Auto merge of #7591 - ehuss:stabilize-profile-overrides, r=alexcrichton
Stabilize profile-overrides.

This stabilizes the profile-overrides feature. This was proposed in [RFC 2282](https://github.com/rust-lang/rfcs/pull/2282) and implemented in #5384. Tracking issue is https://github.com/rust-lang/rust/issues/48683.

This is intended to land in 1.41 which will reach the stable channel on Jan 30th.

This includes a new documentation chapter on profiles. See the ["Overrides" section](9c993a92ce/src/doc/src/reference/profiles.md (overrides)) in `profiles.md` file for details on what is being stabilized.

Note: The `config-profile` and `named-profiles` features are still unstable.

Closes #6214

**Concerns**
- There is some risk that `build-override` may be confusing with the [proposed future dedicated `build` profile](https://github.com/rust-lang/cargo/pull/6577). There is some more discussion about the differences at https://github.com/rust-lang/rust/issues/48683#issuecomment-445571286. I don't expect it to be a significant drawback. If we proceed later with a dedicated `build` profile, I think we can handle explaining the differences in the documentation. (The linked PR is designed to work with profile-overrides.)
- I don't anticipate any unexpected interactions with `config-profiles` or `named-profiles`.
- Some of the syntax like `"*"` or `build-override` may not be immediately obvious what it means without reading the documentation. Nobody suggested any alternatives, though.
- Configuring overrides for multiple packages is currently a pain, as you have to repeat the settings separately for each package. I propose that we can extend the syntax in the future to allow a comma-separated list of package names to alleviate this concern if it is deemed worthwhile.
- The user may not know which packages to override, particularly for some dependencies that are split across multiple crates. I think, since this is an advanced feature, the user will likely be comfortable with using things like `cargo tree` to understand what needs to be overridden. There is [some discussion](https://github.com/rust-lang/rust/issues/48683#issuecomment-473356415) in the tracking issue about automatically including a package's dependencies, but this is somewhat complex.
- There is some possibly confusing interaction with the test/bench profile. Because dependencies are always built with the dev/release profiles, overridding test/bench usually does not have an effect (unless specifying a workspace member that is being tested/benched). Overriding test/bench was previously prohibited, but was relaxed when named profiles were added.
- We may want to allow overriding the `panic`, `lto`, and `rpath` settings in the future. I can imagine a case where someone has a large workspace, and wants to override those settings for just one package in the workspace. They are currently not allowed because it doesn't make sense to change those settings for rlibs, and `panic` usually needs to be in sync for the whole profile.
- There are some strange interactions with `dylib` crates detailed in https://github.com/rust-lang/rust/issues/64319. A fix was attempted, but later reverted. Since `dylib` crates are rare (this mostly applied to `libstd`), and a workaround was implemented for `build-std` (it no longer builds a dylib), I'm not too worried about this.
- The interaction with `share-generics` can be quite confusing (see https://github.com/rust-lang/rust/issues/63484). I added a section in the docs that tries to address this concern. It's also possible future versions of `rustc` may handle this better.
- The new documentation duplicates some of the information in the rustc book.  I think it's fine, as there are subtle differences, and it avoids needing to flip back and forth between the two books to learn what the settings do.
2019-12-02 15:54:59 +00:00
Eric Huss 2ad6b5413a Update tests for slight wording change in rustdoc error message. 2019-11-29 13:59:56 -08:00
bors 79d845b42b Auto merge of #7628 - ehuss:testsuite-comments, r=Eh2406
Minor testsuite organization.

I sometimes get a little lost when looking for the right module for tests.  This adds a brief comment to each one explaining what it is.  This also includes a few renamed modules, and a few tests have been placed in a location that makes a little more sense to me. There shouldn't be any functional changes here.

- Move `build_lib` into `build`.  It seemed a little strange to have these tests floating in a separate file.
- Rename `build_auth` to `git_auth`.
- Rename `small_fd_limits` to `git_gc`.
- Rename `resolve` to `minimal_versions`.
- Rename `overrides` to `replace`.
- Pull out `paths` overrides tests into a separate file.
2019-11-25 16:39:31 +00:00
Eric Huss 1d1b035a89 Remove failing plugin tests. 2019-11-25 07:47:17 -08:00
Eric Huss 83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
bors b505e8a5ab Auto merge of #7622 - matklad:out-dir, r=ehuss
Add value OUT_DIR to build-script-executed JSON message

The target audience here is IDE authors, who can use this feature to
better support crates which generate code to OUT_DIR
2019-11-23 17:21:46 +00:00
Aleksey Kladov f0f73f04d1 Add value OUT_DIR to build-script-executed JSON message
The target audience here is IDE authors, who can use this feature to
better support crates which generate code to OUT_DIR
2019-11-22 21:48:04 +03:00
Eric Huss 285dc3182a Update documentation for custom target dependencies. 2019-11-22 10:22:26 -08:00
bors 579174c03b Auto merge of #7593 - LukasKalbertodt:master, r=Eh2406
Document private items for binary crates by default

I suggested this change in default behavior [a long time ago](https://github.com/rust-lang/cargo/issues/1520#issuecomment-135215284) and [a year ago again](https://github.com/rust-lang/cargo/issues/1520#issuecomment-420616261). Both time, everyone seemed to agree that this is a good idea, so I thought I could just implement it.

This PR already changed the default behavior, but there are a few things we should talk about/I should do before merging:

- [x] ~~Do we *really* want this changed default behavior? If not, *why* not?~~ -> [yip](https://github.com/rust-lang/cargo/pull/7593#issuecomment-556482199)
- [x] Is changing this default behavior OK regarding backwards compatibility? -> [apparently](https://github.com/rust-lang/cargo/pull/7593#issuecomment-556482199)
- [x] ~~We should also probably add a `--document-only-public-items` flag or something like that if we change the default behavior. Otherwise users have no way to not document private items for binary crates. Right?~~ -> [We can do it later](https://github.com/rust-lang/cargo/pull/7593#issuecomment-557152039)
- [x] I should probably add some tests for this new behavior -> I did
- [ ] I don't like that I added `rustdoc_document_private_items` to `CompileOptions`, but this was the sanest way I could think of without rewriting a whole lot. Is this OK or how else would one do it? The flag would belong to `DocOptions`. But `compile` does not have access to that. Any ideas? Btw: If we also add `--document-only-private-items`, I would change the type from `bool` to `Option<bool>`.
2019-11-21 21:29:31 +00:00
Lukas Kalbertodt 00b21c8b46
Add tests for documenting private items by default in binary crates 2019-11-21 22:14:42 +01:00
bors fb4415090f Auto merge of #7560 - ehuss:stabilize-install-upgrade, r=alexcrichton
Stabilize install-upgrade.

Tracking issue: #6797

This stabilizes the install-upgrade feature, which causes `cargo install` to reinstall a package if it appears to be out of date, or exit cleanly if it is up-to-date.

There are no changes from `-Zinstall-upgrade`. See [the old unstable docs](6a7f505a18/src/doc/src/reference/unstable.md (install-upgrade)) for a refresher on the details of what it does.

This also stabilizes the following changes:
- `--version` no longer allows an implicit version requirement like `1.2`.  It must be either contain all 3 components (like `1.2.3`) or use a requirement operator (like `^1.2`).  This has been a warning for a very long time, and is now changed to a hard error.
- Added `--no-track` to disable install tracking.

**Motivation**

I just personally prefer this behavior, and it has been requested a few times in the past. I've been using it locally, and haven't run into any issues. If this goes into 1.41, then it will release on Jan 30, about 10 months since it was added in #6798.

**Concerns**

Regarding some of the concerns I had:

- Is it tracking the correct set of information?

  I'm satisfied with the current set. It also tracks, but does not use, the version of rustc and the version specified in the `--version` flag, in case we ever want to use that in the future. It is also designed to be backwards and forwards compatible, so more information can be added in the future. I think the current set strikes a good balance of tracking the really important things, without causing unnecessary rebuilds.

- Method to upgrade all outdated packages?

  This can always be added as a new flag or command in the future, and shouldn't block stabilization.

- Should `--no-track` be kept? Does it work correctly?

  I kept it. It's not too hard to support, and nobody said anything (other than maybe using a less confusing name).

- Should this be the default? Should there be a way to use the old behavior?

  I like it as the default, and don't see a real need for the old behavior. I think we could always bring back the old behavior with a flag in the future, but I would like to avoid it for simplicity. There is also the workaround of `which foo || cargo install foo`.

Closes #6797.
Closes #6727.
Closes #6485.
Closes #2082.
2019-11-21 15:59:06 +00:00
bors dba478b4f0 Auto merge of #7579 - alexcrichton:lockfile-fmt, r=ehuss
Turn the new lock file format on by default

This commit enables the support added in #7070 by default. This means
that gradually over time all `Cargo.lock` files will be migrated to the
new format. Cargo shipped with Rust 1.38.0 supports this new lock file
format, so any project using Rust 1.38.0 or above will converge quickly
onto the new lock file format and continue working.

The main benefit of the new format is to be more friendly to git merge
conflicts. Information is deduplicated throughout the lock file to avoid
verbose `depedencies` lists and the `checksum` data is all listed inline
with `[[package]]`. This has been deployed with rust-lang/rust for some
time now and it subjectively at least seems to have greatly reduced the
amount of bouncing that happens for touching `Cargo.lock`.
2019-11-19 18:50:48 +00:00
Eric Huss 8149c7fbbf Add hack for fwdansi change. 2019-11-18 17:25:47 -08:00
Alex Crichton c37a46ced4 Handle a case where cargo new oscillates 2019-11-18 07:27:18 -08:00
Eric Huss dda81d3177 Stabilize profile-overrides. 2019-11-15 17:13:55 -08:00
bors 3738e1db45 Auto merge of #7574 - igor-makarov:clippy-fixes, r=Eh2406
Fix all Clippy suggestions (but not add it to CI 🙃)

This PR adds a `clippy` job to the Azure Pipelines CI.

In addition to adding the job, I made sure to fix all the lints in all the packages.

I'm new to Rust, so please check my code modifications extra carefully 😂
2019-11-15 15:01:50 +00:00
bors d0a41bed08 Auto merge of #7132 - ehuss:metadata-kind, r=alexcrichton
Add kind/platform info to `cargo metadata`

This adds an array `"dep_kinds"` to the resolve nodes of the `cargo metadata` output. It looks something like this:

```javascript
"resolve": {
  "nodes": [
    "id": "cargo 0.39.0 (path+file:///Users/eric/Proj/rust/cargo2)",
    "deps": [
      {
        "name": "bufstream",
        "pkg": "bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
        "dep_kinds": [
          {
            "kind": "dev",
            "target": null
          }
        ]
      },
      {
        "name": "winapi",
        "pkg": "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
        "dep_kinds": [
          {
            "kind": null,
            "target": "cfg(windows)"
          }
        ]
      }
    ]
  ]
}
```

This allows one to filter the graph based on the dependency kind and platform.

I'm not completely confident that this is the right course, but I can't think of a better design. In particular, it seems a little strange to include all platforms, but features get filtered. This is probably not a problem in practice (one can use `--all-features` to ensure all features are shown for the top-level packages). Filtering out based on platform is very difficult, because you cannot determine from the resolve alone which nodes will be host vs target. That requires the entire Unit graph. We may expose the Unit graph in the future, but this seems like a useful and simple step.

This is a draft because I wanted to discuss this before moving forward. I'd like to add some more tests.

cc #4632. This doesn't filter based on target, but does expose the target names. As mentioned above, I don't think filtering is possible.
cc #5583. This adds more information.
Closes #3984.
Closes #4631 (I think).

cc @sfackler who filed some of these issues.
2019-11-14 15:09:43 +00:00
Alex Crichton 013c1afb9a Add support for new lockfile formats on new projects
This commit adds support to Cargo and refactors the lockfile versioning
slightly. The goal here is that Cargo continually has two thresholds of
lockfile formats to create:

* One is used for new lock files at all times
* The other is used to update old lock files

The logic for these two thresholds is appropriately updated throughout
Cargo, and then this commit also preserves the previous update where new
lock files will get the new format, but old lockfiles will continue to
retain the old format by default.
2019-11-12 07:19:27 -08:00
Alex Crichton 366ae3f7ba Turn the new lock file format on by default
This commit enables the support added in #7070 by default. This means
that gradually over time all `Cargo.lock` files will be migrated to the
new format. Cargo shipped with Rust 1.38.0 supports this new lock file
format, so any project using Rust 1.38.0 or above will converge quickly
onto the new lock file format and continue working.

The main benefit of the new format is to be more friendly to git merge
conflicts. Information is deduplicated throughout the lock file to avoid
verbose `depedencies` lists and the `checksum` data is all listed inline
with `[[package]]`. This has been deployed with rust-lang/rust for some
time now and it subjectively at least seems to have greatly reduced the
amount of bouncing that happens for touching `Cargo.lock`.
2019-11-12 07:00:18 -08:00
Igor Makarov 2a49ac94d0 suppress clippy lint inefficient_to_string - according to reviewers' preference 2019-11-12 10:57:13 +02:00
Igor Makarov e8a8f76432 suppress clippy lint block_in_if_condition_stmt in the testsuite because fixing it upsets rustfmt 2019-11-12 10:56:07 +02:00
Eric Huss f7b29716ed Stabilize install-upgrade. 2019-11-11 14:47:48 -08:00
bors dd3466881e Auto merge of #7570 - twe4ked:already-existing-git-ignore-comment, r=alexcrichton
Only include "already existing ..." comment in gitignore on conflict

I found the comment a bit confusing when I've used `cargo init` when I haven't had any conflicts. I thought it was meaning that my existing entries would be all commented out so I thought there was a bug of some kind.

This PR changes the comment to only be included when there are conflicting entries in the existing file.
2019-11-11 18:37:02 +00:00
bors 127d2b4dc2 Auto merge of #7486 - zachlute:suggest-alias2, r=alexcrichton
Added aliases to subcommand typo suggestions.

Fixes #7278.

Also adds tests for alias suggestions.
2019-11-11 15:29:32 +00:00
Odin Dutton c42f2eeb0e Improve gitignore comment wording 2019-11-08 10:00:57 +11:00
Odin Dutton a6db5b0797 Fix comment 2019-11-08 10:00:29 +11:00
Odin Dutton 3e8cdd7ce0 Only include "already existing ..." comment in gitignore on conflict
This comment was previously confusing when there were no existing items
that conflict.
2019-11-08 09:59:33 +11:00
Eric Huss 4dbc63ef1e Update some tests that now support stable. 2019-11-07 11:16:18 -08:00
Eric Huss a7faecc34f Add kind/platform info to cargo metadata 2019-10-28 16:47:09 -07:00
Eric Huss d6b5a6bcda Rewrite target filtering to filter the entire graph.
This also removes the special `host` target.
2019-10-28 14:01:29 -07:00
Eric Huss 5b521f6530 Add --filter-platform to cargo metadata. 2019-10-28 13:54:35 -07:00
Eric Huss 91a59e6089 Fix cargo fix not showing colors. 2019-10-28 12:00:09 -07:00
bors 759431fe98 Auto merge of #7536 - ehuss:profile-override-warning-fix, r=alexcrichton
Fix profile override warning in a workspace.

Profile overrides would erroneously warn about unused packages in a workspace if the package was not being built.  The fix here is to retain the `Resolve` for the entire workspace, and use that to determine the valid set of packages.

I think it would be good for a long-term goal to get rid of the second ("targeted") resolve.  I'm still contemplating how a separate features resolver could achieve that, but it seems feasible long-term.

Closes #7378
2019-10-24 20:33:33 +00:00
Eric Huss 12392f6d99 Fix profile override warning in a workspace. 2019-10-23 11:32:50 -07:00
Eric Huss 3beb139034 Fix some tests failing on Windows nightly. 2019-10-23 08:14:40 -07:00
Alex Crichton 269624f11d Fix broken tests on nightly 2019-10-21 09:37:13 -07:00
Alex Crichton 9cfdf4d8bf Inherit panic settings in test/bench profiles
We've always ignored the `panic` settings configured in test/bench
profiles, so this just continues to ignore them but in a slightly
different way.
2019-10-21 08:53:15 -07:00
Alex Crichton f37f3aea14 Support rustc's -Z panic-abort-tests in Cargo
Recently added in rust-lang/rust#64158 the `-Z panic-abort-tests` flag
to the compiler itself will activate a mode in the `test` crate which
enables running tests even if they're compiled with `panic=abort`.  It
effectively runs a test-per-process.

This commit brings the same support to Cargo, adding a `-Z
panic-abort-tests` flag to Cargo which allows building tests in
`panic=abort` mode. While I wanted to be sure to add support for this in
Cargo before we stabilize the flag in `rustc`, I don't actually know how
we're going to stabilize this here. Today Cargo will automatically
switch test targets to `panic=unwind`, and so if we actually were to
stabilize this flag then this configuration would break:

    [profile.dev]
    panic = 'abort'

In that case tests would be compiled with `panic=unwind` (due to how
profiles work today) which would clash with crates also being compiled
with `panic=abort`. I'm hopeful though that we can perhaps either figure
out a solution for this and maybe even integrate it with the ongoing
profiles work.
2019-10-21 08:51:01 -07:00
bors eb12fff356 Auto merge of #7526 - ehuss:rustfmt, r=alexcrichton
rustfmt for nightly changes.

Something in the latest nightly versions of rustfmt has slightly changed the logic here. Fortunately stable ignores the new formatting, and it looks better to me anyways.  I tend to always use nightly, so this helps me with a slight annoyance where this line keeps getting changed.
2019-10-18 22:20:14 +00:00
Eric Huss d6d15141f8 Wrap some really long lines.
These do not wrap due to https://github.com/rust-lang/rustfmt/issues/3863.
2019-10-18 15:17:59 -07:00
Eric Huss 4d524ea57b Allow --all-features in root of virtual workspace. 2019-10-18 09:39:58 -07:00
bors c25db6c875 Auto merge of #7507 - ehuss:virtual-ws-features, r=alexcrichton
Reject feature flags in a virtual workspace.

This generates an error if feature flags are used in the root of a virtual workspace. Previously these flags were completely ignored.  In the interest of avoiding confusion, I think it would be good to be explicit that these don't currently work.  This could alternatively be a warning, but I think it is better to reject it outright.

cc #4753, #3620, #5015, #6195, etc.
2019-10-15 15:26:07 +00:00
bors 1e764dbd4d Auto merge of #7504 - ehuss:rename-package-overrides, r=alexcrichton
Rename `overrides` to `package` in profiles.

Renaming per the discussion at https://github.com/rust-lang/rust/issues/48683#issuecomment-488842694.

I left backwards-compatibility in case anyone is using it, since it required very little effort.

cc @da-x, FYI.
2019-10-15 15:01:26 +00:00
bors 78ba63019d Auto merge of #7333 - ehuss:allow-dev-dep-path, r=alexcrichton
Allow publishing with dev-dependencies without a version.

This change allows dev-dependencies without a `version` key to be published.  If a dev-dependency is missing the `version`, it will be stripped from the packaged manifest.
2019-10-15 14:38:29 +00:00
bors b03182a8ff Auto merge of #7450 - ehuss:stabilize-cache-messages, r=alexcrichton
Stabilize cache-messages

This stabilizes the -Zcache-messages feature, making it always enabled.

## What is stabilized?

This feature is intended to redisplay previous warnings on a "fresh" build instead of displaying no output.

Users have occasionally indicated frustration when they know there are warnings, but no output is displayed when the build is fresh. This also improves the interaction between `cargo check` and `cargo clippy-preview`. This also simplifies the code, and opens more possibilities for `rustc` to send side-channel messages to Cargo.

Cargo will now use JSON output from `rustc` and `rustdoc` 100% of the time (`rustdoc --test` does not use JSON). Previously Cargo would only use JSON for pipelined crates.

Cargo will save the JSON output into a file named `output` in the `.fingerprint` directory. This file is only created when the compiler outputs a diagnostic message.

If a crate is being recompiled, and Cargo considers it to be "fresh", it will replay the output file to the console.

## Notable changes in this PR

- Fixed a bug where replays were erroneously including pipeline rmeta artifact json messages.
- clippy-preview is now included in the metadata hash, to force its artifacts to be separate from `cargo check`.
- clippy-preview is no longer force-enabled, under the assumption that caching and fingerprinting is accurate, and the cached messages will be replayed.
- clippy-preview's arguments are included in the fingerprint now that it is not force-enabled.
- Rustdoc colors and short messages were fixed when pipelining was stabilized, so updated tests.

Closes #6986
Closes #6848
Closes #6664
Closes #2458

## Concerns

The only notable issue with this is that switching between short and long human messages only replays the format from the first invocation.  That is, if you do `cargo build` and it generates warnings, then running again with `--message-format=short` will still show the full length human messages. I'm personally fine with that behavior, even though it is not ideal. I think this feature overall improves the situation (where before *no* output was displayed). Being able to re-render between short/long is a very difficult problem, and unlikely to be fixable in the foreseeable future.

There was some concern expressed about being able to disable this. I think that would only be necessary if a severe bug is discovered. I do not feel that this change is risky enough to warrant a configurable option. If it does cause a problem, it can be quickly reverted with a one-line change to set `OutputOptions::cache_cell` to `None`. Since pipelining has been using JSON output for a while now without complaints, I feel pretty confident in it.
2019-10-15 13:48:13 +00:00
Eric Huss bf474ba589 Reject feature flags in a virtual workspace. 2019-10-14 12:40:14 -07:00
Eric Huss fcfe0b8988 Rename overrides to package in profiles. 2019-10-10 14:39:30 -07:00
bors 94bf4781d0 Auto merge of #7456 - alexcrichton:config-only-serde, r=ehuss
Migrate towards exclusively using serde for `Config`

This series of commits was spawned off a thought I had while reading https://github.com/rust-lang/cargo/issues/7253#issuecomment-535656059, although it ended up not really touching on that at all. I was a little unsettled about how unstructured the config accesses are throughout Cargo and we had sort of two systems (one serde which is nice, one which is more manual) for reading config values.

This PR converts everything to run through serde for deserializing values, except for `get_list` which is funky. There's only one usage of that with the `paths` key though and we can probably fix this soon-ish.

In any case, the highlights of this PR are:

* This PR is surprisingly large. I did a lot of movement in `config.rs` to try to make the file smaller and more understandable.
* The `Value` type which retains information about where it was deserialized from is very special, and has special treatment with serde's data model. That's what allows us to use that and serde at the same time.
* The `ConfigRelativePath` and `ConfigKey` structures have been revamped internally, but morally serve the same purposes as before.
* Cargo now has structured `struct` access for a bunch of its configuration (`net`, `http`, `build`, etc). I would ideally like to move toward a world where this is the *only* way to read configuration, or at least everything conventionally runs through those paths.
* Functionally, this PR should have no difference other than tweaks to error messages here and there, and perhaps more strict validation on commands where we validate more configuration on each run than we previously did.
* This isn't a 100% transition for Cargo yet, but I figured it would be a good idea to post this and get some feedback first.
* In the long run I want to remove `get_env`, `get_cv`, and `get_*_priv` from `Config` as internal details. I'd like to move this all to `de.rs` and have it walk down the tree of configuration as we deserialize a value. For now though these all remain in place and that refactoring is left to a future PR.
2019-10-09 16:55:15 +00:00
bors 515a6df4fc Auto merge of #7492 - ehuss:enable-msvc-tests, r=alexcrichton
Re-enable some MSVC tests.

These tests were disabled for MSVC in #7400, but I would prefer to keep them running.
2019-10-08 22:12:48 +00:00
bors 9005002630 Auto merge of #7489 - da-x:fix-7488, r=ehuss
when -Z unstable-options not specified, don't validate --profile

This fixes a regression caused by 8b0561d68f - Closes #7488.
2019-10-08 19:53:13 +00:00
Eric Huss 5ccabc829e Re-enable some MSVC tests. 2019-10-08 10:13:24 -07:00
Dan Aloni 9dc70a3dab Rustfmt lint 2019-10-08 11:07:19 +03:00
Dan Aloni e04099e6a3 tests: cover issue #7488 2019-10-08 09:49:25 +03:00
Alex Crichton d7d8ca1e12 Consolidate build key configuration
Add a typed structure which lists all `build` key configuration
throughout Cargo.
2019-10-07 17:12:03 -07:00
Alex Crichton 37ace8886a Finish implementing Value, use it in helpers
Rewrite helpers like `get_bool` to use `get::<Option<Value<bool>>>`
instead of duplicating the logic that's already with the typed access of
configuration. This is more along the effort to centralize all
deserialization of configuration into typed values instead of using
ad-hoc accessors in a number of locations.
2019-10-07 17:12:03 -07:00
Alex Crichton c0baf844e3 Refactor ConfigKey to its own file
Also make it a little less allocation-heavy by tweaking the API to
encourage incremental building of the key and incremental destruction as
we walk throughout the configuration tree.
2019-10-07 17:12:03 -07:00
Alex Crichton a92fd48fb4 Improve error message for cyclic dependencies
First reported in rust-lang/rust#65014 it looks like our error message
on cyclic dependencies may be confusing at times. It looks like this is
an issue because there are multiple paths through a graph for a
dependency, so using the generic `path_to_top` function isn't producing
the most useful path for this purpose.

We're already walking the graph though, so this commit adds an extra
parameter which collects the list of packages we've visited so far to
produce a hopefully always-accurate error message showing the chain of
dependencies end-to-end for what depends on what.
2019-10-07 16:50:42 -07:00
Zach Lute ff3e880c17 Added aliases to subcommand typo suggestions.
Fixes #7278.

Also adds tests for alias suggestions.
2019-10-05 08:44:26 -07:00
snf e7c5579d3e removing hash from output files when using MSVC 2019-10-02 02:07:09 -03:00
Eric Huss bd73e8dab5 Stabilize cache-messages 2019-09-30 14:04:10 -07:00
bors 8b0561d68f Auto merge of #6989 - da-x:custom-profile-pr-rfc, r=ehuss
Support for named profiles (RFC 2678)

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

Implementation according to the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2678-named-custom-cargo-profiles.md).
2019-09-30 19:51:19 +00:00
bors 8ae8b5ea98 Auto merge of #7308 - guanqun:add-ssl-version, r=alexcrichton
add an option to specify ssl version

Fixes #6684
2019-09-30 18:35:21 +00:00
Guanqun Lu 852cf05365 add a bit more docs 2019-10-01 00:06:34 +08:00
Guanqun Lu a4e3b81a55 run cargo fmt to pass the CI build 2019-09-30 23:48:08 +08:00
bors 99c034a970 Auto merge of #7417 - alexcrichton:less-hashing, r=Eh2406
Go back to not hashing `RUSTFLAGS` in `-Cmetadata`

This is a moral revert of #6503 but not a literal code revert. This
switches Cargo's behavior to avoid hashing compiler flags into
`-Cmetadata` since we've now had multiple requests of excluding flags
from the `-Cmetadata` hash: usage of `--remap-path-prefix` and PGO
options. These options should only affect how the compiler is
invoked/compiled and not radical changes such as symbol names, but
symbol names are changed based on `-Cmetadata`. Instead Cargo will still
track these flags internally, but only for reinvoking rustc, and not for
caching separately based on rustc flags.

Closes #7416
2019-09-30 14:57:58 +00:00
Guanqun Lu ba1f16a7a4 fixes 2019-09-30 00:32:57 +08:00
Guanqun Lu 0e5d378e04 modify to enum/struct and add test for SslVersionConfig 2019-09-30 00:29:15 +08:00
Dan Aloni e634ee549c named-profiles: add backward compatibility if feature is disabled
The effects over the profile used by targets are made conditional
in this commit, using the old scheme if the `named-profiles` feature
is disabled. This also affects the `profile_targets` tests, which
now have two modes - stable, and nightly with the feature enabled.
2019-09-27 23:50:46 +03:00
bors fdcc73fc69 Auto merge of #7452 - pyrrho:bug7346/transitive_patches, r=Eh2406
Bug7346/transitive patches

Fixes #7346.

A cursory comparison between current stable and nightly shows that projects with this topology resolve similarly. If there are other behaviors I should test, I'd be happy to expand that section. This is a pretty focused change, though, so I'm not sure what else there is to break.

Sorry about the delay in putting this PR together. Good news is I know more than I did last week.
2019-09-27 14:44:25 +00:00
Drew Pirrone-Brusse 4d094c080f Add a test to model the bug found in #7346 2019-09-26 18:34:36 -04:00
Eric Huss 36f01e6492 Allow gitignore of Cargo.lock with explicit include. 2019-09-26 15:02:01 -07:00
bors d5621bea26 Auto merge of #7446 - alexcrichton:quiet-output, r=Eh2406
Improve test output with `--quiet`

We had a few locations where the shell was written to raw instead of
through the test harness or through other captured mechanisms. This
updates the test suite so testing Cargo with `--quiet` provides a nice
and clean report of tests executed.
2019-09-26 19:03:56 +00:00
Alex Crichton 7606f79661 Improve test output with --quiet
We had a few locations where the shell was written to raw instead of
through the test harness or through other captured mechanisms. This
updates the test suite so testing Cargo with `--quiet` provides a nice
and clean report of tests executed.
2019-09-26 11:32:29 -07:00
Alex Crichton 61fb34b0c0 Allow a number of tests to run on stable
These tests all relied on support which has now ridden to stable at this
point, so let's let them run on stable!
2019-09-26 11:31:57 -07:00
Dan Aloni 04804ea304 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-26 21:24:34 +03:00
Alex Crichton f3c92ed52e Go back to not hashing RUSTFLAGS in -Cmetadata
This is a moral revert of #6503 but not a literal code revert. This
switches Cargo's behavior to avoid hashing compiler flags into
`-Cmetadata` since we've now had multiple requests of excluding flags
from the `-Cmetadata` hash: usage of `--remap-path-prefix` and PGO
options. These options should only affect how the compiler is
invoked/compiled and not radical changes such as symbol names, but
symbol names are changed based on `-Cmetadata`. Instead Cargo will still
track these flags internally, but only for reinvoking rustc, and not for
caching separately based on rustc flags.

Closes #7416
2019-09-26 10:50:43 -07:00
Matthias Krüger 3fce509208 fix a bunch of clippy warnings 2019-09-26 17:51:19 +02:00
Dan Aloni 33d5c837e2 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-25 20:05:51 +03:00
bors c59e1f422a Auto merge of #7421 - ehuss:build-std-sysroot, r=alexcrichton
Change build-std to use --sysroot

This transitions build-std to use `--sysroot` instead of `--extern`. This is necessary because existing crates have a certain expectation of how standard library crates are exposed. It was intended that explicit dependencies in `Cargo.toml` would solve this problem, but I didn't really consider this would be a backwards-incompatible change, so using `--sysroot` is probably the best way to go, even though it's not ideal.

Closes rust-lang/wg-cargo-std-aware#31
Closes rust-lang/wg-cargo-std-aware#40
2019-09-25 15:58:02 +00:00
Eric Huss d0ab04add4 Simplify mock rustc wrapper. 2019-09-24 12:45:32 -07:00
Alex Crichton 1fa02e77b6 Fix interpretation of --features a b on the CLI
Fixes an accidental regression from #7084 where `--features a b` was
erroneously mistinterpreted as `--features "a b"`.

Closes #7418
2019-09-24 09:24:47 -07:00
Eric Huss 53a3db05a6 Some more --sysroot tests. 2019-09-23 18:53:28 -07:00
Alex Crichton bc5c441b12 Change how standard_lib tests work
* Minimize the sysroot crates in play
* Don't use build scripts to inject args
* Use `RUSTC_WRAPPER` to dynamically switch `--sysroot` depending on
  whether we're building sysroot crates or not.
* Minimize dependency graph in sysroot, only have each crate depend on a
  dummy crates.io crate for testing and otherwise don't depend on
  anything to load the desired sysroot crate directly.
2019-09-23 18:53:28 -07:00
Dan Aloni b437782929 profiles: remove 'check' from stable access 2019-09-22 09:06:30 +03:00
Eric Huss 4850f9b9d8 Fix xcompile tests. 2019-09-21 16:30:38 -07:00
Dan Aloni 3307176326 tests: profile_custom - add name validation tests 2019-09-21 10:29:32 +03:00
Dan Aloni a50be59a70 Rustfmt adjustments 2019-09-21 09:37:06 +03:00
Dan Aloni bf5f0b7c3a tests: profile_custom - add missing stdout/stderr checks 2019-09-21 09:37:06 +03:00
Dan Aloni 6cd8e87dea tests: profile_custom - test for invalid 'inherits' use on root profile 2019-09-21 09:37:06 +03:00
Dan Aloni fb75361226 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-21 08:10:31 +03:00
Dan Aloni f352af91f5
Update tests/testsuite/profile_targets.rs
Co-Authored-By: Eric Huss <eric@huss.org>
2019-09-21 08:08:55 +03:00
Eric Huss 8fadd2b9ce Fix -Ztimings with doc tests. 2019-09-20 14:56:52 -07:00