13951 Commits

Author SHA1 Message Date
Ed Page
943edea4a4 fix(cred): Get wincred building on all platforms 2023-04-18 09:10:20 -05:00
Ed Page
b533f89c43 refactor(cred): Move win impl to inline mod 2023-04-18 09:07:17 -05:00
Ed Page
72fee8015c fix(cred): Get macos building on all platforms 2023-04-18 09:06:09 -05:00
Ed Page
2e3dde1843 refactor(cred): Move macos impl to inline mod 2023-04-18 09:05:02 -05:00
Ed Page
feb6d881d8 feat(cred): Common unsupported credentials 2023-04-18 09:00:55 -05:00
bors
60bf28f6f2 Auto merge of #11981 - Systemcluster:rustflags-comparable, r=epage
Recompile on profile rustflags changes

Adding `rustflags` to the comparable profile properties.

Follow-up to #11121 without the additional changes.

Closes #11120
2023-04-18 01:18:46 +00:00
Systemcluster
e080273d6f
Add rustflags profile option to comparable profile properties 2023-04-18 00:56:04 +02:00
bors
5861176b56 Auto merge of #11982 - ehuss:changelog-clarification, r=weihanglo
Clarify some 1.69 changelog entries.

These are some updates that were added in the rust-lang/rust release notes to try to clarify some of these entries.
2023-04-17 05:50:40 +00:00
Eric Huss
6d4677d6ff Clarify some 1.69 changelog entries. 2023-04-16 18:28:05 -07:00
bors
d0a4cbcee6 Auto merge of #11979 - weihanglo:openssl-for-non-windows, r=ehuss
chore: use openssl only on non-Windows platforms

On Windows, the system-provided Schannel will be used instead.

See

- https://github.com/rust-lang/rust/pull/109133#issuecomment-1510029269
- 39116ccc9b/README.md (L38-L49)
2023-04-16 17:42:50 +00:00
Weihang Lo
a0bb59c8a8
chore: use openssl only on non-Windows platforms 2023-04-16 07:56:54 +01:00
bors
39116ccc9b Auto merge of #11851 - weihanglo:make-cargo-a-workspace, r=ehuss
Make cargo a workspace

### What does this PR try to resolve?

The first step of making cargo a workspace.

Benefits:

* Dogfooding ourselves.
* Unblock #11831: It got stuck because the new version of tempfile using `windows-sys` but some issues haven't yet be solved in rust-lang/rust.
* Make `cargo xtask` or similar developer workflow possible (e.g., #11717)
* Having our own Cargo.lock, so our CI can cover the exact binary going to ship. Also free Cargo from CI breaks due to dependency patch releases.
* Probably more? Please add them by yourself.

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

Please review it commit by commit. A companion PR is here https://github.com/rust-lang/rust/pull/109133, and should be reviewed together.

### Unresolved issues

To limit the scope of this pull request, the following issues are intentionally left unresolved. They will be addressed right after this pull request gets merged.

- [x] Make `benches/capture` and `benches/capture` workspace members. (Addressed with 2cf97187b6497e3882898a446c10baaa6ae9f042)
- [x] Make `crates/resolver-tests` a workspace member. (Addressed with #11886)
- [ ] ~~Fix clippy warnings and re-enable clippy check in CI for all workspace members.~~
  - Blocked on rust-lang/rfcs#3389 so we can more easily propagate our clippy settings
- [ ] Fix rustdoc warnings and re-enable rustdoc check in CI for all workspace members.
- [ ] Fix `linkchecker.sh` warnings in CI (https://github.com/rust-lang/cargo/pull/11851#discussion_r1147051184)
- [ ] Leverage workspace flag `--workspace` when running `cargo build` or `cargo test`, instead of using flag `-p`.
- [ ] Leverage glob syntax when probing members in `[workspace]` in Cargo.toml (i.e., `crates/*`).

### Additional information

This depends on prior works from `@Muscraft` and `@ehuss.` Credits to them!
2023-04-15 20:24:15 +00:00
bors
7fb89f011a Auto merge of #11976 - ehuss:fix-not_found_permutations, r=epage
Fix flaky not_found_permutations test.

This fixes the `registry::not_found_permutations` test which would randomly fail since the order of http requests was not deterministic. The resolver can issue queries in parallel which can process requests out-of-order.

Fixes #11975
2023-04-14 15:45:27 +00:00
Eric Huss
6fa758e83c Fix flaky not_found_permutations test. 2023-04-14 08:01:34 -07:00
bors
d2e7cfb248 Auto merge of #11963 - jhpratt:master, r=epage
Use restricted Damerau-Levenshtein algorithm

This uses the same implementation as the one used in rustc, so review should be simple. As with rust-lang/rust#108200, the module and function names have been changed to be implementation-agnostic.

[Reference](13d1802b88/compiler/rustc_span/src/edit_distance.rs) for rustc's current implementation.
2023-04-14 14:31:42 +00:00
bors
b0742b2145 Auto merge of #11882 - hi-rustin:rustin-patch-clippy-fix, r=weihanglo
Correct the bug report for `cargo clippy --fix`
2023-04-14 07:05:37 +00:00
hi-rustin
08169fd015 Add rustc_shim_for_cargo_fix and wrapped_clippy_driver to reuse code
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-04-14 11:23:41 +08:00
hi-rustin
47f6e2ddc9 Add broken_clippy_fixes_backed_out
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-04-14 10:46:53 +08:00
hi-rustin
3a880a2b39 Correct the bug report for cargo clippy --fix
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-04-14 10:46:47 +08:00
bors
84b7041fd2 Auto merge of #11950 - ehuss:stabilize-logout, r=epage
Stabilize `cargo logout`

This stabilizes the `cargo logout` command.

Closes #11910
Closes #11884
2023-04-13 20:08:40 +00:00
Jacob Pratt
ccd77a3efc
Make names implementation-agnostic 2023-04-12 18:30:51 -04:00
Jacob Pratt
f0264093d2
Use restricted Damerau-Levenshtein algorithm 2023-04-12 18:26:03 -04:00
bors
38376893bd Auto merge of #11878 - ehuss:header-diagnostics, r=weihanglo
Add more information to HTTP errors to help with debugging.

This adds some extra information to the HTTP error message about some headers and the remote IP address that could potentially be useful in diagnosing issues.

Closes #8691
2023-04-12 18:57:04 +00:00
Eric Huss
84bcf0e247 Add x-amz-request-id (for the S3 side of things) and add comments. 2023-04-12 11:50:53 -07:00
Eric Huss
a70c108961 Stabilize cargo logout 2023-04-12 09:56:43 -07:00
Eric Huss
c00a633bd6 Don't display headers in spurious warning message.
The headers can significantly contribute to noise in the output,
drowning out the rest of the output. Most investigation will likely be
focused on the case where cargo completely fails to download, so this
only shows the full detail in the final error message.
2023-04-12 09:38:53 -07:00
Eric Huss
4702fa3ad3 Include the IP address in HTTP errors. 2023-04-12 09:38:53 -07:00
Eric Huss
c7c9b8f32b Show some HTTP headers in error messages. 2023-04-12 09:38:52 -07:00
bors
96f8d6ced8 Auto merge of #11949 - ehuss:logout-default, r=epage
Use registry.default for login/logout

This changes `cargo login` and `cargo logout` to use the registry configured at `registry.default` as the registry instead of crates.io. For `cargo login`, this was an unintentional regression from #6466. The documentation has always stated that it will use the default registry.

This makes the command more in line with other registry-involving commands. There are still some inconsistencies.

These commands use the default if not specified:

* `cargo init`
* `cargo new`
* `cargo owner`
* `cargo search`
* `cargo yank`
* `cargo publish` uses the default, but will also look at the `publish` field `Cargo.toml` and use that if the registry is not specified.

These commands would always use crates.io if `--registry` is not specified:

* `cargo login`
* `cargo logout`
* `cargo install`

I'm a bit uncertain how to proceed, since this is technically a breaking change particularly if someone has scripted it. I suspect that the number of users that use `registry.default` is very small, and those that script `cargo login` are even smaller, and thus the intersection is probably small or nonexistent. However, there is some risk here.
2023-04-12 13:45:57 +00:00
Weihang Lo
aaca5a0a56
chore: remove dependency rustc-workspace-hack
Co-authored-by: Scott Schafer <schaferjscott@gmail.com>
Co-authored-by: Eric Huss <eric@huss.org>
2023-04-12 11:32:58 +01:00
Weihang Lo
0289f2b8d5
chore: track Cargo.lock
Co-authored-by: Scott Schafer <schaferjscott@gmail.com>
Co-authored-by: Eric Huss <eric@huss.org>
2023-04-12 11:32:24 +01:00
Weihang Lo
36f00f42c2
ci: use -p to specify which package to build an test
Co-authored-by: Scott Schafer <schaferjscott@gmail.com>
Co-authored-by: Eric Huss <eric@huss.org>
2023-04-12 11:30:42 +01:00
Weihang Lo
796853ca54
chore: new Cargo feature all-static
This is primarily for the release process of rust-lang/rust.

Note that in rustc-worksace-hack[1] it enable http2 via libnghttp2,
cargo probably needs to enable it to compile in rust-lang/rust.

[1]: 992d154f3a/src/tools/rustc-workspace-hack/Cargo.toml (L77)

Co-authored-by: Scott Schafer <schaferjscott@gmail.com>
Co-authored-by: Eric Huss <eric@huss.org>
2023-04-12 11:30:42 +01:00
Weihang Lo
ecfe92776c
chore: create a [workspace] for cargo
Some dependencies in `resolver-tests` do not have any license
information. This prevent it from being a member when integrating in
rust-lang/rust. Will figure it out after.

Co-authored-by: Scott Schafer <schaferjscott@gmail.com>
Co-authored-by: Eric Huss <eric@huss.org>
2023-04-12 11:30:42 +01:00
bors
1ce01c5e58 Auto merge of #11960 - ehuss:chdir-unstable, r=weihanglo
Change -C to be unstable

Due to #11957, we have decided to change `-C` to be unstable to give us some more time to decide on how it should behave.
2023-04-12 09:23:44 +00:00
Eric Huss
3da2b3c67b Mark -C as unstable 2023-04-11 19:46:05 -07:00
Eric Huss
a9e0b505d6 Update auth error message to specify args for cargo login. 2023-04-10 10:20:21 -07:00
bors
7bf43f028b Auto merge of #11956 - epage:spec, r=Muscraft
docs(pkgid): Consistently use @

Fixes #11955
2023-04-10 16:01:41 +00:00
Ed Page
b0eb0a8a9e docs(pkgid): Consistently use @
Fixes #11955
2023-04-10 08:50:38 -05:00
bors
c429784fd5 Auto merge of #11951 - ehuss:check-token-tab, r=hi-rustin
Fix credential token format validation.

The existing validation incorrectly excluded tab because of a missing backslash. This updates to add the backslash.

This also rewords the comments. I found the current comments to be a little confusing.

This also extends the test to verify more valid inputs.

cc #11600
2023-04-10 04:02:43 +00:00
bors
1a53cdb31f Auto merge of #11952 - ehuss:check-token-publish, r=weihanglo
Validate token on publish.

The `publish` path was not validating the token like the other API routes were (like owner, or yank). This does not appear to be intentional from what I can tell. This consolidates the relevant code so that it is shared with all the API calls.

cc #11600

Closes #11571
2023-04-10 00:54:41 +00:00
bors
34cb1ea6b8 Auto merge of #11947 - ehuss:c-before-command, r=weihanglo
Clarify docs on `-C` that it appears before the command.

The docs for `-C` currently don't mention that it must appear before the command name. This is the only root option that behaves this way that is documented in every page (except for `+toolchain`, which already mentions its position restriction). This adds some text to explain this restriction.
2023-04-09 23:40:29 +00:00
Eric Huss
35f5862979 Validate token on publish. 2023-04-09 12:15:40 -07:00
Eric Huss
57264ed433 Fix credential token format validation. 2023-04-09 11:53:46 -07:00
Eric Huss
9ba2ca2034 Clarify docs on -C that it appears before the command. 2023-04-09 09:58:06 -07:00
Eric Huss
117eb4b33f Use registry.default for login/logout 2023-04-09 09:30:36 -07:00
Eric Huss
0e13f667c8 Add tests for registry.default for login/logout 2023-04-09 09:22:28 -07:00
Eric Huss
91d39bc742 Share the check_token function between login and logout tests. 2023-04-09 09:11:22 -07:00
bors
1b2de2169b Auto merge of #11866 - Zoxc:fs-non-canon, r=ehuss
Add `try_canonicalize` and use it over `std::fs::canonicalize`

This adds a `try_canonicalize` function that calls `std::fs::canonicalize` and on Windows falls back to getting an absolute path. Uses of `canonicalize` have been replaced with `std::fs::canonicalize`. On Windows `std::fs::canonicalize` may fail due to incomplete drivers. In particular `ImDisk` does not support it.

Combined with https://github.com/rust-lang/rust/pull/109231 this allows compiling crates on an `ImDisk` RAM disk and I've tested that it works with various configuration using [rcb](https://github.com/Zoxc/rcb).
2023-04-08 19:32:31 +00:00
Eric Huss
5430956b4a
Fix misspelling 2023-04-08 12:27:04 -07:00