Commit graph

528 commits

Author SHA1 Message Date
Eric Huss b85ef38187 Add test helpers for waiting for an operation with a timeout. 2023-10-08 14:16:51 -07:00
Eric Huss 83fff2d1b1 Add a test helper for retrying a function multiple times. 2023-10-08 14:16:51 -07:00
Ed Page 03a642b1d8 fix: Set MSRV in all published packages 2023-10-06 16:34:42 -05:00
Tobias Bieniek 9e5dac18b9
crates.io: Bump version to 0.39.1 2023-10-06 16:11:38 +02:00
Tobias Bieniek e287f43006
crates-io: Add doc comment for NewCrate struct 2023-10-06 14:04:03 +02:00
Ed Page 72f4f0cb3f chore: Simplify releasing home
I'm not seeing any benefit derived by `html_root_url`
2023-10-02 12:13:49 -05:00
bors 9a94183771 Auto merge of #12744 - tompscanlan:atomic-write, r=epage
fix bug: corruption when cargo killed while writing

### What does this PR try to resolve?

fix  #11386, superseding #12362

### How should we test and review this PR?

Added unit test showing basic equivalency to existing `write(path, content)`. Full test suite should exercise write.
Added tests for cargo add and remove. These are timing tests, so take a bit of time to run. 5-10s each.  They may not fail every time, but do so regularly.  Making the change to these two writes seems to prevent me from failing these tests at all.

### Additional information

This uses tempfile::persist which was an existing dependency. atomicwrites crate, an alternative option for this fix, indicates `tempfile::persist` is the same thing.  Since we already use tempfile as a dep, I stuck with that.
2023-10-02 13:34:00 +00:00
Tom Scanlan aee8c75410
bug: corruption when killed while writing 2023-10-01 08:29:24 -04:00
Ed Page 37c6f3d085 fix(test): Add back in newlines to diffs
Errors like this aren't too helpful
```
error: stderr did not match:
1   1     error: failed to parse manifest at `[..]`2   2     3   3     Caused by:4   4       TOML parse error at line 3, column 275   5         |6   6       3 |                 version = 17
  7         |                           ^8        -  invalid type: integer `1`, expected SemVer version    8    +  invalid type: integer `1`, expected a string or workspace
```

This was broken in #12581
2023-09-29 20:02:53 -05:00
Ed Page 796398563a refactor(test): Switch termcolor to anstream 2023-09-29 10:16:15 -05:00
cui fliter c8f4d234bb Fix some typos
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-09-24 23:10:07 +08:00
Eric Huss ebea09d8f4 Fix spurious errors with networking tests. 2023-09-22 13:37:26 -07:00
Eric Huss 495ed7ebe2 Add a summary to cargo clean.
This adds a summary at the end when `cargo clean` finishes that displays
how many files and bytes were removed.
2023-09-19 18:16:40 -07:00
bors f9335babbc Auto merge of #12707 - epage:spell, r=ehuss
chore: Fix typos

This is a repeat of #11561
2023-09-19 22:07:03 +00:00
Jacob Finkelman 679d65103f shortest path is probably more informative than random path for error messages 2023-09-19 20:39:02 +00:00
Ed Page e4e10f2393 chore: Fix typos
This is a repeat of #11561
2023-09-19 15:28:48 -05:00
Jacob Finkelman 245e69ce10 add a test for shortest path 2023-09-19 20:22:13 +00:00
Ed Page 4135f562b8 refactor(manifest): Clarify the specialized role of RustVersion 2023-09-13 21:59:26 -06:00
Weihang Lo 463622ad81
lint: fix errors for self-named module files 2023-09-14 13:43:48 +08:00
Weihang Lo aef3bd22d3
lint: fix errors for rust 2018 idioms 2023-09-14 13:43:48 +08:00
Weihang Lo 437942ee7e
lint: use eprintln for human-facing outputs 2023-09-14 13:43:47 +08:00
Weihang Lo f9d82a1703
lint: remove unused dbg! 2023-09-14 13:43:47 +08:00
Jacob Finkelman 205fd1a765 libgit2 fixed upstream 2023-09-11 19:25:45 +00:00
Jacob Finkelman 2b2838302f bump cargo-platform 2023-09-08 19:16:42 +00:00
Jacob Finkelman 44666f7377 Ues strip_prefix for cleaner code 2023-09-07 17:57:28 +00:00
Weihang Lo e575448574
refactor: flatten module path of SourceId 2023-09-07 21:06:35 +08:00
Weihang Lo b6c4e47cc0
refactor: put Source trait under cargo::sources 2023-09-07 21:06:34 +08:00
bors baca00ebe1 Auto merge of #12636 - ehuss:fs-metadata-wrappers, r=weihanglo
Add wrappers around std::fs::metadata

This adds wrappers around `std::fs::metadata` and `std::fs::symlink_metadata` which provide better error messages indicating the path that caused the error. This just helps clean up some duplicated code, and is also going to be used to assist with some code changes in #12634.
2023-09-07 08:54:50 +00:00
bors 282424e42d Auto merge of #12635 - ehuss:with-stdout-unordered, r=weihanglo
Add with_stdout_unordered.

