Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checksum: rework for improving checkum checking GNU behavior match #6654

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

RenjiSann
Copy link
Contributor

This PR makes a significant refactor of the checksum checking code.

The current architecture prevents us to fix #6572, #6614 and #6653.

For #6614, we will need to implement a "retry" step in case we matched the hexa regex and we wish to try again considering the checksum as base64.

The refactor mainly consists in decomposing and extracting functionalities, and improving error management.

It adds several tests, for #6653 and #6572.

Its merge is gated by #6603, as it depends on its commits.

@RenjiSann
Copy link
Contributor Author

I'm aware that this PR is consequent and that the rewrite is complex and difficult to review.

That's why I tried to make meaningful commits so its easier to go step by step.

I'm also considering to split this PR into several smaller ones, but I'm not sure where to split.

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

length: Option<usize>,
}

impl ChecksumAlgoBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a rustdoc comment here

@RenjiSann RenjiSann force-pushed the cksum-rework-bis branch 4 times, most recently from 63362c5 to 86fe708 Compare August 30, 2024 09:59
Copy link

GNU testsuite comparison:

GNU test failed: tests/cksum/cksum-base64. tests/cksum/cksum-base64 is passing on 'main'. Maybe you have to rebase?

Copy link

GNU testsuite comparison:

GNU test failed: tests/cksum/cksum-base64. tests/cksum/cksum-base64 is passing on 'main'. Maybe you have to rebase?

Copy link

GNU testsuite comparison:

GNU test failed: tests/cksum/cksum-base64. tests/cksum/cksum-base64 is passing on 'main'. Maybe you have to rebase?

@RenjiSann RenjiSann force-pushed the cksum-rework-bis branch 2 times, most recently from 1d6dbc4 to 0c8729d Compare August 31, 2024 23:45
@RenjiSann
Copy link
Contributor Author

I've finally managed to fix #6572, which needed a consequent rewrite of the logic.
It still misses stuff like proper documentation, and proper refactoring for it to be maintainable.
It might take me some times to to it, as I won't be available that much in the coming weeks.

But hey, at least it works :)

@RenjiSann
Copy link
Contributor Author

changes: lint fixes + windows code error (as usual :')

@sylvestre
Copy link
Contributor

it is still marked as draft, is it ready to be reviewed?

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/mv/mv-n is no longer failing!
Congrats! The gnu test tests/mv/update is no longer failing!

test(cksum): add test for blake length gessing
test(cksum): add test for hexa/base64 confusion
test(cksum): add test for error handling on incorrectly formatted checksum
test(cksum): add test for trailing spaces making a line improperly formatted
test(cksum): Re-implement GNU test 'cksum-base64' in the testsuite
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.

cksum: gets confused by base64 that happens to consist entirely of hexadecimal digits
2 participants