Skip to content

chore(deps): remove deprecated home::home_dir()#127

Merged
Stebalien merged 2 commits intoStebalien:masterfrom
reneleonhardt:chore/remove-home
Jul 8, 2025
Merged

chore(deps): remove deprecated home::home_dir()#127
Stebalien merged 2 commits intoStebalien:masterfrom
reneleonhardt:chore/remove-home

Conversation

@reneleonhardt
Copy link
Copy Markdown
Contributor

Chores

  • Replace deprecated home::home_dir() by env::home_dir()
  • Update dependencies
  • Restore previous MSRV 1.63 (home 0.5.11 bumped to 1.81)
  • Fewer dependencies (only windows-sys remains)
  • Fixed a clippy warning (but calling .bytes() remains to be fixed)

Deprecations

rust-lang/cargo#14939
https://github.com/rust-lang/cargo/blob/master/crates/home/README.md?plain=1#L20

you are strongly encouraged to switch to using the standard library's [home_dir] instead

@Stebalien
Copy link
Copy Markdown
Owner

Thanks but I'm tracking the rust version available in debian stable at the moment. Once debian trixie becomes stable, I'll the MSRV in both this crate and tempfile (addressing all the lints, etc. at the same time).

@Stebalien Stebalien closed this Jul 8, 2025
@reneleonhardt
Copy link
Copy Markdown
Contributor Author

Did you check my changes?
As I said, I protected the MSRV 1.63, otherwise the next cargo update would have bumped it:
https://packages.debian.org/bookworm/rust-all

@Stebalien
Copy link
Copy Markdown
Owner

OH! I'm sorry, I misread that.

@Stebalien Stebalien reopened this Jul 8, 2025
@Stebalien
Copy link
Copy Markdown
Owner

Ah, now I remember why I didn't do this. From https://doc.rust-lang.org/std/env/fn.home_dir.html#windows:

Before Rust 1.85.0, this function used to return the value of the ‘HOME’ environment variable on Windows, which in Cygwin or Mingw environments could return non-standard paths like /home/you instead of C:\Users\you.

However, that only applies to very specific Windows environments, not Debian.

@reneleonhardt
Copy link
Copy Markdown
Contributor Author

Great, I just saw stable since = "1.0.0" but not for exotic windows environments :(

Can we assume that /home/you isn't reachable/mapped inside MinGW to the correct /c/Users/you?

@Stebalien
Copy link
Copy Markdown
Owner

Can we assume that /home/you isn't reachable/mapped inside MinGW to the correct /c/Users/you?

Probably not. BUT we don't really need to support rust 1.63 on Windows (I'll document the differences).

@Stebalien Stebalien merged commit c53483c into Stebalien:master Jul 8, 2025
6 checks passed
@reneleonhardt reneleonhardt deleted the chore/remove-home branch July 8, 2025 21:00
@Stebalien
Copy link
Copy Markdown
Owner

Hm. Apparently the readme already has the following caveat:

Unfortunately, if you're using a non-windows console on Windows (e.g. MinGW,
Cygwin, Git Bash), you'll need to set the TERMINFO environment variable to
point to the directory containing the terminfo database.

So this is really a non-issue on Windows.

@reneleonhardt
Copy link
Copy Markdown
Contributor Author

Great to hear that no users would be affected!

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.

2 participants