Skip to content

Commit 15b31ae

Browse files
rnkgithub-actions[bot]
authored andcommitted
Automerge: [llvm-cas] Fix validation test on Ubuntu / uutils v0.2.2, NFC (#205199)
Work around uutils/coreutils#9128 by implementing the 40 byte truncation in Python. Otherwise, this test fails out of the box on Ubuntu 25.10. GNU coreutils supports -s=arg, but Mac truncate does not. Resorting to Python seemed like the cleanest solution. The next best idea was to use subshells or other techniques to calculate the file size and subtract 40, but that seemed excessive.
2 parents a5ea60c + fa016f6 commit 15b31ae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

llvm/test/tools/llvm-cas/validation.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ RUN: llvm-cas --cas %t/ac --validate
4242

4343
# Note: records are 40 bytes (32 hash bytes + 8 byte value), so trim the last
4444
# allocated record, leaving it invalid.
45-
RUN: truncate -s -40 %t/ac/v1.1/actions.v1
45+
# FIXME: Use `truncate -s -40` once Ubuntu 26.04 is the LTS support baseline,
46+
# see https://github.com/uutils/coreutils/issues/9128
47+
RUN: %python -c "with open(r'%t/ac/v1.1/actions.v1', 'r+b') as f: f.truncate(f.seek(0, 2) - 40)"
4648
RUN: not llvm-cas --cas %t/ac --validate

0 commit comments

Comments
 (0)