Skip to content

build: sort coreutils entries at build time#10820

Merged
ChrisDryden merged 1 commit intouutils:mainfrom
Xylphy:coreutils/sort-at-build-time
Feb 8, 2026
Merged

build: sort coreutils entries at build time#10820
ChrisDryden merged 1 commit intouutils:mainfrom
Xylphy:coreutils/sort-at-build-time

Conversation

@Xylphy
Copy link
Contributor

@Xylphy Xylphy commented Feb 8, 2026

Resolves #10811

Removes runtime sorting of coreutils utilities and shifts the ordering work into build.rs.

@Xylphy Xylphy marked this pull request as draft February 8, 2026 15:15
@Xylphy Xylphy force-pushed the coreutils/sort-at-build-time branch from f14f49b to 81917b8 Compare February 8, 2026 15:46
@Xylphy Xylphy force-pushed the coreutils/sort-at-build-time branch from 81917b8 to 8313af7 Compare February 8, 2026 15:48
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

GNU testsuite comparison:

GNU test failed: tests/unexpand/bounded-memory. tests/unexpand/bounded-memory is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/pr/bounded-memory is no longer failing!

@Xylphy Xylphy marked this pull request as ready for review February 8, 2026 17:56
@ChrisDryden
Copy link
Collaborator

Seems like a great change, the only thing I'm thinking is that it might be a good idea to add a regression test since its not immediately clear from the runtime implementation that its relying on build time behavior, maybe something similar to this just in case someone makes changes in this file:

  #[test]
  fn test_list_is_sorted() {
      let result = new_ucmd!().arg("--list").succeeds();
      let lines: Vec<&str> = result.stdout_str().lines().collect();
      let mut sorted = lines.clone();
      sorted.sort_unstable();
      assert_eq!(lines, sorted);
  }

But then again unfortunately we don't have a coreutils integration test file yet.

@ChrisDryden
Copy link
Collaborator

I created an issue for the missing integration test setup for this utility: #10829

I think we should be okay with merging this for now

@ChrisDryden ChrisDryden merged commit 194d980 into uutils:main Feb 8, 2026
154 of 155 checks passed
@Xylphy Xylphy deleted the coreutils/sort-at-build-time branch February 8, 2026 21:57
oech3 pushed a commit to oech3/coreutils that referenced this pull request Feb 9, 2026
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.

coreutils: Do not sort utils at runtime

2 participants