Commit graph

107 commits

Author SHA1 Message Date
Arlo Siemsen 58869e5ce6 Stop ignoring Array ordering Json comparison tests. Update tests to have sorted order. 2020-07-15 16:32:19 -07:00
bors 2f4097aa6b Auto merge of #8416 - est31:remove_derive, r=alexcrichton
Remove unused serde_derive dependency from the crates.io crate
2020-06-26 16:33:12 +00:00
est31 65591e8144 Remove unused serde_derive dependency 2020-06-26 17:29:09 +02:00
CrLF0710 ad0940c9ad Add missing license field. 2020-06-20 10:03:25 +08:00
Matthias Krüger 6eefe3c236 fix clippy warnings 2020-06-04 00:55:45 +02:00
bors 5847787fef Auto merge of #8274 - Eh2406:8249-repro, r=alexcrichton
reset lockfile information between resolutions

#8249 pointed out that some kind of lockfile data was leaking between calls to the resolver. @ehuss made a reproducing test case. This PR resets the `LockedMap` data structure when calling `register_previous_locks`.

lets see if CI likes it.
fix #8249
2020-06-01 16:01:10 +00:00
Eric Huss 80e55c774b Fix tests with enoent error message on non-english systems. 2020-05-29 12:34:17 -07:00
Eh2406 8ce0d02971 confirm that it is not a bug at resolver level 2020-05-28 15:43:30 -04:00
Daniel Wagner-Hall 556c236f9a Bump to semver 0.10 for VersionReq::is_exact
This stops using `to_string` as a proxy for this now-provided precise API.

This reverts commit b71927224f and bupms the
dependency version in Cargo.toml.
2020-05-25 11:11:45 +01:00
Eric Huss 771b2bca76 Repro 2020-05-24 17:31:30 -04:00
Matthias Krüger 6694fdb677 clippy fixes 2020-05-01 01:16:30 +02:00
bors 90931d9b31 Auto merge of #8077 - faern:use-assoc-int-consts, r=ehuss
Use associated constants directly on primitive types instead of modules

This PR is in no way critical. It's more of a code cleanup. It comes as a result of me making https://github.com/rust-lang/rust/pull/70857 and search-and-replacing all usage of the soft-deprecated ways of reaching primitive type constants.

It makes the code slightly shorter, that's basically it. And showcases the recommended way of reaching these consts on new code :)
2020-04-28 01:56:59 +00:00
Dylan MacKenzie cf57ce1574 Clear RUSTDOCFLAGS for all tests 2020-04-27 14:31:44 -07:00
bors 97d39aeaac Auto merge of #8139 - mati865:patch-1, r=ehuss
Add windows-gnu CI and fix tests

One remaining failure:
```
---- features::feature_off_dylib stdout ----
running `d:\a\1\s\target\debug\cargo.exe build --features f1`
running `d:\a\1\s\target\debug\cargo.exe run -p bar`
thread 'features::feature_off_dylib' panicked at '
Expected: execs
    but: exited with exit code: 101
--- stdout

--- stderr
   Compiling foo v0.0.1 (D:\a\1\s\target\cit\t663\foo)
   Compiling bar v0.0.1 (D:\a\1\s\target\cit\t663\foo\bar)
    Finished dev [unoptimized + debuginfo] target(s) in 0.69s
     Running `target\debug\bar.exe`
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"f1"`,
 right: `"no f1"`', bar\src\main.rs:5:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\bar.exe` (exit code: 101)
