Skip to content

Commit

Permalink
Replace dependency on dirs with home
Browse files Browse the repository at this point in the history
The `dirs` crate recently started depending on the `options-ext` crate
which uses copyleft license (MPL). This (unnecessary) dependency causes
licensing issues for various users by possibly poisoning the dependency
tree of their projects[1].

This change replaces the `dirs` crate with `home`. The `home` crate is
maintained by the cargo team and offers the same functionality.

As a bonus, this change also results in a slightly smaller dependency
tree.

[1]:
- artichoke/artichoke#2564
- pyrossh/rust-embed#231
- juhaku/utoipa#834
- harryfei/which-rs#78
  • Loading branch information
the-kenny committed Jan 24, 2024
1 parent 70cab89 commit a2f5f4f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 52 deletions.
60 changes: 10 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pgrx-pg-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dirs = "5.0.1"
home = "0.5.9"
eyre = "0.6.8"
pathsearch = "0.2.0"
owo-colors = "3.5.0"
Expand Down
2 changes: 1 addition & 1 deletion pgrx-pg-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ impl Pgrx {
pub fn home() -> Result<PathBuf, PgrxHomeError> {
let pgrx_home = std::env::var("PGRX_HOME").map_or_else(
|_| {
let mut pgrx_home = match dirs::home_dir() {
let mut pgrx_home = match home::home_dir() {
Some(home) => home,
None => return Err(PgrxHomeError::NoHomeDirectory),
};
Expand Down

0 comments on commit a2f5f4f

Please sign in to comment.