-
-
Notifications
You must be signed in to change notification settings - Fork 414
feat: add sha256 feature to gix-object
#2359
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ path = "./benches/edit_tree.rs" | |
|
|
||
|
|
||
| [features] | ||
| ## Support for SHA256 hashes and digests. | ||
| sha256 = ["gix-hash/sha256"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also realise that the test has to enable all hashes itself, it can do so |
||
| ## Data structures implement `serde::Serialize` and `serde::Deserialize`. | ||
| serde = [ | ||
| "dep:serde", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also realise that for
docs.rsone can only set features that are defined in the crate itself, which means that we'd always have to repeat the hash features here (and enable one of them for docs.rs) so docs don't break.On the bright side, this automatically sets everything up to for a non-default SHA1 feature which should follow soon. Maybe it can be implemented so that we also enable at least one hash with a RUSTFLAG, that way CI can easily be tuned to not fail, and to no need adjustments for each and every invocation… heck, this flag could even be set in
.cargo/config.tomlin this repository.It feels a bit like I should set that up, but what matters most as that you can keep going exactly like this.
I have also update the tasks here: #281 (comment) - sorry the fuzzyness, the groundworks I should just do in this case.
Previously written
When seeing this, I wonder if we really should go down that route. Albeit having written about it, i.e. having each consumer of
gix-hashprovide asha1/sha256feature, I also remember now that for this very case we havegix-features.The idea is that at most, consumers pull that in and use it to configure certain basics.
gix-hashtechnically is such a basic now.Thus we could claim that without hash configuration, which really can only happen in plumbing, there will be a helpful compiler error guiding users to pulling in
gix-hashto set up its hash support.If you don't feel strongly about that, then let's try this? If it's unclear what to do, I could also make the change here, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure I fully understand the relationship between
gix-featuresand feature flags just yet, but regardless, if you want to do some or most parts of this yourself, that’s completely fine with me! You know better what the strategic goals are while I’ve been approaching these tasks more from a tactical point of view so far. The only thing I’d ask for is advance notice on relevant PRs, so I can avoid doing unnecessary work. 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'd also want to avoid waste. To remove some of the insecurity I stirred up here, I think
gix-featuresisn't involved as each downstream crate must have their own feature toggles for hashes. The only reason for this isdocs.rswhich now must also set the hash (once there is no default hash), and can only do so for the crate it generates docs for.