-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add --debug flag to cksum #9088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #9088 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a hint to the help text that the debug functionality is not yet implemented? To make it visible to the user that it is a no-op. Otherwise the PR looks good.
|
@cakebaker Updated! ✅ Added the clarification to the help text as requested: English: French: This follows the same pattern used by other utilities in the codebase (cp, mkdir, split) for indicating unimplemented features. The test still passes: |
|
GNU testsuite comparison: |
|
Why not implementing it? |
|
GNU testsuite comparison: |
…debug flag - Add cpufeatures dependency to workspace dependencies (Cargo.toml) - Create new hardware.rs module with CPU feature detection (AVX512, AVX2, PCLMUL, VMULL) - Integrate hardware detection into cksum.rs with startup execution - Update localization strings (en-US.ftl, fr-FR.ftl) to reflect new behavior - Update tests to verify CPU detection messages instead of algorithm names - Fix clippy warnings (use_self, uninlined_format_args) - Ensure fmt compliance This fixes PR uutils#9088 by correctly implementing GNU cksum's --debug flag behavior, which outputs CPU hardware capability detection messages to stderr, not algorithm names.
|
GNU testsuite comparison: |
0d611e3 to
7fd6bd7
Compare
|
GNU testsuite comparison: |
e99e61e to
c4276f6
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
1 similar comment
|
GNU testsuite comparison: |
The cpufeatures crate executes the x86 CPUID instruction to detect CPU features (AVX512, AVX2, PCLMUL). On the Android x86_64 emulator (QEMU-based), this instruction crashes the adb process with exit code 137 (SIGKILL). This fix excludes Android from the cpufeatures dependency and provides safe fallback implementations that return false for CPU feature detection on Android. Fixes: Android CI job failure with exit code 137 Resolves: PR uutils#9088 Android x86_64 emulator crash
|
GNU testsuite comparison: |
The test functions test_cpu_features_detection, test_cpu_features_cached, and test_cpu_features_on_x86_64 call CpuFeatures::detect() which executes the x86 CPUID instruction. On the Android x86_64 emulator, this crashes the adb process with exit code 137 (SIGKILL). This fix adds #[cfg(not(target_os = "android"))] attributes to these tests to prevent them from running on Android, where the CPUID instruction is not supported by the emulator. Fixes: Android CI test failure with exit code 137 Resolves: PR uutils#9088 Android x86_64 emulator crash during tests
|
GNU testsuite comparison: |
The --debug flag tests call CpuFeatures::detect() which executes the x86 CPUID instruction. On the Android x86_64 emulator, this crashes the adb process with exit code 137 (SIGKILL). This fix excludes the debug flag tests from Android builds by adding #[cfg(not(target_os = "android"))] attributes to: - test_debug_flag() - test_debug_with_algorithms() These tests are not needed on Android since the --debug flag functionality is not critical for the Android build, and the CPUID instruction is not available on the emulator. Fixes: Android CI job failure with exit code 137 Resolves: PR uutils#9088 Android x86_64 emulator crash during tests
|
GNU testsuite comparison: |
1 similar comment
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
c8bdf7e to
ca5e8ad
Compare
|
GNU testsuite comparison: |
437db3e to
159dab1
Compare
|
GNU testsuite comparison: |
159dab1 to
22f93d1
Compare
|
GNU testsuite comparison: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should agree on a common implementation to put in uucore for it to be reused for the --debug flag of wc (see #9144)
|
GNU testsuite comparison: |
22f93d1 to
d8939a5
Compare
|
GNU testsuite comparison: |
RenjiSann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I insist on creating a common interface in uucore for retrieving hardware information.
Additionally, it seems that this PR does not fix GNU's cksum.sh test anymore :/
…ction - Add --debug flag to cksum for displaying CPU hardware capabilities - Implement CPU feature detection for x86 (32-bit and 64-bit), aarch64, and loongarch64 - Add target-specific cpufeatures dependency (excluded on Android) - Add comprehensive benchmarks for cksum performance - Add CPU debug info printing with proper Android exclusion - Update localization strings for new --debug flag - Add test fixtures for crc32b algorithm validation
d8939a5 to
e19b34e
Compare
This PR implements the
--debugflag for cksum, split from the original PR #8948.What's included:
--debugCLI argument with help text