542 Commits

Author SHA1 Message Date
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
Weihang Lo
23561f36a1
chore: add tracing-subscriber crate 2023-08-07 11:25:41 +01:00
Weihang Lo
af1a78b424
refactor: find & replace log:: -> tracing::
Except HTTP network debugging
2023-08-07 11:25:40 +01:00
Weihang Lo
9f0565e985
chore: add tracing crate 2023-08-07 11:21:55 +01:00
bors
6145d0c4d2 Auto merge of #12395 - weihanglo:cargo-semver-checks, r=epage
ci: rewrite bump check and respect semver

### What does this PR try to resolve?

This ports `ci/validate-version-bump.sh` and #12200 to the new xtask `bump-check`. It also adds the ability to set the correct baseline revision when checking version bump. That is, it fixes #12347.

In addition, this integrates the community tool `cargo-semver-checks`. SemVer violation can now be detected earlier.

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

This PR extracts the registry query part from `xtask-unpublished` and removes other pars. I don't feel like we need it in the short term.

For how it works, please the check doc comment in each function.

One concern is that this check is still a required job for bors. I believe `@obi1kenobi` is quite responsive and willing to help if there is something wrong. So, waiting for an upstream fix won't be a problem for cargo. Also as a good citizen in the community, we can always contribute back.
(Take it easy `@obi1kenobi,` don't be stressed out 🙂)
<!-- homu-ignore:end -->
2023-08-01 23:00:45 +00:00
Weihang Lo
8d31d626a2
chore: remove xtask-unpublished 2023-08-01 22:54:41 +01:00
Weihang Lo
9cca5721e4
chore: new xtask bump-check
This is a rewrite of old `ci/validate-version-bump.sh` in Rust.
2023-08-01 22:54:40 +01:00
renovate[bot]
a63bc76577
chore(deps): update alpine docker tag to v3.18 2023-08-01 02:18:33 +00:00
Weihang Lo
46bf05dcaf
chore: update home to 0.5.7 2023-07-26 11:26:49 +01:00
Arlo Siemsen
2b39792aef Credential provider implementation 2023-07-21 16:02:24 -05:00
Weihang Lo
31b500c7c0
refactor(crates-io): use thiserror
Optionally use `thiserror` to reduce boilerplates but this part can
be dropped if we don't want.
2023-07-18 22:22:47 +01:00
Weihang Lo
b4499af4e9
refactor(crates-io): remove anyhow
This removes the dependency `anyhow` and uses our own custom Error
enum, so that crates-io consumer can access `Error::API::challenge`
field.
2023-07-18 22:22:47 +01:00
Weihang Lo
a561e8b781
feat(crates-io): use our own Result wrapper everywhere 2023-07-18 22:22:47 +01:00
Weihang Lo
ed6692b1c6
refactor(crates-io): rename ResponseError to Error 2023-07-18 22:22:47 +01:00
Weihang Lo
00a872740a
fix(crates-io): don't let server sneak extra lines anywhere
From 5febbe5587/src/cargo/sources/registry/http_remote.rs (L234-L237)
2023-07-18 22:22:46 +01:00
Weihang Lo
6805944715
feat(crates-io): expose headers for ResponseError::Api
In response to RFC 3231 [^1], our registry client need to return headers
to caller, so that the caller (cargo binary) can continue parsing
challenge headers.

[^1]: https://rust-lang.github.io/rfcs/3231-cargo-asymmetric-tokens.html#the-authentication-process
2023-07-18 22:22:46 +01:00
Ed Page
83a5859221 chore(platform): Version bump 2023-07-17 13:21:41 -05:00
Ed Page
4bd5f9ca50 chore(util): Version bump 2023-07-17 13:21:41 -05:00
Ed Page
5d80aa263d refactor: Provide workspace-level default license 2023-07-17 13:21:41 -05:00
Ed Page
3752929dd4 refactor: Update home to 2021 edition 2023-07-17 13:21:41 -05:00
Ed Page
e4877cc701 refactor: Update resolver-tests to 2021 edition 2023-07-17 13:21:41 -05:00
Ed Page
f358359a17 refactor: Provide a workspace-level default edition 2023-07-17 13:21:40 -05:00
Ed Page
8b02d4927e refactor: Infer package.readme 2023-07-17 13:21:10 -05:00
Arlo Siemsen
d45ba88290 Bump version of crates-io due to unintentional semver-breaking change 2023-07-13 14:35:09 -05:00
Eric Huss
43c253e69a Rustfmt with latest nightly. 2023-07-11 16:58:53 -07:00
Eric Huss
9835622853 Convert valid feature name warning to an error. 2023-06-20 12:39:27 -07:00
Eric Huss
75bcada1eb Show a better error when container tests fail. 2023-06-13 11:15:39 -07:00
Ed Page
b2b4d9771f test(cli): Verify precedence over external subcommands 2023-06-09 13:16:12 -05:00
Weihang Lo
c977baa9cf
refactor: rename RegistryPackage to IndexPackage
This is a better name to reflect it is from "index" files.
2023-06-07 23:01:55 +01:00
Weihang Lo
fa7cc198aa
refactor: replace some usages of lazy_static with OnceLock
* Some usages still wait for `LazyCell`.
* `TEST_ROOTS` is no longer used. Removed.
2023-06-01 22:11:20 +01:00
Weihang Lo
8cb220f5eb
refactor: use IsTerminal from std instead of is-terminal crate 2023-06-01 21:50:43 +01:00
trevyn
5dfae689fa Improve error chain formatting 2023-05-30 13:55:05 +04:00
trevyn
0b8c12f5c6 Document reasoning and report previous error chain 2023-05-30 07:51:07 +04:00
trevyn
ddc49783ce Fall back to fs::remove_dir_all on error 2023-05-28 17:57:49 +04:00
Weihang Lo
7b4e32d64b
test: set retry sleep to 1ms for all tests 2023-05-27 11:28:58 +01:00
bors
d90ff55ca5 Auto merge of #11968 - bzEq:aix-libpath, r=weihanglo
fix: AIX searches dynamic libraries in `LIBPATH`.

### What does this PR try to resolve?

On IBM AIX machines people have encountered issues in `compiletest` and rustc's bootstrap builder. They haven't encountered any in cargo. This PR is made for avoiding potential failures in the future in cargo.

It's documented in <https://www.ibm.com/support/pages/libpath-environment-variables-aix-platforms>:

> The `LIBPATH` environment variable tells AIX applications where to find shared libraries when located in a different directories than those specified in the header section of the executable.

See also the counterpart in <https://github.com/rust-lang/rust/pull/109526>

### How to verify and test this in Cargo's CI?

This is indeed an issue. At IBM people are maintaining a buildbot since GitHub Action doesn't support AIX yet.
2023-05-25 10:20:29 +00:00
bors
5a396277e8 Auto merge of #12126 - weihanglo:ci-version-bump, r=epage
ci: check if any version bump needed for member crates

### What does this PR try to resolve?

Check if a crate requires a version bump in CI.

Part of #12033

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

Demo action result: <https://github.com/weihanglo/cargo/actions/runs/4941952784/jobs/8835049007>

### Additional information

This doesn't devalue #12089. I love the changelog detection, saving maintainers' times a lot ( I am the one writing changelogs for each release for now). However, the amount of code there is too excessive to me. I think someday when we are going to integrate [cargo-release](https://crates.io/crates/cargo-release) and/or [ehuss/cargo-new-release](https://github.com/ehuss/cargo-new-release), we can remove this script perhaps entirely :)

I tried to document the script a bit hard. Hope it won't get worse over time.
2023-05-23 02:28:15 +00:00