1079 Commits

Author SHA1 Message Date
Eric Huss
06bffb59a7 Bump versions of local deps. 2021-12-03 11:05:03 -08:00
Russ Weas
effc72042b Implement glob escaping for clean -p
Implement glob escaping for clean -p

Add pattern escape for glob matching cargo clean files

Implement correct solution for #10068

Removed superfluous formatting changes

Update rm_rf_glob()'s error handling

Remove dir_glob reference for non-glob function

Added test

Satisfy clippy

Add MSVC support for test
2021-11-16 16:55:23 -06:00
bors
dc6a1d5304 Auto merge of #10000 - alexcrichton:upgrade-edition, r=Eh2406
Upgrade Cargo to the 2021 edition

While I was poking around in the manifests I also went ahead and removed the `authors` entries since at least the one for Cargo itself is quite outdated and Cargo otherwise doesn't use these any more.
2021-10-23 18:08:27 +00:00
Sebastian Thiel
cf8e464d6f
Do not canonicalize the exe-candidate at all
And here is why: https://github.com/rust-lang/cargo/pull/9991#issuecomment-949727679
2021-10-23 15:29:47 +08:00
Alex Crichton
cab1e3566b Fix CI testing 2021-10-22 13:30:46 -07:00
Alex Crichton
c687d83ada Remove authors directives from Cargo crates
Most of these are pretty dated and Cargo defaults nowadays to not
emitting an `authors` field so this commit also removes them from the
manifests.
2021-10-22 10:27:20 -07:00
Alex Crichton
cabe1cca0a Upgrade Cargo to the 2021 edition
This didn't actually result in any code changes yet, for now this simply
flips the edition flag for all of our crates and documentation.
2021-10-22 10:25:52 -07:00
Sebastian Thiel
4906ef2364
Assure the binary name won't change after canonicalization, and keep looking if it does. 2021-10-21 18:21:18 +08:00
Sebastian Thiel
0d06193bf1
Only canonicalize executable path if it has relative directories
Otherwise symbolic links may also accidentally be resolved which may
lead to unexpected results in the case of 'coreutils', a binary
that depends on the executable name being a symbolic link.

This means a path like /bin/echo being canonicalized to /bin/coreutils
will loose all information about the desired functionality.

Test failures will occur if 'echo' is resolved that way and it's
not trivial to find the cause of it in the provided error messages.
2021-10-21 17:03:58 +08:00
Vaibhav
bef4d79ff2 Print executable name on cargo test --no-run.
Closes #9957

Signed-off-by: Vaibhav <vrongmeal@gmail.com>
2021-10-05 23:47:38 +05:30
Eric Huss
422d5b030c Enable some tests on windows. 2021-09-08 23:34:37 -07:00
Weihang Lo
0afd40b4de
Update tests to display dep-req info for dep-chain 2021-08-24 00:39:38 +08:00
Nipunn Koorapati
5a56cf2e5b Refactor echo cargo subcommand test helper into cargo-test-support 2021-08-14 22:37:54 -07:00
Nipunn Koorapati
dde290e6ff Refactor fake_file() away from cargo_command tests
There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.
2021-08-05 19:09:58 -07:00
Erick Tryzelaar
f71b231aea Update cargo-platform to 0.1.2
This preps cargo-platform for a release. The only substantial change is that
this should include the license files into the archive that is uploaded to
crates.io.

Closes #9758
2021-08-04 16:13:04 -07:00
Eric Huss
70a607eaa7 Remove nbsp characters. 2021-07-30 15:40:37 -07:00
Eric Huss
4fbf61da10 Bump cargo-util version. 2021-07-29 09:23:23 -07:00
Alik Aslanyan
8ee76f6082
Weather is not nice today.. 2021-07-23 17:15:14 +04:00
Dustin J. Mitchell
76a079cbd9 Factor version preferences into a struct
This concentrates all of the "prefer this version" logic previously
handled with `try_to_use` and `prefer_patch_deps` parameters into a
struct that hides both the reason a package version might be preferred
and the form that preference took (Dependency or PackageId).  Besides
simplifying `RegistryQuerier::query` slightly, this invites further
refinements to version preferences to support new cargo features.
2021-07-18 21:05:16 +00:00
bors
f8ba1cbfcb Auto merge of #9639 - djmitche:issue9535, r=Eh2406
Prefer patched versions of dependencies

When selecting among several versions of a paackage, prefer versions
from `[patch]` sections over other versions, similar to how locked
versions are preferred.

Patches come in the form of a Dependency and not a PackageId, so this
preference is expressed with `prefer_patch_deps`, distinct from
`try_to_use`.

Fixes #9535
2021-07-14 19:14:22 +00:00
Eric Huss
b67454c660 Make it easier to run testsuite with a custom toolchain. 2021-07-11 14:02:47 -07:00
Dustin J. Mitchell
bd4a353e98 Prefer patched versions of dependencies
When selecting among several versions of a paackage, prefer versions
from `[patch]` sections over other versions, similar to how locked
versions are preferred.

