Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External loaders: remove warnings on duplicated binary on $PATH #4833

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Jan 16, 2024

Keep the first path per unique name, only complain about the others in DEBUG.

This makes us behave like any shell and avoids any past, present and future PATH issues that come with Python tools.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@teh-cmc teh-cmc added 🧑‍💻 dev experience developer experience (excluding CI) 😤 annoying Something in the UI / SDK is annoying to use include in changelog labels Jan 16, 2024
@teh-cmc teh-cmc added this to the 0.12.1 milestone Jan 16, 2024
@emilk emilk self-requested a review January 17, 2024 08:47
let mut executables = HashMap::<String, Vec<std::path::PathBuf>>::default();
for dirpath in dirpaths {
let paths = WalkDir::new(dirpath)
.max_depth(1) // don't search recursively
Copy link
Member

Choose a reason for hiding this comment

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

At this point you might as well use std::fs::read_dir (less dependencies)

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the use of walkdir in this instance but we still use it for actually recursive walks in other places so cannot get rid of the dependency entirely

@teh-cmc teh-cmc force-pushed the cmc/dataloader_keep_first branch from ce5b624 to 596d0a8 Compare January 17, 2024 09:50
@teh-cmc teh-cmc merged commit d9fdbd0 into main Jan 17, 2024
40 checks passed
@teh-cmc teh-cmc deleted the cmc/dataloader_keep_first branch January 17, 2024 10:01
emilk pushed a commit that referenced this pull request Jan 17, 2024
Keep the first path per unique name, only complain about the others in
DEBUG.

This makes us behave like any shell and avoids any past, present and
future PATH issues that come with Python tools.
@emilk emilk added the CLI Related to the Rerun CLI label Jan 17, 2024
@emilk emilk changed the title External loaders: shell-like $PATH behavior External loaders: remove warnings on duplicated binary on $PATH Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use CLI Related to the Rerun CLI 🧑‍💻 dev experience developer experience (excluding CI) include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants