Repository navigation
refactor: to have similar structure to uutils/coreutils - #262
toggysmith wants to merge 3 commits into
Conversation
f811086 to
062bcca
Compare
517a649 to
17daa24
Compare
|
uucore is used by coreutils. i will just rename it to diffutils_core |
|
great work btw :) |
|
GNU diffutils testsuite comparison: |
Merging this PR will degrade performance by 3.57%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | cmp_parser |
12.4 µs | 12.8 µs | -3.57% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing toggysmith:split-into-separate-crates (bc9defb) with main (cbc5298)
GnuTests on #262 reported "PASSED: -8 / FAILED: +12" although the branch changes nothing for the testsuite.
GnuTests on #262 reported "PASSED: -8 / FAILED: +12" although the branch changes nothing for the testsuite.
This refactors the codebase to have a more similar structure to uutils/coreutils. Each of the utils have been moved into their own crates under `src/uu` and shared code has been moved into the `src/uucore` crate. Each util crate has a symlink to the licences in the root of the repo.
The name `uucore` belongs to the shared crate of uutils/coreutils, so the shared code of diffutils cannot use it. Rename the crate (and its directory) to `diffutils_core`. Also: - drop the stray `src/uu/cmp/Cargo.lock` (workspace members share the root lockfile) - add the LICENSE symlinks to the shared crate, like the util crates - add `description`/`repository` metadata to the new crates - move the root crate's test-only dependencies back to dev-dependencies Claude-Session: https://claude.ai/code/session_01QK4eB5VFJ91FmZYFy3kphk
17daa24 to
bc9defb
Compare
|
sorry but it needs to be rebased |
| [workspace.package] | ||
| categories = ["command-line-utilities"] | ||
| edition = "2021" | ||
| rust-version = "1.87.0" |
There was a problem hiding this comment.
where does 1.87.0 come from?
please do the MSRV in a separate pr
| pub use unified_diff::diff as unified_diff; | ||
| pub use diffutils_core::*; | ||
| pub use uu_cmp as cmp; | ||
| pub use uu_diff::ed_diff; |
There was a problem hiding this comment.
context_diff and side_by_side_diff are no longer exported, and normal_diff etc are now modules instead of functions.
not purely a refactor, is it intended?
| fn test_permutations() { | ||
| // test all possible six-line files. | ||
| let target = "target/context-diff/"; | ||
| let target = "../../../target/context-diff/"; |
There was a problem hiding this comment.
this breaks with CARGO_TARGET_DIR
could you please use a tempdir instead of ../../../target? (same in the other diff modules)
| .new() | ||
| .arg("-p0") | ||
| .arg("-d") | ||
| .arg(&format!("{target}")) |
There was a problem hiding this comment.
.arg(target) is enough, no?
This refactors the codebase to have a more similar structure to uutils/coreutils.
Each of the utils have been moved into their own crates under
src/uuand shared code has been moved into thesrc/uucorecrate. Each util crate has a symlink to the licences in the root of the repo.The changes here are purely a refactor - nothing else has been changed.