Skip to content

rm: overriding the libc call when implementation does not match gnu coreutils exactly#9604

Open
ChrisDryden wants to merge 7 commits into
uutils:mainfrom
ChrisDryden:example_ld_fix
Open

rm: overriding the libc call when implementation does not match gnu coreutils exactly#9604
ChrisDryden wants to merge 7 commits into
uutils:mainfrom
ChrisDryden:example_ld_fix

Conversation

@ChrisDryden

@ChrisDryden ChrisDryden commented Dec 8, 2025

Copy link
Copy Markdown
Collaborator

This was originally intended to be a demonstration for how we could modify the integration tests to recognize the libc calls we were using.

I discovered that I could wrap the implementation in this helper method to be able to address this tests in a relatively readable way compared to modifying the original code.

As it stands I believe there are three skipped tests in total right now that are skipped for this reason

@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm-readdir-fail is now passing!

1 similar comment
@github-actions

github-actions Bot commented Dec 8, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm-readdir-fail is now passing!

@ChrisDryden ChrisDryden changed the title rm: example of how to override the glibc call when implementation does not match gnu coreutils exactly rm: overriding the libc call when implementation does not match gnu coreutils exactly Dec 8, 2025
@ChrisDryden ChrisDryden marked this pull request as ready for review December 9, 2025 02:36
@sylvestre

Copy link
Copy Markdown
Contributor

sorry, it needs to be rebased

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm-readdir-fail is now passing!

Comment thread util/build-gnu.sh
@@ -5,6 +5,7 @@
# spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW
# spell-checker:ignore baddecode submodules xstrtol distros ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) greadlink gsed multihardlink texinfo CARGOFLAGS
# spell-checker:ignore openat TOCTOU CFLAGS tmpfs gnproc
# spell-checker:ignore hfsplus casefold chattr dirp memcpy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is hfsplus really used?

@sylvestre

Copy link
Copy Markdown
Contributor

need to be rebased

Comment thread util/build-gnu.sh
# * the selinux crate is handling errors
# * the test says "maybe we should not fail when no context available"
sed -i -e "s|returns_ 1||g" tests/cp/no-ctx.sh
"${SED}" -i -e "s|returns_ 1||g" tests/cp/no-ctx.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have

command -v gsed && sed(){ gsed "$@";}
SED=$(command -v gsed||command -v sed) # for find...exec...

@codspeed-hq

codspeed-hq Bot commented Jan 20, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 12.07%

⚡ 4 improved benchmarks
✅ 319 untouched benchmarks
⏩ 46 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation tsort_tree_dag[(10, 3)] 29.1 ms 25.3 ms +15.16%
Simulation tsort_wide_dag[100000] 115.9 ms 102.4 ms +13.23%
Simulation tsort_linear_chain[1000000] 1.4 s 1.3 s +10.34%
Simulation tsort_complex_dag[50000] 73.2 ms 66.8 ms +9.65%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ChrisDryden:example_ld_fix (34e78f0) with main (073b882)2

Open in CodSpeed

Footnotes

  1. 46 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.

  2. No successful run was found on main (844a21a) during the generation of this report, so 073b882 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm-readdir-fail is now passing!

@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/rm/rm-readdir-fail is now passing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/rm/rm-readdir-fail is now passing!

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

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.

3 participants