Patches come in the form of a Dependency and not a PackageId, so this
preference is expressed with `prefer_patch_deps`, distinct from
`try_to_use`.
2021-07-09 18:23:21 +00:00
Eric Huss
28c3bef71a Include the linker in the fingerprint. 2021-07-01 20:33:48 -07:00
Toothbrush
c973a6d0af
rustfmt 2021-06-29 18:18:28 +01:00
Toothbrush
684391e444
Change if cfg!(..) { } to #[cfg!(..)] { }
This fixes builds on non-Windows platforms.
2021-06-29 17:19:14 +01:00
Toothbrush
f1c8e56909
Format exclude_from_content_indexing 2021-06-28 21:45:59 +01:00
Toothbrush
9d96a88961
Exclude target from content-indexing on Windows
This has a noticeable performance improvement for most projects, especially when the storage device is a hard drive.

Closes #8694
2021-06-28 20:12:44 +01:00
Eric Huss
c0dca04f49 Disambiguate is_symlink. 2021-06-19 11:27:14 -07:00
Tomasz Miąsko
8df771f381 Avoid quadratic complexity when splitting output into lines
When searching for newlines in a process output keep track which part of
buffer was already examined to avoid processing the same data again and
again.
2021-06-18 20:00:55 +02:00
Tomasz Miąsko
9f60fcacaf Simplify line splitting code in exec_with_streaming NFC 2021-06-18 20:00:55 +02:00
Eric Huss
16b5402fd7 testsuite: Switch to colored diffs with Myers diff. 2021-06-16 15:43:29 -07:00
Eric Huss
205148e645 Only normalize paths on windows.
I don't trust that all these transformations won't have unintended
consequences on other platforms. It is nice to verify there aren't any
backslash shenanigans on other platforms.
2021-06-16 10:35:26 -07:00
Eric Huss
aea5ca3ca0 Remove the double-backslash escape for matching.
Using `with_json` is safer since it knows what JSON escaping is.
2021-06-16 09:44:29 -07:00
Eric Huss
b73e3d4fa5 Don't export lines_match.
Use better high-level interfaces to achieve the same thing.
2021-06-16 09:44:29 -07:00
Eric Huss
24b8936c20 Remove normalized_lines_match, it is not needed. 2021-06-16 09:44:29 -07:00
Eric Huss
6dff99781d Remove with_either_contains.
It isn't needed anymore, and I would prefer to not keep around unused code.
It can always be added back if ever needed again.
2021-06-16 09:44:29 -07:00
Eric Huss
e132bb53ab Move comparison and diffing code to a new module.
This includes various minor refactorings to try to clean things up
and provide better error messages.
2021-06-16 09:44:29 -07:00
Eric Huss
0f5deb64f9 testsuite: Support anyhow error chains in error messages.
This is intended to help with adding more usage of anyhow in the
testsuite, which can help show context for errors.

This also includes some small improvements to the error messages to
provide more information.
2021-06-16 09:44:28 -07:00
Eric Huss
2021865d88 Remove some unused code. 2021-06-15 15:38:02 -07:00
Eric Huss
393077f968 Add run_json to Execs.
This is a helper to run the process and return a JSON object.
2021-06-11 16:07:20 -07:00
Eric Huss
3be34cb834 Remove "Expected: execs" from testsuite error.
That message was not helpful.
2021-06-11 15:25:50 -07:00
Eric Huss
0f304ca450 Fix verify_checks_output.
This was accidentally broken in
cc5e9df64a
causing it to not check in the error case (which is the only case that mattered).
2021-06-11 13:12:30 -07:00
Eric Huss
5d1b0f9c43 Switch cargo-test-support to anyhow. 2021-06-11 12:37:27 -07:00
Eric Huss
7b229bbe39 Move the rustc-echo-wrapper to be shared across tests.
This helps avoid rebuilding the same project several times.
2021-06-09 17:13:33 -07:00
Weihang Lo
df82a44f9e
refactor: extract common make_dep_path to cargo_util 2021-06-01 11:14:53 +08:00
David Tolnay
396bdd3a89
Remove parsing of broken version syntax from 5 years ago 2021-05-26 14:37:39 -07:00
bors
070e459c2d Auto merge of #9468 - PaulDance:fix-rustdoc-warnings, r=ehuss
Fix rustdoc warnings

Change some small parts of the unit documentation in order to resolve warnings emitted when running `cargo doc` from the root of this project. It should help reduce the noise when checking that new or updated documentation builds correctly.

See the commit messages for details about the modifications themselves, although they should be rather simple.

Cheers,
Paul.
2021-05-11 18:12:23 +00:00
Paul Mabileau
a5b4b4710a
Bump url to 2.2.2 where Into<String> for Url is used
The base package, `cargo-test-support` and `mdman`.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-10 22:20:11 +02:00
Paul Mabileau
c021ba9acf
Fix Url::into_string deprecation warning
`url::Url::into_string` is deprecated. The `Into<String>` implementation
is now used.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-10 22:19:00 +02:00
Paul Mabileau
9ea1cbdeda
Fix doc warnings for cargo-util::paths
Add parentheses to disambiguate from `write!`.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2021-05-09 19:47:08 +02:00