coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Remove all uses of `crash!`

Open tertsdiepraam opened this issue 2 years ago • 6 comments

The crash! macro is a leftover from old error handling in this project. We should always use UError and show! now.

Here are all uses of crash!: https://github.com/search?q=repo%3Auutils%2Fcoreutils%20crash!&type=code

We can tackle each of these in separate PRs. Make sure not to link those PRs to this issue (so don't write "closes #XXXX"), because that might close it prematurely. Only I've started here: https://github.com/search?q=repo%3Auutils%2Fcoreutils%20crash!&type=code

This is a good first issue if you're looking for one!

tertsdiepraam avatar Nov 02 '23 15:11 tertsdiepraam

Awesome work here everyone! Just a couple of uses left!

tertsdiepraam avatar Nov 26 '23 11:11 tertsdiepraam

I tried to run the cargo test and got the result below. Is the output intended like this?

failures:

---- test_du::test_du_no_dereference stdout ----
mkdir: /tmp/.tmpaRZr6V/a_dir
symlink: /tmp/.tmpaRZr6V/a_dir,/tmp/.tmpaRZr6V/symlink
run: /home/nemesis/Documents/Github/Focus/util/coreutils_master/target/debug/coreutils du -P
run: /home/nemesis/Documents/Github/Focus/util/coreutils_master/target/debug/coreutils du --dereference -P
run: /home/nemesis/Documents/Github/Focus/util/coreutils_master/target/debug/coreutils du -P --dereference
thread 'test_du::test_du_no_dereference' panicked at tests/by-util/test_du.rs:372:14:
'4	./a_dir
8	./subdir/deeper/deeper_dir
16	./subdir/deeper
16	./subdir/links
36	./subdir
48	.
' does not contain 'symlink'


failures:
    test_du::test_du_no_dereference

test result: FAILED. 2540 passed; 1 failed; 28 ignored; 0 measured; 0 filtered out; finished in 60.97s

error: test failed, to rerun pass `--test tests`

allaboutevemirolive avatar Nov 27 '23 00:11 allaboutevemirolive

@allaboutevemirolive I get the same error on my local machine whereas it works fine in the CI. On my machine it is because /tmp is using tmpfs and there du --dereference doesn't work with both GNU du and uutils du.

cakebaker avatar Nov 27 '23 08:11 cakebaker

Should we make a separate issue for that? It seems unrelated to this one

tertsdiepraam avatar Nov 27 '23 11:11 tertsdiepraam

What concerns me is; why this error did not trigger repo CI? @tertsdiepraam

allaboutevemirolive avatar Nov 27 '23 11:11 allaboutevemirolive

I'd love to discuss that in another issue :)

(It's probably like @cakebaker said because of the filesystem in the CI being different)

tertsdiepraam avatar Nov 27 '23 12:11 tertsdiepraam