bors [Mon, 19 Dec 2016 17:04:04 +0000 (17:04 +0000)]
Auto merge of #3410 - fmdkdd:fix-3390-message-format-parse-stderr, r=alexcrichton
Fix `--message-format JSON` when rustc emits non-JSON warnings
The `--message-format JSON` flag parses all the stderr output of rustc to JSON,
but rustc can emit non-JSON lines to stderr (e.g., for warning about the
unstable `-Z` flag on the stable channel), causing cargo to fail reporting
compilation errors when using `--message-format JSON`.
This commit adds a check to look for lines beginning with `{` to only parse
these lines as JSON. Other lines from rustc are forwarded to the stderr of
cargo.
fmdkdd [Thu, 15 Dec 2016 23:05:58 +0000 (00:05 +0100)]
Fix `--message-format JSON` when rustc emits non-JSON warnings
The `--message-format JSON` flag parses all the stderr output of rustc to JSON,
but rustc can emit non-JSON lines to stderr (e.g., for warning about the
unstable `-Z` flag on the stable channel), causing cargo to fail reporting
compilation errors when using `--message-format JSON`.
This commit adds a check to look for lines beginning with `{` to only parse
these lines as JSON. Other lines from rustc are forwarded to the stderr of
cargo.
bors [Thu, 15 Dec 2016 03:04:20 +0000 (03:04 +0000)]
Auto merge of #3393 - alexcrichton:fix-libz-linkage, r=brson
Bump libz-sys to 1.0.9
This just switches libz to always link statically instead of relying on the
system zlib. For MinGW it seems that linkage may default pull in a DLL, which is
almost never what we want.
Alex Crichton [Tue, 13 Dec 2016 08:22:00 +0000 (00:22 -0800)]
Bump libz-sys to 1.0.9
This just switches libz to always link statically instead of relying on the
system zlib. For MinGW it seems that linkage may default pull in a DLL, which is
almost never what we want.
Also update curl-sys to fix a build issue on MinGW.
bors [Wed, 14 Dec 2016 07:44:02 +0000 (07:44 +0000)]
Auto merge of #3296 - nrc:check, r=alexcrichton
cargo check
~~This is not finished - the big omission is no tests, and it needs some more testing too. It also requires https://github.com/rust-lang/rust/pull/37681.~~
However, this is my first non-trivial Cargo patch, so I'd like to get some early feedback.
r? @alexcrichton
and cc @rust-lang/tools since this adds a new Cargo sub-command (although we have previously discussed and approved the idea in a tools meeting).
bors [Wed, 14 Dec 2016 03:38:52 +0000 (03:38 +0000)]
Auto merge of #3363 - alexcrichton:libcmt, r=alexcrichton
Compile statically against the MSVC CRT
This updates our AppVeyor builds to compile with `-Ctarget-feature=+crt-static`
to help Cargo be a bit more portable and not rely on the MSVC redistributable
artifacts. Over time this may even let us converge on only releasing one build
of Cargo and just pairing that with all Windows toolchains...
bors [Wed, 14 Dec 2016 02:30:46 +0000 (02:30 +0000)]
Auto merge of #3399 - alexcrichton:fix-nightly, r=alexcrichton
Fix compatibility with Rust nightly
These two tests actually shouldn't have ever passed, but nightly Rust is more
principled about "$OUT_DIR" and doesn't leak it where possible, so these two
tests were accidentally compiling due to leaking '$OUT_DIR' for Cargo itself.
bors [Wed, 14 Dec 2016 01:19:37 +0000 (01:19 +0000)]
Auto merge of #3386 - matklad:warn-replace, r=alexcrichton
Warn if replace is not actually used
closes #3324
I've added warnings to `resolve_dependencies` inside `cargo_compile.rs`. Adding them to `resolve_with_previous` does not work because that method is called several times.
Perhaps the best idea is to refactor resolve facade, such that we have only `ops::resolve` and not `ops::resolve_ws`, `ops::resolve_with_previous` and `ops::resolve_dependencies`. IIRC, there were some bugs because of logic mismatch between `compile` and `metadata` commands.
Alex Crichton [Wed, 14 Dec 2016 01:18:32 +0000 (17:18 -0800)]
Fix compatibility with Rust nightly
These two tests actually shouldn't have ever passed, but nightly Rust is more
principled about "$OUT_DIR" and doesn't leak it where possible, so these two
tests were accidentally compiling due to leaking '$OUT_DIR' for Cargo itself.
Alex Crichton [Fri, 2 Dec 2016 22:34:18 +0000 (14:34 -0800)]
Compile statically against the MSVC CRT
This updates our AppVeyor builds to compile with `-Ctarget-feature=+crt-static`
to help Cargo be a bit more portable and not rely on the MSVC redistributable
artifacts. Over time this may even let us converge on only releasing one build
of Cargo and just pairing that with all Windows toolchains...
Nick Cameron [Wed, 16 Nov 2016 01:46:24 +0000 (14:46 +1300)]
cargo check
Adds a new mode - check - which only checks code, rather than generating machine code. It takes into account that proc macros and build scripts will still require generated code.
Implemented by adding a check profile and setting this on each Unit, unless the unit is required to be built (i.e., is a proc macro, build script, or dep of one).
bors [Thu, 8 Dec 2016 23:55:15 +0000 (23:55 +0000)]
Auto merge of #3221 - euclio:test-all, r=alexcrichton
Add `--all` flag to `cargo test`
Work towards #2878.
This flag allows a user to test all members of a workspace by using `cargo test --all`. The command is also supported when using a virtual workspace manifest.
bors [Wed, 7 Dec 2016 08:11:16 +0000 (08:11 +0000)]
Auto merge of #3361 - pwoolcoc:default-build-script, r=alexcrichton
Assume `build.rs` in the same directory as `Cargo.toml` is a build script (unless explicitly told not to)
So, in May I posted a question in the #cargo IRC room: https://botbot.me/mozilla/cargo/2016-05-26/?msg=66770068&page=1
This PR does what was discussed there. If `cargo` sees a `build.rs` in the same directory as the `Cargo.toml`, it will assume `build.rs` is a build script unless `package.build = false`. Just for completeness I also made `build = true` mean the same as `build = "build.rs"` but I'm not sure if that is okay or not.
bors [Tue, 6 Dec 2016 01:23:17 +0000 (01:23 +0000)]
Auto merge of #3319 - alexcrichton:more-info, r=brson
Emit more info on --message-format=json
This adds more output on Cargo's behalf to the output of
`--message-format=json`. Cargo will now emit a message when a crate is finished
compiling with a list of all files that were just generated along with a message
when a build script finishes executing with linked libraries and linked library
paths.
bors [Fri, 2 Dec 2016 23:39:49 +0000 (23:39 +0000)]
Auto merge of #3356 - ibabushkin:feature-build-rustflags, r=alexcrichton
Implemented string lookup for `build.rustflags` config key
This addresses the immediate issue described in #3052 .
I am, however, unsure about the current state of the deeper issues mentioned in that issue, but if needed, I can take stab at them as well. :)
Paul Woolcock [Fri, 2 Dec 2016 03:42:45 +0000 (22:42 -0500)]
Assume build = 'build.rs' by default
This change makes cargo assume `build = "build.rs"` if there is a
`build.rs` file in the same directory as `Cargo.toml`. However, you
can set `build = false` to prevent this.
Alex Crichton [Wed, 23 Nov 2016 16:29:36 +0000 (08:29 -0800)]
Emit more info on --message-format=json
This adds more output on Cargo's behalf to the output of
`--message-format=json`. Cargo will now emit a message when a crate is finished
compiling with a list of all files that were just generated along with a message
when a build script finishes executing with linked libraries and linked library
paths.
bors [Fri, 2 Dec 2016 14:37:52 +0000 (14:37 +0000)]
Auto merge of #3348 - alexcrichton:fix-checksums, r=brson
Fix retrying crate downloads for network errors
Previously the `with_retry` loop was a little too tight where stale state about
the sha256 and data was kept out of the loop. Instead we need to reinitialize
these on each iteration of the loop to ensure that we correctly retry by
forgetting the data we previously downloaded for an aborted download attempt.
bors [Fri, 2 Dec 2016 12:15:18 +0000 (12:15 +0000)]
Auto merge of #3335 - alexcrichton:fix-xcomiple, r=brson
Add host dependency path via -L for cross compiles
Now that proc-macro crates can reexport from their dependencies we need to be
able to find the other crates, so ensure that we pass an appropriate -L flag.
Alex Crichton [Mon, 28 Nov 2016 15:27:14 +0000 (07:27 -0800)]
Add host dependency path via -L for cross compiles
Now that proc-macro crates can reexport from their dependencies we need to be
able to find the other crates, so ensure that we pass an appropriate -L flag.
bors [Fri, 2 Dec 2016 03:20:54 +0000 (03:20 +0000)]
Auto merge of #3336 - alexcrichton:fix-warning, r=brson
Test for bad path overrides with summaries
Bad path overrides are currently detected to issue warnings in cases where path
overrides are not suitable and have exhibited buggy behavior in the past.
Unfortunately though it looks like some false positives are being issued,
causing unnecessary confusion about `paths` overrides.
This commit fixes the detection of these "bad path overrides" by comparing
`Summary` dependencies (what's written down in `Cargo.toml`) rather than
comparing the `Cargo.toml` of the override with `Cargo.lock`. We're guaranteed
that the package we're overridding has already been resolved into `Cargo.lock`,
so we know that if the two `Cargo.toml` files are equivalent we'll continue
with the same crate graph.
I'm not actually entirely sure why I originally thought it'd be better to go
through the `Cargo.lock` comparison route. Unfortunately that doesn't take into
account optional deps which aren't in `Cargo.lock` but are in `Cargo.toml` of
the override, causing the false positive. This method, however, simply ensures
that the two dependency lists are the same.
bors [Fri, 2 Dec 2016 00:05:12 +0000 (00:05 +0000)]
Auto merge of #3310 - alexcrichton:more-metadata-hashing, r=brson
Apply new fingerprinting to build dir outputs
We now much more aggressively cache the output of the compiler based on feature
sets and profile configuration. Unfortunately we forgot to extend this caching
to build script output directories as well so this commit ensures that build
script outputs are cached the same way with a directory per configuration of
features and output settings.
bors [Thu, 1 Dec 2016 07:49:11 +0000 (07:49 +0000)]
Auto merge of #3350 - alexcrichton:more-tweaks, r=alexcrichton
Slight tweaks to CI
* Pass `--quiet` to all tests to have some quieter output
* Skip builds on the `master` branch as `auto` is already checked
* Check the right env var for repo branches on appveyor
Alex Crichton [Wed, 30 Nov 2016 19:12:49 +0000 (11:12 -0800)]
Slight tweaks to CI
* Pass `--quiet` to all tests to have some quieter output
* Skip builds on branches other than `auto-cargo` as it's already checked
* Check the right env var for repo branches on appveyor
* Only run a few builds on PRs
Alex Crichton [Wed, 30 Nov 2016 00:52:20 +0000 (16:52 -0800)]
Fix retrying crate downloads for network errors
Previously the `with_retry` loop was a little too tight where stale state about
the sha256 and data was kept out of the loop. Instead we need to reinitialize
these on each iteration of the loop to ensure that we correctly retry by
forgetting the data we previously downloaded for an aborted download attempt.
bors [Wed, 30 Nov 2016 18:16:39 +0000 (18:16 +0000)]
Auto merge of #3345 - alexcrichton:release-branches, r=alexcrichton
Add support for release branches in Cargo
Follow the same strategy as the compiler for now in basically every respect:
* Add new `--release-channel` configure option, defaulting to `dev`
* Remove old `--enable-nightly`
* Add `--enable-build-openssl` as an orthogonal option
* Hook up Travis/AppVeyor to stable/beta/master branches to do the right
channel builds.