Repository navigation
Conversation
|
GNU testsuite comparison: |
38a95a3 to
82ff922
Compare
| /// | ||
| /// * `bool` - Returns `true` if the paths are hard links to the same file, and `false` otherwise. | ||
| #[cfg(unix)] | ||
| pub fn are_hardlinks_to_same_file(source: &Path, target: &Path) -> bool { |
There was a problem hiding this comment.
the unit tests below are still #[cfg(unix)], please enable them on windows too since the function now works there
| /// | ||
| /// * `bool` - Returns `true` if either of above conditions are true, and `false` otherwise. | ||
| #[cfg(unix)] | ||
| pub fn are_hardlinks_or_one_way_symlink_to_same_file(source: &Path, target: &Path) -> bool { |
There was a problem hiding this comment.
on windows from_path actually opens the file, so a file we can't open now silently compares as "not the same" - is that ok for cp/mv?
| @@ -790,23 +784,17 @@ pub fn are_hardlinks_to_same_file(_source: &Path, _target: &Path) -> bool { | |||
| /// # Returns | |||
There was a problem hiding this comment.
CI is red (tests unix), could you please check it's not coming from this change? thanks
82ff922 to
2f7dc47
Compare
2f7dc47 to
9df2922
Compare
9df2922 to
09c01f9
Compare
Merging this PR will improve performance by 15.97%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | factor_three_39_bit_primes |
544.3 ms | 394.7 ms | +37.89% |
| ⚡ | Simulation | factor_five_38_bit_primes |
1.9 s | 1.8 s | +8.84% |
| ⚡ | Simulation | factor_thirteen_39_bit_primes |
9 s | 8.6 s | +3.91% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing wtcpython:fs-unify-hardlink (7506795) with main (fcfb6d8)2
Footnotes
-
70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(853c36d) during the generation of this report, so fcfb6d8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
09c01f9 to
46a78a1
Compare
| } | ||
|
|
||
| #[cfg(unix)] | ||
| #[cfg(not(target_os = "wasi"))] |
There was a problem hiding this comment.
This gate was widened to include Windows, but it uses Unix-only imports that aren't in scope here. Its body calls tempdir() and unix::fs::symlink(...), but both use std::os::unix; and use tempfile::tempdir; in the test module remain gated behind #[cfg(unix)] only (unchanged by this PR).
Reproduced with cargo check -p uucore --tests --target x86_64-pc-windows-gnu --no-default-features --features fs:
error[E0433]: cannot find module or crate
unixin this scope
--> src/uucore/src/lib/features/fs.rs:1400:9
error[E0425]: cannot find functiontempdirin this scope
--> src/uucore/src/lib/features/fs.rs:1396:24
There was a problem hiding this comment.
Created this #15301 to ensure uucore is checked on Windows.
46a78a1 to
b06218d
Compare
b06218d to
7506795
Compare
Hard-link detection currently has separate Unix logic and always returns false on other platforms.
This reuses FileInformation for both hard-link checks, preserving the existing Unix behavior and enabling the same checks on Windows and WASI.