Skip to content

chore(io): remove shellexpand and use std::env::home_dir#5987

Merged
Xuanwo merged 2 commits intomainfrom
xuanwo/remove-shellexpand-home-dir
Feb 23, 2026
Merged

chore(io): remove shellexpand and use std::env::home_dir#5987
Xuanwo merged 2 commits intomainfrom
xuanwo/remove-shellexpand-home-dir

Conversation

@Xuanwo
Copy link
Copy Markdown
Collaborator

@Xuanwo Xuanwo commented Feb 23, 2026

This PR will replace #5985 since we don't need a new dep

Summary

  • remove shellexpand from workspace and lance-io dependencies
  • replace tilde expansion in lance-io with std::env::home_dir-based logic
  • keep support for ~ and ~/... paths (plus ~\\... on Windows)
  • update lockfile to drop shellexpand

Validation

  • cargo check -p lance-io
  • cargo test -p lance-io test_tilde_expansion -- --nocapture

@github-actions
Copy link
Copy Markdown
Contributor

PR Review

P1: std::env::home_dir() is deprecated

The new expand_tilde_path function uses std::env::home_dir(), which has been deprecated since Rust 1.29.0. The deprecation reason from the Rust docs:

This function's behavior is unexpected and probably not what you want. Consider using a crate from crates.io instead.

On Windows, it returns the value of the HOME environment variable, which can lead to inconsistent behavior compared to what users expect.

Recommendation: Since dirs (version 6.0.0) is already a transitive dependency in the workspace (used by hf-hub and other crates), consider using dirs::home_dir() instead. This would:

  1. Avoid the deprecation warning
  2. Provide more reliable cross-platform behavior
  3. Not add any new dependencies

Example fix:

fn expand_tilde_path(path: &str) -> Option<std::path::PathBuf> {
    let home_dir = dirs::home_dir()?;
    // ... rest unchanged
}

This would require adding dirs to lance-io/Cargo.toml, but the crate is already in your dependency tree.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance-io/src/object_store.rs 76.92% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out!

@Xuanwo Xuanwo merged commit c4e78d2 into main Feb 23, 2026
29 checks passed
@Xuanwo Xuanwo deleted the xuanwo/remove-shellexpand-home-dir branch February 23, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants