Implement support for following symlinks
Signed-off-by: Ryan Gonzalez [email protected]
Unfortunately, it wasn't possible to make work as needed without these two PRs to walkdir: https://github.com/BurntSushi/walkdir/pull/159 https://github.com/BurntSushi/walkdir/pull/160
However, it seems that PRs to walkdir have been stagnant since late 2020 / early 2021, so for the purpose of testing, I created a single branch on my fork with both PRs merged in, and Cargo.toml in here is pointing to that branch. I'm not quite sure how to handle this as a result, so this is in draft status. Any thoughts on how to handle this?
Codecov Report
Merging #131 (9492b36) into main (1517cc0) will decrease coverage by
1.96%. The diff coverage is93.75%.
:exclamation: Current head 9492b36 differs from pull request most recent head 29e5f52. Consider uploading reports for the commit 29e5f52 to get more accurate results
@@ Coverage Diff @@
## main #131 +/- ##
==========================================
- Coverage 52.52% 50.56% -1.97%
==========================================
Files 23 19 -4
Lines 4655 2589 -2066
Branches 1531 688 -843
==========================================
- Hits 2445 1309 -1136
+ Misses 1664 1039 -625
+ Partials 546 241 -305
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/find/mod.rs | 62.76% <85.71%> (+1.40%) |
:arrow_up: |
| src/find/matchers/printf.rs | 67.49% <88.88%> (-0.22%) |
:arrow_down: |
| tests/find_cmd_tests.rs | 93.67% <100.00%> (+15.60%) |
:arrow_up: |
| src/lib.rs | 25.70% <0.00%> (-10.17%) |
:arrow_down: |
| src/testing/commandline/main.rs | 70.27% <0.00%> (-1.16%) |
:arrow_down: |
| tests/xargs_tests.rs | ||
| src/xargs/main.rs | ||
| src/xargs/mod.rs | ||
| src/find/matchers/regex.rs | ||
| ... and 3 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 1517cc0...29e5f52. Read the comment docs.
Clap clap:
Warning: Congrats! The bfs test test_L is now passing!
Warning: Congrats! The bfs test test_L_depth is now passing!
Warning: Congrats! The bfs test test_L_type_l is now passing!
Warning: Congrats! The bfs test test_flag_comma is now passing!
Warning: Congrats! The bfs test test_flag_weird_names is now passing!
Warning: Congrats! The bfs test test_type_l is now passing!
Ah nice! This seems to affect quite a few tests. Any ideas for how to handle the walkdir issue, though?
The initial release of findutils was pinned to a specific version in my branch of walkdir, while I waited for https://github.com/BurntSushi/walkdir/pull/19 to be accepted and included in a release.
So it's not without precedent.
Long term, I'd suggest giving it a few months and then making our own branch if the PRs keep piling up there untouched?
Mark
On Mon, Jan 24, 2022 at 3:04 PM Ryan Gonzalez @.***> wrote:
Ah nice! This seems to affect quite a few tests. Any ideas for how to handle the walkdir issue, though?
— Reply to this email directly, view it on GitHub https://github.com/uutils/findutils/pull/131#issuecomment-1020194768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3MQF34BO2IMWYGHUX2HT3UXVTAZANCNFSM5MQ65VVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
It is possible to work around https://github.com/BurntSushi/walkdir/pull/160 the same way fd does it: https://github.com/sharkdp/fd/blob/9f5ed8534e824b3e2a0934ff3aa0b781cb370688/src/walk.rs#L490-L503. But it would be nice if walkdir would do it itself.
@tavianator I was originally going to try using a similar system here, but there were 2 things that made me go with the walkdir patches instead:
- walkdir patches are needed anyway so that
find a-symlinkwill not traverse into it without -L. The alternative would be to manually check if it's a symlink ourselves first but... - ...findutils does seem to use more platform-specific
DirEntryfunctionality that fd does, so re-implementing a customDirEntrywrapper would be a decent bit messier, at least from my initial investigations
That being said, if the walkdir PR stays stagnant for too long, it may be worth switching over.