Commit graph

281 commits

Author SHA1 Message Date
Eric Huss d47a9545db Use Option::as_deref 2020-03-15 18:51:38 -07:00
Eric Huss 0b115f57aa -Zfeatures=host_dep: Support decoupling proc-macro features. 2020-03-15 15:59:42 -07:00
Eric Huss 5a1862cd36 Add proc-macro to the index. 2020-03-15 10:10:25 -07:00
bors 7302186d7b Auto merge of #7533 - yaahc:clippy-banishment, r=ehuss
Close the front door for clippy but open the back
2020-03-14 20:50:15 +00:00
Jane Lusby d02f476804 rustfmt 2020-03-13 15:02:55 -07:00
Jane Lusby 76797b5c2a switch from bash script to rust program 2020-03-13 14:59:41 -07:00
Alex Crichton 82239d7a10 Bump libgit2 dependencies
Brings in rust-lang/git2-rs#527

Closes #7466
Closes #7988
2020-03-13 12:26:46 -07:00
Jane Lusby b0351e4d87 Close the front door for clippy but open the back 2020-03-12 19:27:48 -07:00
Alex Crichton 5b6e7397ed Update libgit2 dependency
Brings in a few CVE fixes and such for libgit2, bringing libgit to
0.99.0
2020-02-26 09:39:05 -08:00
Matthias Krüger 1d912002e9 fix most remaining clippy findings (mostly redundant imports) 2020-02-21 12:15:16 +01:00
Alex Tokarev 2b1dc3e518 Run through nightly clippy 2020-02-21 01:27:18 +03:00
Alex Tokarev 45ad3f9986 Remove unused imports 2020-02-20 23:58:10 +03:00
Eric Huss 457c4bc4c8 Work-around macOS 10.15 Gatekeeper issue. 2020-02-19 16:46:35 -08:00
Eric Huss 0a2f691381 Switch azure to macOS 10.15. 2020-02-19 16:46:29 -08:00
Eric Huss 0d44a8267b Rework internal errors. 2020-02-17 19:03:57 -08:00
Josh Stone 9c8b4dcd3e Link the licenses into crates/cargo-platform
The licenses should be included in the package published on crates.io
2020-02-14 15:54:22 -08:00
Kinrany bc4c65c5d3 Do not run formats_source if rustfmt is not available
Generalized `clippy_is_available` and renamed as `command_is_available`.

No checks in `ignores_failure_to_format_source`, it's not supposed to
use `rustfmt` even if it's available
2020-02-05 10:09:43 +03:00
Eric Huss 0279e8e63a Fix using global options before an alias. 2020-01-31 13:56:06 -08:00
Matthias Krüger a6a395c690 fix some clippy warnings 2020-01-17 12:20:11 +01:00
Eric Huss 0b653a43ba Rename Kind 2020-01-11 11:04:13 -08:00
bors c95f396b4c Auto merge of #7778 - ehuss:bump-crates-io, r=alexcrichton
Bump crates-io

Needed for #7776.
2020-01-08 18:26:02 +00:00
Eric Huss b688f7da56 Bump crates-io 2020-01-08 10:05:35 -08:00
Alex Crichton d0430dd2b1 Run rustfmt 2020-01-07 20:01:34 -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 f37b9bd77a Update the reference link in a message
Follow up dc81356ef.
2020-01-07 09:05:49 +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 91015d52ce Add --config CLI option. 2019-12-19 09:44:02 -08:00
Eric Huss 381251aa1f Config refactoring. 2019-12-19 09:44:01 -08:00
Takayuki Nakata b7bc069fbb Refactoring of creating registry 2019-12-17 14:12:27 +09:00
Takayuki Nakata 3613999aca Refactoring to call new generate_* functions instead of duplicating codes 2019-12-17 12:31:01 +09:00
Takayuki Nakata 2a4d1dc40a Append registries to config 2019-12-17 09:59:45 +09: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 fd65cbd816 Bump cargo-platform version. 2019-12-10 11:59:06 -08:00
Benedikt Werner aa93f61f21
Warn instead of error 2019-12-07 09:10:06 +01:00
Benedikt Werner a572f0f274
Use blacklist instead of whitelist 2019-12-05 11:53:26 +01:00
Benedikt Werner bee13d604d
Fix test formatting 2019-12-04 09:33:58 +01:00
Benedikt Werner 552ecc9438
Emit error on [target.cfg(debug_assertions).dependencies] 2019-12-04 09:08:43 +01:00
Eric Huss 83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -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 1c5861c8b4 implement clippy suggestion to remove redundant clone 2019-11-12 10:56:27 +02:00
Igor Makarov 6d21f9e08c silence several clippy lints in tests 2019-11-12 10:54:59 +02:00
Igor Makarov b590183d87 suppress clippy lint needless_doctest_main 2019-11-12 10:49:04 +02:00
Igor Makarov b3fe6b7d27 implement clippy suggestion to remove redundant to_string 2019-11-12 10:21:21 +02:00
Igor Makarov 37ec84d09a implement clippy suggestion to remove needless return 2019-11-12 10:21:21 +02:00
Eric Huss 1df81ee07e Bump to 0.42.0, Update changelog 2019-11-07 11:19:48 -08:00
Eric Huss a8f645a9ca Remove some needless parentheses now reported on nightly. 2019-11-07 11:19:07 -08: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
Eh2406 0750caffe8 add a test to show the new performance 2019-09-27 17:31:02 -04:00
Eric Huss 8ad031b54f Bump to 0.41.0, Update changelog 2019-09-27 09:02:13 -07:00
bors d8e62ee121 Auto merge of #7425 - alexcrichton:kind-string, r=ehuss
Refactor `Kind` to carry target name in `Target`

