`home_dir` is lying about its functionality on Unix systems
- Dominant language
- Rust
- Stars
- 66
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
`home` uses `std::env::home_dir` for non Windows systems and states that
https://github.com/brson/home/blob/3a6eccd53357624442eeb03f28abde1941dc433c/src/lib.rs#L42-L43
but after https://github.com/rust-lang/rust/pull/51656/files#diff-b596503c7c33ce457b6d047e351ac12bR516, Rust changes `home_dir` doc on Unixes.
There are two way to move forward now:
- Correct documentation by copying `std::env::home_dir` doc.
After all, POSIX requires systems to init "HOME" env after user loging: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
- Re-implement for all UNIX targets, this is harmful for maintenance. Because unlike Windows,
there are many Unix systems worth considering to support.
* Use dirs-sys crate for implementation part.
cc @brson for advice
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/lib.rs lines 42-43 and compare the current Rust std::env::home_dir documentation with the behavior described in this issue. Review the two proposed directions, including dirs-sys for a Unix implementation, then confirm the chosen approach with a maintainer; done means the documented or implemented Unix behavior matches the supported contract.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, operating-systems
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100