76 Commits
Author SHA1 Message Date
Yuri Astrakhan ca71248c82 build: add rerun-if-changed for tldr.zip to improve build warnings 2026-09-19 00:10:56 +02:00
xtqqczze 9c707a8cbf fix(build): adjust check for cross-platform building 2026-09-15 09:05:10 +02:00
Sylvestre Ledru 730f676994 feat: add OpenSSL backend for checksum utilities
Add an optional OpenSSL (libcrypto) backend for md5/sha1/sha2-family
digest computations. OpenSSL provides hand-tuned assembly implementations
(AVX2, SSSE3, etc.) that are substantially faster than the pure-Rust
crates on CPUs without SHA-NI hardware instructions.

Benchmarks on Intel i9-7940X (no SHA-NI), 100MB file:
  sha256sum: 470ms -> 234ms (was 1.9x slower than GNU, now ~1.0x)
  sha1sum:   198ms -> 131ms (was 1.6x slower, now ~1.09x)
  sha512sum: 246ms -> 166ms (was 1.4x slower, now ~0.96x - faster!)
  md5sum:    185ms -> 174ms (was 1.2x slower, now ~1.09x)

Closes #12251
2026-06-29 08:37:21 +02:00
xtqqczze 85a817566f build: exclude chcon and runcon from util_map for non-Linux targets 2026-05-19 10:44:02 +02:00
✿ Fleur de Blue 194d9807de build: sort coreutils entries at build time (#10820) 2026-02-08 12:39:33 -08:00
✿ Fleur de Blue 2a2cafdbd4 Re-enable unused_qualifications lint (#10571) 2026-02-03 21:55:21 +01:00
Dorian Peron ade6e8c632 Remove mentions to hashsum 2026-01-31 14:37:33 +01:00
Dorian Peron 70c37a72ad sha512sum: introduce standalone binary 2026-01-28 10:14:14 +01:00
Dorian Peron 417c424213 sha384sum: introduce standalone binary 2026-01-28 10:14:12 +01:00
Dorian Peron 928ca15251 sha256sum: introduce standalone binary 2026-01-28 10:14:10 +01:00
Dorian Peron e5f72019d2 sha224sum: introduce standalone binary 2026-01-28 10:14:07 +01:00
Dorian Peron 6aa5b1fe66 sha1sum: introduce standalone binary 2026-01-28 10:14:03 +01:00
Dorian Peron d22c7e14ec b2sum: introduce standalone binary 2026-01-28 10:14:01 +01:00
Dorian Peron a968342d42 md5sum: introduce standalone binary 2026-01-28 10:13:57 +01:00
Ruiyang Wang eb482fb2ee uudoc: move tldr.zip warning to build.rs (#10039)
Move the tldr.zip missing warning from runtime (uudoc.rs) to compile
time (build.rs). This ensures the warning is printed only once during
the build, instead of 100+ times when make calls uudoc separately for
each utility.

Fixes #9940
2026-01-18 18:54:50 +01:00
E 9b9a913d68 Merge pull request #9153 from oech3/nognuhashsumbin
hashsum: Remove non-GNU binaries (fix cksum interface divergence #8984)
2025-11-08 23:55:49 +01:00
Aaron Ang 2919027841 uudoc: move manpage generation away from the binary 2025-10-22 01:17:08 -07:00
Daniel Hofstetter 8391276bb2 build.rs: adapt to changes in phf_codegen 2025-06-20 18:38:43 +02:00
Sylvestre Ledru a85539f530 Run cargo fmt on the tree 2025-03-24 21:33:12 +01:00
Justin Tracey ff8a31e835 wc: fix escaping
GNU wc only escapes file names with newlines in them.
2024-12-27 11:37:16 -05:00
Samuel Tardieu 39765bf9c9 Do not rebuild the build script unless necessary
Without this guard, the build script is rebuilt as soon as any file
within the package is changed. This includes files created by external
tools such as IDE.
2024-09-03 15:48:40 +02:00
Daniel Hofstetter 1a1490ea59 build.rs: skip "expensive_tests", not a crate 2024-07-03 07:27:21 +02:00
n4n5 81de2be5ab fix clippy src/ 2024-06-30 16:27:00 +02:00
Terts Diepraam c3f9e19a3b all: normalize license notice in all *.rs files 2023-08-24 12:21:09 +02:00
Sylvestre Ledru 9aa59ef915 Don't warn too_many_lines for generated map 2023-08-21 08:41:43 +02:00
Sylvestre Ledru 7d44e96713 coreutils multicall: Sort the command by alphabetic order (for the man) 2023-07-17 22:45:52 +02:00
Sylvestre Ledru 37235d1e20 build.rs: ignore a clippy warning: match_same_arms 2023-03-18 16:28:02 +01:00
Sylvestre Ledru c5728a61b4 fix some clippy warnings (#4229)
* fix some clippy warnings

* Fix the last two
2022-12-14 15:42:07 +01:00
Daniel Hofstetter 3d498432fa build.rs: remove two comments 2022-12-13 15:05:05 +01:00
Terts Diepraam 84b7ecd32d coreutils: update to clap 4 2022-10-13 17:51:01 +02:00
Terts Diepraam adf4bab03c tests: do not generate module structure in build.rs
Generating the tests to run in build.rs created problems for tooling. For example, cargo fmt, was ignoring the test_*.rs files and needed to be passed these files manually to be formatted. Now we simply use the feature mechanism to decide which tests to run.
2022-10-05 13:30:22 +02:00
Jack Grigg fccab8a691 hashsum: Refactor uu_app to isolate non-"GNU Coreutils" options
Several binaries have been added to `hashsum` that have never been part
of GNU Coreutils:

- `sha3*sum` (uutils/coreutils#869)
- `shake*sum` (uutils/coreutils#987)
- `b3sum` (uutils/coreutils#3108 and uutils/coreutils#3164)

In particular, the `--bits` option, and the `--no-names` option added in
uutils/coreutils#3361, are not valid for any GNU Coreutils `*sum` binary
(as of Coreutils 9.0).

This commit refactors the argument parsing so that `--bits` and
`--no-names` become invalid options for the binaries intended to match
the GNU Coreutils API, instead of being ignored options. It also
refactors the custom binary name handling to distinguish between
binaries intended to match the GNU Coreutils API, and binaries that
don't have that constraint.

Part of uutils/coreutils#2930.
2022-06-10 10:07:00 +02:00
Terts Diepraam a10f234854 uudoc: require a feature to build
This is used to not build uudoc by default. See https://github.com/uutils/coreutils/issues/3411
2022-04-25 08:13:28 +02:00
Terts Diepraam 20212be4c8 fix clippy errors related to clap upgrade from 3.0.10 to 3.1.6 2022-03-17 22:46:56 +01:00
Pat Laster 2cd84c2b70 Added b2sum and b3sum utility entries 2022-02-19 11:41:51 -06:00
Sylvestre Ledru de07df5992 Merge pull request #2963 from danieleades/refactor/code-quality
Refactor/code quality
2022-01-30 18:26:16 +01:00
Daniel Eades 784f2e2ea1 use semicolons if nothing returned 2022-01-30 15:08:26 +01:00
Zachary Dremann f9f7e7d490 Avoid unneeded Strings in building phf map 2022-01-30 08:49:34 -05:00
Zachary Dremann bb41f4ffe5 Use a PHF map for util_map()
Rather than building a HashMap at compile time, use the phf (and phf_codegen) crate to build the map
at compile time in build.rs
2022-01-30 06:58:33 -05:00
Terts Diepraam 8872485922 Merge branch 'main' into clap-3 2022-01-17 13:25:51 +01:00
Terts Diepraam 448b84806f fix Rust 1.58 clippy lints (#2874) 2022-01-16 15:57:33 +01:00
Terts Diepraam c93298f32c coreutils: clap 3 2022-01-11 19:16:48 +01:00
Jeffrey Finkelstein f2bf1a7ff7 fixes suggested by nightly version of clippy 2021-12-26 15:45:33 -05:00
Jan Scheer 7c5395a27a build.rs: silence clippy warnings 2021-10-18 23:47:09 +02:00
Jan Scheer 7abc6a665e id: add conditional compilation for selinux 2021-07-13 00:22:10 +02:00
Michael Debertol a9e79c72c7 uutils: enable shell completions
This adds a hidden `completion` subcommand to coreutils. When invoked with
`coreutils completion <utility> <shell>` a completion file will be printed
to stdout. When running `make install` those files will be created for all
utilities and copied to the appropriate locations.
`make install` will install completions for zsh, fish and bash; however,
clap also supports generating completions for powershell and elvish.

With this patch all utilities are required to have a publich uu_app function
that returns a clap::App in addition to the uumain function.
2021-06-25 21:23:45 +02:00
Tuomas Tynkkynen 7b9814c778 test: Implement [ expr ] syntax
When invoked via '[' name, last argument must be ']' or we bail out with
syntax error. Then the trailing ']' is simply disregarded and processing
happens like usual.
2021-06-19 18:49:21 +03:00
ReggaeMuffin 2eb32d845e chores: run cargo +1.40.0 fmt
Apparently fmt from 1.40.0 is a bit more strict in some places

Let me know if this is worthwhile merging :)
2021-04-02 10:56:49 +01:00
Alex Lyon 110d6844ad Use an iterator over OsString for uumain()
Additionally, restructure `uname` so that we don't need to find the
iterator's length.
2020-06-16 03:28:02 -05:00
Roy Ivy III 413b63bf5f maint/build ~ (build.rs) support new tests directory organization 2020-06-02 12:16:16 -05:00