Skip to content

Commit

Permalink
Replace dependency on dirs with home (#1490)
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
minor inconveniences by e.g. requiring users to ship a download link
to the crate's source code (already published on crates.io). More
importantly, we would like to not have more random questions about
licensing updates that seem like they are poorly motivated.

This change replaces the `dirs` crate with `home`. The `home` crate is
maintained by the cargo team and offers the same functionality.
  • Loading branch information
the-kenny authored Jan 29, 2024
1 parent 8eba7ef commit 9212eee
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 @@ -28,7 +28,7 @@ eyre.workspace = true
owo-colors.workspace = true
url.workspace = true

dirs = "5.0.1"
home = "0.5.9"
pathsearch = "0.2.0"
serde = { version = "1.0", features = [ "derive" ] }
serde_derive = "1.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 9212eee

Please sign in to comment.