245 Commits

Author SHA1 Message Date
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
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