-
Notifications
You must be signed in to change notification settings - Fork 480
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
Use --cfg curve25519_dalek_backend
to select backend
#455
Conversation
f9de8b0
to
a4270c4
Compare
Crate features are intended to be additive, whereas only 1-of-N possible backends can be selected. Features can also be activated by transitive dependencies, which leads to a problem of different dependences selecting conflicting backends. Using `--cfg` instead moves all backend selection control to the toplevel executable. This commit switches to the following RUSTFLAGS to enable backends: - `--cfg curve25519_dalek_backend="fiat"`: uses `fiat-crypto` - `--cfg curve25519_dalek_backend="simd"`: uses nightly-only SIMD
a4270c4
to
194dc55
Compare
--cfg
attributes to select backends--cfg curve25519_dalek_backend
to select backend
This is code complete. It still needs corresponding documentation changes. |
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 think this is good to go. The new backend selection docs can be in a new PR, once #453 lands.
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.
Looks great :)
* Restructure README and CHANGELOG * Explain semver policy * Specify feature flags and backends more explicitly * Remove nightly from the CI bc that didn't belong there * Add @pinkforest to thankyou list Co-authored by @pinkforest
I'm sorry I didn't look at this sooner; why is |
@jrose-signal because both the (default) |
Yes, but future backends may not come in such pairs, and the |
My initial PR was embedding it with backend and it became horrondeous to maintain not to mention merge conflicts around where we needed to put cfg() gates between as there is cross-use. |
If future backend doesn't need the selection then people don't need to set those bits - this is just an override not a default. Default is selected automatically and then there is a further lotto over that: I'm documenting it here: |
Yeah, doing anything complex with @jrose-signal I suggest you review #465. It should hopefully eliminate the need for manual |
We also have an issue around that would put the backends into separate crates: I also thought why not re-export "either" via pub (e.g. both u32 and u64 would be known uX) but this would be fairly involved as every export would have to be re-exported and it would be error prone compared checking that imported one is from e.g :u64: |
Crate features are intended to be additive, whereas only 1-of-N possible backends can be selected.
Features can also be activated by transitive dependencies, which leads to a problem of different dependences selecting conflicting backends. Using
--cfg
instead moves all backend selection control to the toplevel executable.This commit switches to the following RUSTFLAGS to enable backends:
--cfg curve25519_dalek_backend="fiat"
: usesfiat-crypto
backend--cfg curve25519_dalek_backend="simd"
: uses nightly-only SIMD backend