Commit Graph

419 Commits

Author SHA1 Message Date
Eric Huss b08c2084e9 [stable 1.74] Bump cargo patch version 2023-11-19 18:40:21 -08:00
Weihang Lo 845c1bc063
chore: bump `cargo-credential-*` crates as e58b84d broke stuff
e58b84d3 changed the shape of response of cargo credential protocol trait,
so credential plugins crates effectively depend on `cargo-credential@0.4.0`.
However, `cargo@0.74.0` still depends on`cargo-credential@0.3.0`.
They must depends on the same major version of `cargo-credential`
otherwise incompatible.
2023-11-19 09:57:17 -05:00
Eric Huss 9fa227e327 [beta 1.74] Update curl-sys to pull in curl 8.4.0
This updates curl-sys from 0.4.66 to 0.4.68 to pull in curl 8.4.0.
This fixes two CVEs:

* CVE-2023-38546 — https://curl.se/docs/CVE-2023-38546.html
* CVE-2023-38545 — https://curl.se/docs/CVE-2023-38545.html

This also pulls in a change to fix compiling on macOS Sonoma.
2023-10-11 17:01:15 -07:00
Ed Page b3353c8772 refactor(shell): Switch termcolor to anstream 2023-09-29 10:16:51 -05:00
Ed Page 796398563a refactor(test): Switch termcolor to anstream 2023-09-29 10:16:15 -05:00
Ed Page c0fd3622bd refactor: Reuse existing anstream dep for stripping
We are already getting `anstream` through `clap`, so this is no extra
cost and let's us drop some dependencies.

The `anstream` implementation is also orders of magnitude faster (last I
benchmarked)
2023-09-29 10:15:40 -05:00
Ed Page ab5ebba867 chore: Upgrade deps to get latest anstream 2023-09-29 10:15:12 -05:00
Sebastian Thiel 3f7d556131
upgrade gitoxide to v0.54
This reduces the binary size and fixes an exploitable bug that could allow
code execution by injection arguments into hostnames of ssh URLs.
2023-09-25 13:53:06 +02:00
Henry Chen 277368d8cc Update target-arch-aware crates to support mips r6 targets
This includes libc itself and dependencies that rely on
rustix 0.37.

command used for the update:

```shell
cargo update -p is-terminal
```
2023-09-24 23:18:43 +08:00
Eric Huss 7ada8392d0 Update curl-sys to pull in curl 8.3.0 2023-09-20 11:17:40 -07:00
Arlo Siemsen d345ca212f feat: stabilize credential-process and registry-auth 2023-09-16 22:40:45 -05:00
Weihang Lo c4f9712a42
chore: bump patch version due to refactor 2023-09-14 14:44:44 +08:00
Weihang Lo 8a404ea711
chore: update globset to 0.4.13 2023-09-13 16:16:09 +08:00
Ed Page 51e1058379 refactor(shell): Centralize `Shell` styling
This is a very rough pass at naming the styles with a focus on getting
something in and keeping the colors the same.
2023-09-11 09:51:09 -05:00
Ed Page 2d5354adc9 refactor(cli): Extract CLI style definitions 2023-09-11 09:32:13 -05:00
bors c2d26f32d3 Auto merge of #12578 - epage:help, r=weihanglo
feat(help): Add styling to help output

### What does this PR try to resolve?

Try to make `--help` output easier to parse by using terminal styling

Screenshots:

![Screenshot from 2023-09-06 09-57-11](https://github.com/rust-lang/cargo/assets/60961/61069af4-ef05-40ad-9240-fedea44d4c71)

![Screenshot from 2023-09-06 09-57-21](https://github.com/rust-lang/cargo/assets/60961/d2e69024-42aa-47c0-ad0f-24e43551b8db)

![Screenshot from 2023-09-06 09-57-36](https://github.com/rust-lang/cargo/assets/60961/e3d895e2-745f-48c6-9e84-d6fb67198d6d)

*(`nargo` is my shell script wrapping `cargo run --manifest-path cargo/Cargo.toml`)*

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

At this time, the only styling snapshotting library I know of is a pain to use, so testing this requires manually running the commands which I did.  Screenshots are included for easier evaluation of the general idea.

Snapshotting of the plain text output ensures we don't have accidental formatting regressions from this change since the formatting isn't as obvious from looking at the code.

### Additional information

Traditionally, cargo has disabled clap's styled output.  My assumed
reason is that cargo mixes custom help output with auto-generated and
you couldn't previously make it all styled.
Clap 4.2 allowed users to pass in strings styled using ANSI escape
codes, allowing us to pass in styled text that matches clap, unblocking this.  In clap
4.4.1, clap gained the ability for the user to override the style.

In this PR, I decided to use the new 4.4.1 feature to style clap's
output to match the rest of cargo's output.  Alternatively, we could use
a more subdue style that clap uses by default.

I used the `color-print` crate to allow something almost html-like for styling `&static str`.  Alternatively, we could directly embed the ANSI escape codes harder to get write, harder to inspect), or we could do the styling at runtime and enable the `string` feature in clap.

I decided to *not* style `Arg::help` messages because
- It might be distracting to have the descriptions lit up like a
  christmas tree
- It is a lot more work

The one exception I made was for `--list` since it is for a
psuedo-command (`...`) and I wanted to intentionally draw attention to
it.

#12593 made styling of `cargo -h` cleaner imo.
#12592 and #12594 were improvements I noticed while doing this.
2023-09-11 06:25:47 +00:00
bors 8bd32310f5 Auto merge of #12631 - Eh2406:strip_prefix, r=epage
Ues strip_prefix for cleaner code

### What does this PR try to resolve?

In https://github.com/rust-lang/cargo/pull/12629#pullrequestreview-1614154046 Ed pointed out how much cleaner the code can be using `strip_prefix`, so I found a bunch more places where we should be using it.

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

Internal refactor and test still pass.
2023-09-08 20:05:02 +00:00
Jacob Finkelman 2b2838302f bump cargo-platform 2023-09-08 19:16:42 +00:00
Arlo Siemsen f020b00bdd Bump cargo-credential-1password to v0.4.0 2023-09-07 13:52:15 -05:00
Arlo Siemsen e58b84d35e breaking change(cargo-credential)
Changes the JSON format for cache:expires
2023-09-05 15:22:27 -05:00
Jacob Finkelman 16b330bc59 stop using lazy_static 2023-09-01 21:38:03 +00:00
Ed Page dbbc5dd6eb feat(help): Add styling to help output
Traditionally, cargo has disabled clap's styled help output.  My assumed
reason is that cargo mixes custom help output with auto-generated and
you couldn't previously make it all styled to match.  Clap 4.2 allowed
users to pass in strings styled using ANSI escape codes, allowing us to
pass in styled text that matches clap, unblocking this.  In clap
4.4.1, clap gained the ability for the user to override the style,
allowing us to choose the styling as we wish.

In this PR, I decided to use the new 4.4.1 feature to style clap's
output to match the rest of cargo's output.  Alternatively, we could use
a more subdue style that clap uses by default.  That subdued style was
mostly chosen to be app theme neurtral (since we didn't have theming
support yet) and there were problems with our style and no one stepped
up to fix them (cargo has a style we can match to instead).

I decided to *not* style `Arg::help` messages because
- It might be distracting to have the descriptions lit up like a
  christmas tree
- It is a lot more work

The one exception I made was for `--list` since it is for a
psuedo-command (`...`) and I wanted to intentionally draw attention to
it.
2023-09-01 09:30:20 -05:00
renovate[bot] b7408c7261
chore(deps): update compatible 2023-09-01 07:44:26 +00:00
renovate[bot] fd28a0383a
chore(deps): update rust crate cargo_metadata to 0.17.0 2023-09-01 02:16:59 +00:00
Arlo Siemsen 39db61e26e fix: add error for unsupported credential provider version 2023-08-29 21:22:29 -05:00
Eric Huss 58b5951d9f Update git2 2023-08-28 13:17:01 -07:00
David Tolnay 3871aecf3e
Improve deserialization errors of untagged enums 2023-08-27 16:27:08 -07:00
Eric Huss 3b6a008f73 Update serde 2023-08-26 11:40:10 -07:00
Deadbeef 3d50f47197 Add fields for bindeps on the registry 2023-08-25 01:43:29 +00: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
Weihang Lo c1f7e2bb04
chore: upgrate clap to 4.3.23 2023-08-22 17:24:40 +01:00
Weihang Lo 5ab8a97645
Bump to 0.75.0 2023-08-22 11:54:44 +01:00
Ed Page 4793669b13 chore: Downgrade serde below the binary blob
As of serde 1.0.172, `serde_derive` ships a binary blog for Linux x64
for faster build times.  This blob is not yet reproducible to ensure
that the safety of it.  See serde-rs/serde#2538

This is not a judgement on serde or on dtolnay but just a precaution to
buy us more time as the community works through this since the beta cut
is coming up.  rust-1.72 branch is unaffected.
2023-08-18 19:33:32 -05:00
Arlo Siemsen 763edbab09 rename crate to cargo-credential-libsecret 2023-08-17 16:05:31 -05:00
Arlo Siemsen 3d8e8d32cd credential: make gnome-secret built-in as cargo:libsecret 2023-08-17 13:58:18 -05:00
bors 937b930a77 Auto merge of #12518 - arlosi:cred-dlopen, r=epage
cargo-credential-gnome-secret: dynamically load libsecret

Building `cargo-credential-gnome-secret` currently requires the `libsecret` development libraries to be installed and findable via `pkg-config`. This is often an extra step for users and complicates CI builds.

This loads the required functions from `libsecret` dynamically using `libloading` which uses `dlopen` internally.

Closes #12503

Testing this requires manually installing the credential provider on a system with libsecret set up. I tested it on Arch Linux.
2023-08-17 16:56:21 +00:00
Arlo Siemsen b74e5a0e7e credential: make 1password no longer built-in 2023-08-17 00:47:30 -05:00
Arlo Siemsen 627936bdf6 cargo-credential-gnome-secret: dynamically load libsecret 2023-08-17 00:18:00 -05:00
Weihang Lo 5691da2b79
chore(cargo-util): bump version to 0.2.6 2023-08-16 20:06:40 +01:00
Eric Huss a008741136 Update hermit-abi 2023-08-15 13:29:54 -07:00
Arlo Siemsen 5ade1ad1eb cargo-credential: reset stdin & stdout to the Console 2023-08-10 13:33:33 -05:00
bors 211fd7eac1 Auto merge of #12458 - weihanglo:tracing, r=epage
refactor: migrate to `tracing`
2023-08-07 20:59:03 +00:00
Arlo Siemsen af95711ae5 Add more docs and example for cargo-credential 2023-08-07 13:00:56 -05:00
Weihang Lo 9d707e4b9a
chore: remove `log`, `env_logger`, and `pretty_env_logger` 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 9f0565e985
chore: add `tracing` crate 2023-08-07 11:21:55 +01:00
Eric Huss c4b0e6b95a Update schannel from 0.1.21 to 0.1.22 2023-08-05 14:28:15 -07:00
Eric Huss 850ff884e8 Update miow from 0.5.0 to 0.6.0 2023-08-05 14:27:40 -07:00
Eric Huss 580bbf90f8 Update pretty_env_logger to 0.5 2023-08-03 15:14:02 -07:00
WANG Rui a28c597e17 Update rustix to 0.38.6 2023-08-02 23:07:03 +08:00