This adds the `with_stdout_unordered` method to cargo's test system so that tests can use it to check stdout but ignoring the order of lines. Nothing in this PR actually uses this method, but it is added to support #12634. I also expect it could potentially be useful in other cases in the future.
2023-09-07 06:26:51 +00:00
Eric Huss 62d86470d1 Add wrappers around std::fs::metadata
This adds wrappers around std::fs::metadata and
std::fs::symlink_metadata which provide better error messages indicating
the path that caused the error.
2023-09-06 21:41:54 -07:00
Eric Huss 0adb9f1b2a Add with_stdout_unordered.
This adds Execs::with_stdout_unordered to check stdout ignoring the
order of lines.
2023-09-06 21:40:56 -07:00
Eric Huss 8964f3fd5d Fix example for creating a git project test. 2023-09-06 18:56:12 -07:00
bors cff6d19f6e Auto merge of #12615 - Eh2406:split_once, r=epage
use split_once for cleaner code

### What does this PR try to resolve?

Search the code base for `.splitn(2` and replace with `.split_once` where it was clearer. I don't think any of them matter in practice.

### How should we test and review this PR?

This was an internal re-factor, and the tests still pass.
The two methods have subtly different semantics, so please review carefully.
2023-09-03 02:27:49 +00:00
Jacob Finkelman 1ea81a3692 use split_once for cleaner code 2023-09-01 21:45:55 +00:00
Jacob Finkelman 16b330bc59 stop using lazy_static 2023-09-01 21:38:03 +00:00
Ed Page 4820624ce7 feat(resolver): Respect MSRV 2023-08-25 10:42:26 -05:00
bors f797978283 Auto merge of #12553 - epage:version, r=weihanglo
refactor: Pull out cargo-add MSRV code for reuse

### What does this PR try to resolve?

#12078 added MSRV code in `cargo add`. Our assumption when writing it is that we'd need to generalize the code before reusing it in other places, like `cargo install`.  This PR focused purely on that refactor because I'm hopeful it will be useful for other work I'm doing.  Despite not having a user for this yet, I think the `cargo install` case is inevitable and I feel this does a bit to clean up MSRV related code by using a more specific type everywhere.

### How should we test and review this PR?

Each commit gradually progresses things along
2023-08-25 14:56:24 +00:00
Deadbeef b2b34e4ca2 update tests 2023-08-25 01:43:29 +00:00
Deadbeef 3d50f47197 Add fields for bindeps on the registry 2023-08-25 01:43:29 +00:00
Ed Page 423a334520 refactor: Parse, don't validate, rust_version
By using the `PartialVersion` type with serde, we get the context for
the error automatically.
2023-08-24 14:15:35 -05:00
Ed Page 7a65c826a0 fix: Set MSRV for internal packages
For now, I'm punting on packages we generally expect others to use
2023-08-22 16:46:47 -05:00
Ed Page 576f901f81 fix(log): Use a more compact relative-time format
This changes logged messages from
```
2023-08-23T01:01:59.922018Z DEBUG cargo::core::compiler::fingerprint: filesystem up-to-date "/home/epage/src/personal/dump"
```
To
```
   0.041729583s DEBUG cargo::core::compiler::fingerprint: filesystem up-to-date "/home/epage/src/personal/dump"
```
Benefits
- Less horizontal space taken up in boilerplate
- Easier to compare within a run

Downsides
- Harder to correlate with other processes, like with crates.io server
  operations

This gives us up to 4 digits for seconds which should be sufficient for
cargo build times.

We could make this more compact by dropping the digits of precision from
9 to 6 but that would require a custom Timer which might be a paint to
keep in sync between packages.
2023-08-22 20:34:07 -05:00
Eric Huss 96da3c4872 Support hidden lines. 2023-08-17 18:18:10 -07:00
Eric Huss 4c1d8f1364 Document the special code block annotations. 2023-08-17 18:18:10 -07:00
Arlo Siemsen 763edbab09 rename crate to cargo-credential-libsecret 2023-08-17 16:05:31 -05:00
Weihang Lo 5691da2b79
chore(cargo-util): bump version to 0.2.6 2023-08-16 20:06:40 +01:00
Weihang Lo 1ee9db3123
fix(xtask-bump-check): query by package name to detect changes
versions and paths of a workspace members between the original and
a checked-out workspace are different, and shouldn't be included in
hash keys when querying packages.
2023-08-16 15:46:43 +01:00
Weihang Lo c07043b7cf
fix(log): enable ansi color only in terminal 2023-08-14 15:45:25 +01:00
Weihang Lo 9d707e4b9a
chore: remove log, env_logger, and pretty_env_logger 2023-08-07 12:02:19 +01:00
Weihang Lo 7e69050c64
refactor: setup tracing-subscriber 2023-08-07 12:02:19 +01:00