Make sha1 optional in gix-hash#2332
Make sha1 optional in gix-hash#2332Sebastian Thiel (Byron) merged 3 commits intoGitoxideLabs:mainfrom
gix-hash#2332Conversation
|
I just went through all instances of |
Sebastian Thiel (Byron)
left a comment
There was a problem hiding this comment.
This is awesome, and I say so after a full armchair review.
Ok, after writing this I had to check it out and compile the variations on gix-hash myself, but it turned out as good as CI implies :).
Actually, I tried this:
cargo test -p gix-hash --no-default-features
I thought this should trigger a compile error, but it doesn't because basically everything one depends on (like gix-testtools) will reference the gix-hash crate, which in turn enables the default hash sha1.
While I don't think this needs to be solved in this PR, I think now we'd have to push the hash selection all the way up to the gix crate 😅.
That would probably reveal a couple of (expected) issues with missing attributes in the gix-hash test suite, while actually fulfilling this PR's promise, which effectively is the ability to compile gix without sha1 support.
Does this follow-up sound interesting to you?
|
I’m not entirely sure I get what you mean. :-) This is the error messages I get when trying to compile Is there something missing? Apart from that, I’m very much interested in moving hash selection to |
|
I am talking about And indeed, to fix it one would have to remove the default Then, one will probably get around exposing the hash toggle in every consumer of |
This PR makes the
sha1flag optional ingix-hash. It modifiesjustfileto runcargo checkas well ascargo nextestwith 3 configurations: withsha1only, withsha256only, with bothsha1andsha256.It’s mostly done, but still opened as a draft, so I can wait for CI to be green before I’m going to mark it as ready.
I haven’t checked all of
gix-hash’s comments yet, some might need minor changes in case they still reference asha1-only world.