bors [Thu, 1 Nov 2018 23:39:13 +0000 (23:39 +0000)]
Auto merge of #6247 - alexcrichton:fix-less, r=dwijnand
Don't turn on edition lints for unfixed crates
Currently Cargo runs the risk of turning on the edition lints for crates
which `cargo fix` isn't actually fixing, which means you'll get a huge
deluge of lints that would otherwise be automatically fixable! Fix this
situation by only enabling lints in the same cases that we're actually
applying fixes.
bors [Thu, 1 Nov 2018 22:36:33 +0000 (22:36 +0000)]
Auto merge of #6243 - btashton:strip_email_bracket, r=alexcrichton
Strip angle brackets from author email before passing to template.
Some people already have angle brackets around their email in
git settings or other author sources. Right now if you create
a new project the Cargo.toml would render something like:
`authors = ["bar <<foo@baz>>"]`
instead of
`authors = ["bar <foo@baz>"]`
This detects the emails that start and end with `<>` and removes them.
Brennan Ashton [Wed, 31 Oct 2018 20:07:02 +0000 (13:07 -0700)]
Strip angle brackets from author email before passing to template.
Some people already have angle brackets around their email in
git settings or other author sources. Right now if you create
a new project the Cargo.toml would render something like:
authors = ["bar <<foo@baz>>"]
instead of
authors = ["bar <foo@baz>"]
This detects the emails that start and end with <> and removes them.
Alex Crichton [Thu, 1 Nov 2018 15:13:11 +0000 (08:13 -0700)]
Don't turn on edition lints for unfixed crates
Currently Cargo runs the risk of turning on the edition lints for crates
which `cargo fix` isn't actually fixing, which means you'll get a huge
deluge of lints that would otherwise be automatically fixable! Fix this
situation by only enabling lints in the same cases that we're actually
applying fixes.
bors [Sun, 28 Oct 2018 20:11:57 +0000 (20:11 +0000)]
Auto merge of #6233 - dtolnay:erase, r=alexcrichton
Use ANSI escape code to clear line
This eliminates the trailing spaces that Cargo used to use for clearing a line of output. Trailing spaces are problematic because they take up space on the next line when reducing the width of a terminal.
David Tolnay [Sun, 28 Oct 2018 18:39:37 +0000 (11:39 -0700)]
Use ANSI escape code to clear line
This eliminates the trailing spaces that Cargo used to use for clearing
a line of output. Trailing spaces are problematic because they take up
space on the next line when reducing the width of a terminal.
bors [Fri, 19 Oct 2018 13:31:31 +0000 (13:31 +0000)]
Auto merge of #6164 - luser:build-script-output-prefix, r=alexcrichton
Prefix build script output with crate name when running in extra verbose mode. Fixes #6158.
cargo's extra verbose mode is useful for getting detailed information out of
builds in CI where it can be difficult to examine the build environment
after-the-fact. However, when multiple build scripts are running as part of a
build it's not always clear what output is from which build script. This patch
makes cargo prefix each line of build script output with the crate name
in this case.
Ted Mielczarek [Tue, 9 Oct 2018 20:30:13 +0000 (16:30 -0400)]
Prefix build script output with crate name when running in extra verbose mode. Fixes #6158.
cargo's extra verbose mode is useful for getting detailed information out of
builds in CI where it can be difficult to examine the build environment
after-the-fact. However, when multiple build scripts are running as part of a
build it's not always clear what output is from which build script. This patch
makes cargo prefix each line of build script output with the crate name and
version this case.
bors [Wed, 17 Oct 2018 21:25:24 +0000 (21:25 +0000)]
Auto merge of #6147 - dwijnand:issue-templates, r=JoshTriplett
Introduce issue templates
I took GitHub's default "Bug report" and "Feature request" templates and modified them a bit to make them work with Cargo. Happy to iterate more. WDYT?
bors [Wed, 17 Oct 2018 18:33:54 +0000 (18:33 +0000)]
Auto merge of #6175 - alexheretic:compile_package_errors, r=alexcrichton
Add PackageError wrappers for activation errors
Similarly to #6157 this wraps compile errors with `PackageId` info to allow lib users, in this case rls, to discern where something went wrong.
In particular if a dependency has a dodgy version or doesn't exist the error chain will now contain a <s>PackageError that provides the package id</s> `ResolveError` that provides the package path from error-parent -> root. From this I figure out if the error better relates to a workspace member, and target that manifest for diagnostics.
bors [Mon, 15 Oct 2018 16:35:38 +0000 (16:35 +0000)]
Auto merge of #6170 - ehuss:panic-in-unit, r=alexcrichton
Track `panic` in Unit early.
This is an alternate solution for #5445. It ensures that `panic` is cleared in the Profile for "for_host" targets (proc-macro/plugin/build-scripts) and dependencies. This helps avoid unnecessary recompiles in some situations (though does add extra units in some situations, see below).
Some examples where extra rebuilds are now avoided:
* A workspace with a dependency shared with normal and build-deps. `build --all` should build everything, and then `build -p foo` was causing a recompile because the shared dep was no longer in the `used_in_plugin` set. Now it should not recompile.
* `panic=abort`, with a shared dependency in build and dev, `build` would cause that shared dependency to be built twice (exactly the same without panic set). Now it should only build once.
Some examples where `panic` is now set correctly:
* `panic=abort`, with a binary with a shared dependency in build and normal, `test` would cause that shared dependency to be built twice (exactly the same without panic set). Now it is still built twice, but the one for the normal (bin) dependency will correctly have `panic` set.
Some examples where new units are now generated:
* `panic=abort`, with shared dependency between normal and proc-macro or build. Previously the shared dependency was built once with `panic=unwind`. Now it is built separately (once with `panic`, once without). I feel like that this is more correct behavior — that now the normal dependency avoids adding landing pads.
For `panic=abort` cross-compiling, this makes no difference in compile time since it was already built twice.
Additional notes:
- I left build-scripts with the old behavior where `panic` is cleared for it and all its dependencies. There could be arguments made to change that (#5436), but it doesn't seem important to me.
- Renamed and refactored `ProfileFor` to `UnitFor`. I expect this API to continue to evolve in the future.
bors [Sat, 13 Oct 2018 01:28:51 +0000 (01:28 +0000)]
Auto merge of #6157 - alexheretic:member-manifest-error, r=alexcrichton
Expose manifest error chain in CargoErrors
Adds new `ManifestError`s to the `CargoError` causal chain. These errors pass on their display, but provide more detail on which manifests are at fault when failing to build a `Workspace`. This is useful for lib users, in particular rls, allowing lookup of a particular manifest file that caused the error. See #6144.
For example a workspace _foo_ where a member _bar_ has an invalid toml manifest would have the error chain:
- failed to parse manifest at `/home/alex/project/foo/bar/Cargo.toml`
_ManifestError: /home/alex/project/foo/Cargo.toml_
- failed to parse manifest at `/home/alex/project/foo/bar/Cargo.toml`
_ManifestError: /home/alex/project/foo/bar/Cargo.toml_
- failed to parse manifest at `/home/alex/project/foo/bar/Cargo.toml`
- could not parse input as TOML
- expected a value, found an equals at line 8
This will allow rls to point to a particular workspace member's manifest file when that manifest fails to deserialize, has invalid paths, etc.
bors [Fri, 12 Oct 2018 03:53:43 +0000 (03:53 +0000)]
Auto merge of #6167 - ehuss:fix-dylib-feature-flip, r=alexcrichton
Fix dylib reuse with uplift.
Due to #5460, the files that are copied to the root of the target dir depend on whether or not it is a direct target. This causes a problem with dylibs if you build a dylib directly, and then separately run a target that depends on that dylib. It will run with the dylib path preferring the root dir, which picks up the old dylib. This PR swaps the preference of the dylib search path so that the dylib in the `deps` dir is preferred.
This is maybe not the best solution for dynamic dependencies. I can imagine if you are trying to create a package, you'll want all of the shared libs along with the binary, and digging through the `deps` dir is not optimal. However, unconditionally linking dependencies into the root has issues (which #5460 fixed). There are other issues because shared libs do not include a hash in the filename. A grander solution might involve coming up with a better strategy for organizing the `target` directory to avoid conflicts between targets.
bors [Fri, 12 Oct 2018 01:43:10 +0000 (01:43 +0000)]
Auto merge of #6166 - alexcrichton:debug-curl, r=ehuss
Add convenience debugging for HTTP requests in Cargo
This is something we probably should have added long long ago given the
number of network issues that arise over time. This adds a new
configuration setting for Cargo, `http.debug`, which activates curl's
`verbose` interface which prints out information like redirects and
headers flying back and forth. This is by default routed through Cargo's
normal debug logging facilities, meaning one way to use this could be:
and you should get lots of nice verbose logs as a result! This should
hopefully make it much easier to remotely debug HTTP issues as we can in
theory do a lot less guessing and a lot more manual inspection.
Alex Crichton [Thu, 11 Oct 2018 21:12:03 +0000 (14:12 -0700)]
Add convenience debugging for HTTP requests in Cargo
This is something we probably should have added long long ago given the
number of network issues that arise over time. This adds a new
configuration setting for Cargo, `http.debug`, which activates curl's
`verbose` interface which prints out information like redirects and
headers flying back and forth. This is by default routed through Cargo's
normal debug logging facilities, meaning one way to use this could be:
and you should get lots of nice verbose logs as a result! This should
hopefully make it much easier to remotely debug HTTP issues as we can in
theory do a lot less guessing and a lot more manual inspection.
bors [Thu, 11 Oct 2018 20:52:12 +0000 (20:52 +0000)]
Auto merge of #6165 - Eh2406:cleanup, r=alexcrichton
small cleanups to registry tests
This should make the slow proptest tests approximately 10x faster. It also adds a test ensuring that we make fuzz inputs that involve multiple versions of the same library.
bors [Mon, 8 Oct 2018 15:58:57 +0000 (15:58 +0000)]
Auto merge of #6149 - Eh2406:proptest, r=alexcrichton
proptest basic validation
This adds a function for testing that the output of the resolver is basically reasonable. This function has the same signature as the function for running the resolver in a test. So it is easy to switch back and forth, depending on the thoroughness vs speed tradeoff. This also adds a proptest/fuzz that runs this validation against arbitrary registry.
bors [Sat, 6 Oct 2018 17:28:40 +0000 (17:28 +0000)]
Auto merge of #6141 - dwijnand:detail-dep-name-in-invalid-version-error, r=alexcrichton
Detail dep name in invalid version error
Fixes #2146
I struggled with some aspects of Rust's pattern matching syntax & the borrow-checker, as well as the types and API of failure, so... this is the "I got it to compile" version-I'd love tips/advice to clean it up. (soft-cc @withoutboats?).
bors [Fri, 5 Oct 2018 14:58:07 +0000 (14:58 +0000)]
Auto merge of #6132 - Xanewok:bump-libgit2-sys, r=Eh2406
Bump libgit2-sys to 0.7.9
For some reason I couldn't compile with newest nightly `rustc 1.31.0-nightly (5597ee8a6 2018-10-03)`:
```
error: failed to run custom build command for `libgit2-sys v0.7.7`
process didn't exit successfully: `/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-f38ab3eb27549370/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/home/xanewok/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.7.7/libgit2" "-DGIT_SSH_MEMORY_CREDENTIALS=1" "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_CLAR=OFF" "-DCMAKE_INSTALL_PREFIX=/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-e96505b09ca81ecd/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Debug"
-- The C compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM - Success
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC - Failed
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_NSEC
-- Performing Test HAVE_STRUCT_STAT_NSEC - Success
-- Performing Test IS_WALL_SUPPORTED
-- Performing Test IS_WALL_SUPPORTED - Success
-- Performing Test IS_WEXTRA_SUPPORTED
-- Performing Test IS_WEXTRA_SUPPORTED - Success
-- Performing Test IS_WDOCUMENTATION_SUPPORTED
-- Performing Test IS_WDOCUMENTATION_SUPPORTED - Failed
-- Performing Test IS_WNO-MISSING-FIELD-INITIALIZERS_SUPPORTED
-- Performing Test IS_WNO-MISSING-FIELD-INITIALIZERS_SUPPORTED - Success
-- Performing Test IS_WSTRICT-ALIASING_SUPPORTED
-- Performing Test IS_WSTRICT-ALIASING_SUPPORTED - Success
-- Performing Test IS_WSTRICT-PROTOTYPES_SUPPORTED
-- Performing Test IS_WSTRICT-PROTOTYPES_SUPPORTED - Success
-- Performing Test IS_WDECLARATION-AFTER-STATEMENT_SUPPORTED
-- Performing Test IS_WDECLARATION-AFTER-STATEMENT_SUPPORTED - Success
-- Performing Test IS_WSHIFT-COUNT-OVERFLOW_SUPPORTED
-- Performing Test IS_WSHIFT-COUNT-OVERFLOW_SUPPORTED - Success
-- Performing Test IS_WNO-UNUSED-CONST-VARIABLE_SUPPORTED
-- Performing Test IS_WNO-UNUSED-CONST-VARIABLE_SUPPORTED - Success
-- Performing Test IS_WNO-UNUSED-FUNCTION_SUPPORTED
-- Performing Test IS_WNO-UNUSED-FUNCTION_SUPPORTED - Success
-- Looking for regcomp_l
-- Looking for regcomp_l - not found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for qsort_r
-- Looking for qsort_r - found
-- Looking for qsort_s
-- Looking for qsort_s - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Checking for module 'libcurl'
-- Found libcurl, version 7.61.1
-- Configuring incomplete, errors occurred!
See also "/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-e96505b09ca81ecd/out/build/CMakeFiles/CMakeOutput.log".
See also "/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-e96505b09ca81ecd/out/build/CMakeFiles/CMakeError.log".
--- stderr
fatal: not a git repository (or any of the parent directories): .git
CMake Error at cmake/Modules/FindPkgLibraries.cmake:17 (MESSAGE):
could not resolve curl
Call Stack (most recent call first):
src/CMakeLists.txt:120 (FIND_PKGLIBRARIES)
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', /home/xanewok/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.29/src/lib.rs:632:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
on Xubuntu 18.04.1.
Simply bumping `libgit2-sys` seemed to have fixed the problem, so... :man_shrugging:
bors [Fri, 5 Oct 2018 03:49:06 +0000 (03:49 +0000)]
Auto merge of #6134 - Eh2406:dead-code, r=alexcrichton
remove dead code, use impl Iterator instead of custom types, cargo fmt
This is a mishmash of things. `Graph::sort` was unused so I removed it. There are a bunch of custom types that allow us to return iterators that can now be replaced with `impl Iterator`. jetbrains wanted to reorder some impls to match the definition. fmt also made some changes to the files I opened.
bors [Wed, 3 Oct 2018 02:54:55 +0000 (02:54 +0000)]
Auto merge of #6112 - alexcrichton:better-errors, r=Eh2406
Try to improve "version not found" error
This commit tweaks the wording for when versions aren't found in a
source, notably including more location information other than the
source id but rather also taking into account replaced sources and such.
It's hoped that this gives more information to make it a bit more clear
what's going on.
bors [Wed, 3 Oct 2018 02:11:37 +0000 (02:11 +0000)]
Auto merge of #6122 - ehuss:msys-width, r=alexcrichton
Second attempt at fixing msys terminal width.
Lock the max width on msys-based terminals to 60. I tried a lot of different
things, but I was unable to find a way to detect the correct width in mintty.
Unfortunately this means that terminals that work correctly like ConEmu will
also be capped at 60. C'est la vie.
Of course this does not affect cmd, powershell, etc.