Skip to content

chore(deps): Switch humantime to jiff #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 10, 2025
Merged

chore(deps): Switch humantime to jiff #352

merged 2 commits into from
Mar 10, 2025

Conversation

oherrala
Copy link
Contributor

@oherrala oherrala commented Mar 8, 2025

humantime seems to be unmaintained and jiff provides the same functionality. This change shouldn't affect end users.

Ref. rustsec/advisory-db#2249

@oherrala oherrala force-pushed the jiff branch 2 times, most recently from 1b3d072 to 0cab95a Compare March 8, 2025 20:12
@coveralls
Copy link

coveralls commented Mar 8, 2025

Pull Request Test Coverage Report for Build 13769764634

Details

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+1.1%) to 44.786%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/fmt/humantime.rs 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
src/fmt/mod.rs 2 68.99%
Totals Coverage Status
Change from base Build 13441892276: 1.1%
Covered Lines: 262
Relevant Lines: 585

💛 - Coveralls

@oherrala oherrala force-pushed the jiff branch 3 times, most recently from 0b268ef to 8ec73fa Compare March 9, 2025 18:35
Humantime seems to be unmaintained and jiff provides same
functionality.
@epage
Copy link
Contributor

epage commented Mar 10, 2025

Thanks!

@epage epage merged commit d6c8c2a into rust-cli:main Mar 10, 2025
17 checks passed
@oherrala oherrala deleted the jiff branch March 10, 2025 16:46
github-merge-queue bot pushed a commit to rust-lang/cargo that referenced this pull request Mar 10, 2025
<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

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

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->

The crate [`humantime`](https://crates.io/crates/humantime) appears to
be unmaintained. There's open PR in RustSec's advisory-db about this:
rustsec/advisory-db#2249

The crates [`clap`](https://crates.io/crates/clap) and
[`env_logger`](https://crates.io/crates/env_logger) have already made
the switch from `humantime` to [`jiff`](https://crates.io/crates/jiff):

 * clap-rs/clap#5944
 * rust-cli/env_logger#352

The `jiff` crate is already dependency on `cargo` via `gix` (albeit old
0.1 version, but that's probably fixed in [next gix
release](GitoxideLabs/gitoxide@3ae99a4)):

```
jiff v0.1.29
└── gix-date v0.9.3
    ├── gix v0.70.0
    │   └── cargo v0.88.0 (/Users/oherrala/rust/cargo)
```

This PR shouldn't have any functional change to cargo itself.
@yhx-12243
Copy link

humantime seems resurrected now (1 hour ago).

@djc
Copy link

djc commented Mar 24, 2025

Note that the addition of jiff means env_logger is pulling a number of extra dependencies: portable-atomic, portable-atomic-util, serde (including serde_derive and all the proc-macro stuff). Not sure this is a good deal from that perspective.

(Independent from my having taken over maintenance of humantime.)

@yhx-12243
Copy link

Yes I agree, I have a little intention to propose a revert to this PR.

@BurntSushi
Copy link
Contributor

Note that the addition of jiff means env_logger is pulling a number of extra dependencies: portable-atomic, portable-atomic-util, serde (including serde_derive and all the proc-macro stuff). Not sure this is a good deal from that perspective.

They might show up in your lock file because of rust-lang/cargo#10801, but serde, proc macros are all opt-in features that env_logger is not enabling. They should not being built without opting into the relevant features, and if they are, you're more than welcome to file a Jiff bug with an MRE. And portable-atomic is only going to be used on targets that don't have atomics.

@djc
Copy link

djc commented Mar 24, 2025

@BurntSushi good to know! We should really get that Cargo bug fixed sometime...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants