475 Commits

Author SHA1 Message Date
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
WANG Rui
6a9cb23923 Remove useless drop of copy type 2023-05-13 16:51:30 +08:00
Weihang Lo
8eb3f51725
doc: explain what xtask-unpublished does 2023-05-10 23:28:45 +01:00
Eric Huss
dd25e89460 Update the semver-check script to be able to run in any directory. 2023-05-09 12:53:05 -07:00
Weihang Lo
8620f5a7d5
xtask-unpublished: table output 2023-05-05 16:32:07 +01:00
Weihang Lo
0bffcbcb8a
chore: publish = false for pkgs not meant to be published
These tree packages are considered to be published something.
To reduce the logic of xtask-unpubilshed, let's flag them false for now.
We can always set it `true` when needed.
2023-05-05 16:24:19 +01:00
Weihang Lo
8d753a767c
xtask-unpublished: respect --package flag 2023-05-05 16:24:18 +01:00
bors
33c64109fe Auto merge of #12055 - QiangHeisenberg:crates-io-doc-test, r=weihanglo
fix:  doc-test failures

### What does this PR try to resolve?

When I read the source code, I found that the `Registry::new_handle` document test failed and seemed to be missing parameters;

There is no change in this [PR](https://github.com/rust-lang/cargo/pull/10592/files#diff-12973056cf99e8de997011a8738a6740a7dfd06142a73f122f3b35218db37351).
2023-05-04 14:30:42 +00:00
QiangHeisenberg
ff7ff7d50d Added the no_run attribute 2023-05-04 16:25:12 +08:00
QiangHeisenberg
ea0d487b99 fix cargo-test-support doc test 2023-05-04 11:16:34 +08:00
Scott Schafer
34b8c39d77 chore: Use [workspace.dependencies] 2023-04-28 09:56:09 -05:00
cui fliter
825c75af31 Remove repeated definite articles
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-01 21:37:28 +08:00
bors
393ce5b416 Auto merge of #12048 - weihanglo:mdman, r=epage
chore: move build-man workflow away from shell
2023-04-28 15:48:53 +00:00
bors
7a90ba1ecc Auto merge of #12043 - epage:rust-version, r=weihanglo
feat: Add `-Zmsrv-policy` feature flag

### What does this PR try to resolve?

Nothing noticeable....

The intent is to unblock experiments with different compatible MSRV policies like
- #9930
- #10653
- #10903

While I normally don't like PRs that do nothing on their own, this at least allows any one of those efforts to move forward with different people without juggling these base commits for whoever is first to include in their PR

While there isn't an RFC for this yet, this is intended to allow us to experiment to get a better idea of what we should put in an RFC.  In some cases, we first do an eRFC for this but I assumed this wouldn't be needed in this case as this builds on rust-lang/rfcs#2495 and, I'm assuming, will be more surgical in nature

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

The `Summary` changes are largely untested as they will be mostly tested through the future work that builds on this PR.  However, I wasn't too concerned about that because the code is relatively trivial.

### Additional information

I chose the name `msrv-policy` to distinguish this unstable feature from `rust-version`.  Though those appear in different places (`Cargo.toml` vs `-Z`), I can see them being confusing which was especially apparent when editing `unstable.md` which has an anchor for `rust-version`.
2023-04-28 14:55:25 +00:00
Weihang Lo
137c82a54b
mdman: update mdman's example outputs 2023-04-28 15:46:37 +01:00
Weihang Lo
e3dec38f4b
mdman: use cargo build-man everywhere 2023-04-28 15:46:37 +01:00
Weihang Lo
c01bad9b20
mdman: make build-man part of xtask
Turn `src/doc/build-man.sh` into a Cargo binary target.
So is `crates/mdman/build-man.sh`.
2023-04-28 15:46:37 +01:00
Weihang Lo
9c426c90de
mdman: remove dangling Cargo.lock 2023-04-28 15:44:24 +01:00