', crates\cargo-test-support\src\lib.rs:833:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    features::feature_off_dylib
```

I disassembled the dylibs and `cargo run -p bar` correctly rebuilt it inside `target/debug/deps/` but did not copy it to `target/debug`. To further confirm, calling `cp target/debug/deps/foo.dll target/debug/` manually solved the issue.
Any idea?

----

I left `FIXME` in places where import lib should be added with https://github.com/rust-lang/cargo/pull/6875.

`TOOLCHAIN: nightly-x86_64-pc-windows-gnu` can be replaced with beta on Thursday.
2020-04-21 17:03:56 +00:00
Mateusz Mikuła 9f742466f1 Update tests for windows-gnu 2020-04-21 17:25:25 +02:00
bors 9d84c0c734 Auto merge of #7973 - ehuss:index-updates, r=alexcrichton
Several updates to token/index handling.

This attempts to tighten up the usage of token/index handling, to prevent accidental leakage of the crates.io token.

* Make `registry.index` config a hard error. This was deprecated 4 years ago in #2857, and removing it helps simplify things.
* Don't allow both `--index` and `--registry` to be specified at the same time. Otherwise `--index` was being silently ignored.
* `registry.token` is not allowed to be used with the `--index` flag. The intent here is to avoid possibly leaking a crates.io token to another host.
* Added a warning if source replacement is used and the token is loaded from `registry.token`.

Closes #6545
2020-04-20 19:50:40 +00:00
Eric Huss 65274ea7d5 Add a warning when using registry.token with source replacement. 2020-04-19 09:25:32 -07:00
Eric Huss 787e75b797 Add resolver opt-in for new feature resolver. 2020-04-19 08:45:18 -07:00
Eric Huss 4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Eric Huss 4367ec4d11 Use Path methods instead of fs::metadata. 2020-04-16 22:00:22 -07:00
Linus Färnstrand c428c0ef41 Use associated constants directly on primitive types instead of modules 2020-04-06 23:37:06 +02:00
Alex Crichton bac300bda0 Add support for -Cembed-bitcode=no
This commit is the Cargo half of support necessary for
rust-lang/rust#70458. Today the compiler emits embedded bytecode in
rlibs by default, but compresses it. This is both extraneous disk space
and wasted build time for almost all builds, so the PR in question there
is changing rustc to have a `-Cembed-bitcode` flag which, when enabled,
places the bitcode in the object file rather than an auxiliary file (no
extra compression), but also enables `-Cembed-bitcode=no` to disable
bitcode emission entirely.

This Cargo support changes Cargo to pass `-Cembed-bitcode=no` for almost
all compilations. Cargo will keep `lto = true` and such working by not
passing this flag (and thus allowing bitcode to get embedded), but by
default `cargo build` and `cargo build --release` will no longer have
any bitcode in rlibs which should result in speedier builds!

Most of the changes here were around the test suite and various
assertions about the `rustc` command lines we spit out. One test was
hard-disabled until we can get `-Cembed-bitcode=no` into nightly, and
then we can make it a nightly-only test. The test will then be stable
again once `-Cembed-bitcode=no` hits stable.

Note that this is intended to land before the upstream `-Cembed-bitcode`
change. The thinking is that we'll land everything in rust-lang/rust all
at once so there's no build time regressions for anyone. If we were to
land the `-Cembed-bitcode` PR first then there would be a build time
regression until we land Cargo changes because rustc would be emitting
uncompressed bitcode by default and Cargo wouldn't be turning it off.
2020-04-01 14:31:06 -07:00
bors 8a0d4d9c9a Auto merge of #8028 - ehuss:new-proc-macro-decouple, r=alexcrichton
Re-implement proc-macro feature decoupling.

This is essentially a rewrite of #8003. Instead of adding proc-macro to the index, it uses a strategy of downloading all packages before doing feature resolution. Then the package can be inspected for the proc-macro field.

This is a fairly major change. A brief overview:
- `PackageSet` now has a `download_accessible` method which tries to download a minimal set of every accessible package. This isn't very smart right now, and errs on downloading too much. In most cases it should be the same (or nearly the same) as before. It downloads extra in the following cases:
    - The check for `[target]` dependencies checks both host and target for every dependency. I could tighten that up a little so build dependencies only check for the host, but it would add some complexity and I wanted to get feedback first.
    - Optional dependencies disabled by the new feature resolver will get downloaded.
- Removed the loop in computing unit dependencies where downloading used to reside.
- When downloading starts, it should now show a more accurate count of how many crates are to be downloaded. Previously the count would fluctuate while the graph is being built.
2020-03-24 17:57:04 +00:00
Alex Tokarev 38aa4a2353 Remove unused transitive dependencies: miniz_oxide, adler32
Fixes #8019
2020-03-23 19:19:29 +03:00
Eric Huss 944f5049f1 Re-implement proc-macro feature decoupling. 2020-03-22 15:08:02 -07:00
bors 92d0ce8069 Auto merge of #8003 - ehuss:proc-macro-index, r=alexcrichton
Add proc-macro to index, and new feature resolver.

This adds the "pm" field to the index so that Cargo can detect which packages contain a proc-macro without downloading the package.

The second commit builds on that to support proc-macros in the new "de-unification" of the new feature resolver. This prevents dependencies shared between proc-macros and other dependency kinds from having features unified.

cc #7915
2020-03-18 14:00:07 +00:00
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