This commit is an internal refactoring of Cargo's compilation backend to
eventually support compiling multiple target simultaneously. The
original motivation for this came up in discussion of #7297 and this has
long been something I've intended to update Cargo for. Nothing in the
backend currently exposes the ability to actually build multiple target
simultaneously, but this should have no function change with respect to
all current consumers. Eventually we'll need to refactor APIs of how you
enter the compilation backend to compile for multiple targets.
2019-09-26 17:12:00 +00:00
Matthias Krüger 3fce509208 fix a bunch of clippy warnings 2019-09-26 17:51:19 +02:00
Alex Crichton 593a02f2d7 Refactor Kind to carry target name in Target
This commit is an internal refactoring of Cargo's compilation backend to
eventually support compiling multiple target simultaneously. The
original motivation for this came up in discussion of #7297 and this has
long been something I've intended to update Cargo for. Nothing in the
backend currently exposes the ability to actually build multiple target
simultaneously, but this should have no function change with respect to
all current consumers. Eventually we'll need to refactor APIs of how you
enter the compilation backend to compile for multiple targets.
2019-09-26 08:23:05 -07:00
Eric Huss 53a3db05a6 Some more --sysroot tests. 2019-09-23 18:53:28 -07:00
Eric Huss 8fadd2b9ce Fix -Ztimings with doc tests. 2019-09-20 14:56:52 -07:00
bors 7ab477866e Auto merge of #7375 - ehuss:extract-platform, r=alexcrichton
Extract Platform to a separate crate.

This moves the `Platform`, `Cfg`, `CfgExpr` types to a new crate named "cargo-platform".  The intent here is to give users of `cargo_metadata` a way of parsing and inspecting cargo's platform values.

Along the way, I rewrote the error handling to remove `failure`, and to slightly improve the output.

I'm having doubts whether or not this is a good idea.  As you can see from the `examples/matches.rs` example, it is nontrivial to use this (which also misses cargo's config values and environment variables).  I don't know if anyone will actually use this.  If this doesn't seem to have value, I would suggest closing it.

I've also included a sample script, `publish.py`, for publishing cargo itself.  I suspect it will need tweaking, but I figure it would be a start and open for feedback.
2019-09-20 18:05:09 +00:00
bors d96c050b2c Auto merge of #7386 - alexcrichton:less-env-leak, r=ehuss
Remove all `CARGO_*` env vars in tests

Usage of `CARGO_PROFILE_*` is generating unexpected warnings in tests in
rust-lang/rust#64316 so let's just blanket remove every env var that has
a `CARGO_*` prefix which generally means Cargo-specific env vars. Tests
practically all assume that they have blank configs right now.
2019-09-19 20:19:40 +00:00
bors d3df047551 Auto merge of #7389 - alexcrichton:less-winapi-02, r=Eh2406
Remove dependency on `winapi` 0.2

This commit removes Cargo's dependency on `winapi` 0.2 which takes an
excessively long time to build, slowing down Windows builds. The
`winapi` 0.2 crate was pulled in via a dependency chain that looked
like:

    cargo
    \- crates-io
       \- http
          \- bytes
             \- iovec
                \- winapi 0.2

The fix implemented here was to remove the `http` crate dependency from
`crates-io` which is only used for rendering status codes, but it's easy
enough to inline that function locally.
2019-09-19 18:58:16 +00:00
Alex Crichton 0f751deffb Remove dependency on winapi 0.2
This commit removes Cargo's dependency on `winapi` 0.2 which takes an
excessively long time to build, slowing down Windows builds. The
`winapi` 0.2 crate was pulled in via a dependency chain that looked
like:

    cargo
    \- crates-io
       \- http
          \- bytes
             \- iovec
                \- winapi 0.2

