Skip to content

Breaking: Adapt coreutils dev file structure V2#206

Open
GunterSchmidt wants to merge 10 commits intouutils:mainfrom
GunterSchmidt:reorg_to_coreutils_structure
Open

Breaking: Adapt coreutils dev file structure V2#206
GunterSchmidt wants to merge 10 commits intouutils:mainfrom
GunterSchmidt:reorg_to_coreutils_structure

Conversation

@GunterSchmidt
Copy link
Copy Markdown
Contributor

Adapting the project structure to the coreutils structure.

This replaces PR #201.

TL;DR: Diff and Cmp now in separate folders with clap parser and international help, info and error messages. Tests and Bench adapted.

coreutils uses a source code tree, which has each tool in a separate dir unter /uu,
a separate library tree and the main file under /bin. Also a number of features are
available in another directory.

Adaptiong this structure allows more usage of the coreutils macros
and methods. It makes it easier for the developers to navigate when
working in both projects.

Each utility can now be opened standalone
which makes it also easier to test and benchmark.

Since it is a file location restructure, the commit is containing
a lot of files. The core compare logic was left unchanged as much as
possible.

This PR contains a number of commits so the change steps become clearer.

Update of utils 'diff' and 'cmp':

  • use clap parser (for diff 10x faster)
  • parser implements all options and returns
    not yet implemented error vs unexpected option
  • internationalization of error and
    info messages, e.g. help
  • moved main tests
    (still has some module tests)
  • separated and moved benches
  • clean up old code
  • adapted fuzzer
  • includes fix for SIGPIPE panics #192
  • Adapted diffutils main to coreutils main based on @oech3 PR 11385 of coreutils

Gunter Schmidt and others added 7 commits March 26, 2026 12:06
For Code Spell Checker extension.
The file structure with
* bin for the main executable
* uu for the utilities
* uudiff for the libraries
was introduced.

To minimize changes, only these changes were done:
* move files to uu_ subdirectories
* main() --> uumain()
* bin/diffutils.rs replaces old main

This required:
* adjust modules in files
* adjust paths in tests

Whenever possible, methods of coreutils were used directly. For localization reasons, some modules needed to be copied and adapted for diffutils.

Issues: The tool dist was adapted as much as possible but may not work with this setup.
* requires all packages to be in the same repository
* possibly requires a separate README.md for each tool
* use clap parser
* internationalization of error and
  info messages, e.g. --help
* moved tests into tests by-util
* separated and moved benches
* adapted fuzzer
* common parser error handling for all modules
* some fixes, e.g. error on selection of a directory
* use clap parser (10x faster)
* parser implements all options with
  not yet implemented error
* internationalization of error and
  info messages, e.g. help
* moved main tests
  (still has some module tests)
* separated and moved benches
* clean up old code
* adapted fuzzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant