coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

dd: allow skipping and seeking in FIFOs

Open jfinkels opened this issue 3 years ago • 19 comments

First, this pull request creates a Source enum and simplifies the Input struct in dd, mirroring pull request #4134 that introduced the Dest enum and a simplified Output struct. Second, this pull request adds support seeking in FIFOs given as either input or output (or both). For example, dd seek=1 of=fifo and dd skip=1 if=fifo will now work.

This should cause GNU test suite file tests/dd/no-allocate.sh to change from ERROR to FAIL status.

Fixes #3321.

jfinkels avatar Nov 19 '22 17:11 jfinkels

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 19 '22 17:11 github-actions[bot]

Well, there's a few platform-compatibility issues I'll need to work out, but this is good news:

Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

jfinkels avatar Nov 19 '22 18:11 jfinkels

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 19 '22 18:11 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 19 '22 21:11 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 20 '22 18:11 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 20 '22 18:11 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 20 '22 20:11 github-actions[bot]

Looks like something is not working right on macos:

2022-11-20T20:44:52.4512090Z test test_dd::test_seek_output_fifo has been running for over 60 seconds
2022-11-20T20:44:53.4303380Z test test_dd::test_skip_input_fifo has been running for over 60 seconds

What do you think about just skipping those two tests on macos and opening a new issue requesting an implementation that works on macos? I don't have a Mac computer so it's hard for me to debug these issues.

jfinkels avatar Nov 21 '22 01:11 jfinkels

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 21 '22 02:11 github-actions[bot]

I tried getting the macos build to succeed using @tertsdiepraam's suggestion, but it doesn't seem to work.

jfinkels avatar Nov 27 '22 22:11 jfinkels

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Nov 30 '22 13:11 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!
GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Dec 02 '22 06:12 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Dec 04 '22 05:12 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!
GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Dec 04 '22 16:12 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Dec 06 '22 03:12 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Dec 06 '22 04:12 github-actions[bot]

I think the dd_out should also just become a free function dd, but that's not high priority.

Great minds think alike; I have such a branch on my local machine but it depends on this branch, so I was waiting until this is merged.

jfinkels avatar Dec 07 '22 22:12 jfinkels

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Dec 07 '22 23:12 github-actions[bot]

I skipped the tests for this feature on macos and freebsd because I wasn't sure how to make the implementation work.

jfinkels avatar Dec 08 '22 01:12 jfinkels

GNU testsuite comparison:

GNU test failed: tests/dd/no-allocate. tests/dd/no-allocate is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/rm2. tests/rm/rm2 is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/dd/no-allocate is no longer ERROR!

github-actions[bot] avatar Feb 18 '23 21:02 github-actions[bot]