The fix implemented here was to remove the `http` crate dependency from
`crates-io` which is only used for rendering status codes, but it's easy
enough to inline that function locally.
2019-09-19 11:53:24 -07:00
Alex Crichton ef5b89ce28 Remove all CARGO_* env vars in tests
Usage of `CARGO_PROFILE_*` is generating unexpected warnings in tests in
rust-lang/rust#64316 so let's just blanket remove every env var that has
a `CARGO_*` prefix which generally means Cargo-specific env vars. Tests
practically all assume that they have blank configs right now.
2019-09-18 18:10:32 -07:00
Eric Huss 079b3fbad8 Fix tar duplicate artifact in rust-lang/rust. 2019-09-18 17:41:48 -07:00
Eric Huss 57c96c194a Extract Platform to a separate crate. 2019-09-17 14:55:22 -07:00
Alex Crichton 0dd79670d4 Add back a full integration test for -Zbuild-std
Only run these tests on one CI builder (not all platforms) though. This
is extremely resource intensive since it rebuilds libstd. Currently this
does not share a build directly like before because the number of tests
are supposed to be small, but if necessary we can add that in later too.
2019-09-16 11:47:09 -07:00
Alex Crichton 9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Eh2406 c14bb6e073 minimal-copy deserialize for InternedString and use InternedString more places 2019-09-03 10:26:15 -04:00
Eric Huss 5c7875d2e0 Bump to 0.40.0, Update changelog 2019-08-19 14:27:15 -07:00
Eric Huss e26ef01743 Refactor resolve Method 2019-07-27 16:21:24 -07:00
Eric Huss 51a8206c38 Be more consistent about detecting CI. 2019-07-25 12:10:55 -07:00
Alex Crichton 3c67dc8430 Update the url crate to 2.0
Looks like minor API changes, primarily around percent encoding.
2019-07-24 08:26:28 -07:00
Alex Crichton 8887b67ec5 Optimize runtime of #[cargo_test_macro]
I've noticed recently that the incremental compile time for our test
suite has felt like it's increased quite a bit. I think one reason is
that everything has to go through `#[cargo_test_macro]` unconditionally
on all incremental builds, and wow do we have a lot of tests being
pumped through that macro.

Instrumenting the macro a little bit shows that we spend nearly 2.5
seconds on each compilation simply executing this macro (note that it's
in debug mode as well, not release since we typically don't execute
tests in release mode.

This commit instead drops the usage of `syn` and `quote` in favor of a
"raw procedural macro" which is much more optimized for just our use
case, even in debug mode. This drops the collective time spent in the
macro to 0.2 seconds, even in debug mode!
2019-07-19 11:07:01 -07:00
Eric Huss a4e9611453 Fix some formatting for some strings. 2019-07-13 16:00:47 -07:00
Eric Huss 2208c1f62f Bump to 0.39.0 2019-07-05 10:42:46 -07:00
Matthias Krüger 51a56a452d format crates-io and cargo-test-macro subcrates 2019-06-23 00:29:52 +02:00
bors 37cb9bbe24 Auto merge of #7045 - Eh2406:resolver-test/debug-cleanup, r=alexcrichton
Resolver test/debug cleanup

This is several small things salvaged from abandoned PRs and implemented on top of #7011

In working on this I noted that the prop tests are very sensitive to whether backtrace are turned on. Maybe we should set that env to 0 for that builder?
2019-06-21 01:30:05 +00:00
Jeremy Stucki 930134c75b
Rename to_url -> into_url 2019-06-20 16:53:24 +02:00
Eh2406 034c5908d8 check that the SAT solver exempts the result from the resolver 2019-06-19 16:58:25 -04:00
Eh2406 f203deaa05 optimize conflict_store for looking up only older matches 2019-06-19 13:02:08 -04:00
Eh2406 f4bd3a4c6e dont have arg if it is all ways pkg_id("root") 2019-06-19 11:59:33 -04:00
Alex Crichton 290a727ad0 Extract resolver tests to their own crate
These tests take a good amount of time to run locally and they're also
causing a lot of dependencies to get pulled into rust-lang/rust, so
let's have a separate crate that we just test on our own CI
2019-06-18 10:50:48 -07:00
Alex Crichton e449cb23e3 Move the crates-io crate to a crates directory
That way when we add more crates we've got a place to put them!
2019-06-18 10:47:44 -07:00