-
Notifications
You must be signed in to change notification settings - Fork 211
Remove dummy
feature
#107
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove dummy
feature
#107
Conversation
We should be really careful to not leak v0.2 breaking changes to Personally I think it should be fine to use the dummy impl for |
The basic idea here is that we only care about The basic idea would be to detect The alternative to the above would be making |
How would it work in the context of using Also I am strongly against having for @koute |
We would just not use the #[cfg(not(target_arch = "wasm32", target_os = "unknown"))]
getrandom::getrandom(&mut buf).unwrap(); and in the [target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dependencies]
getrandom = { version = "0.2", default-features = false, features = ["rustc-dep-of-std"] } We could avoid the messy
If we want to go this route, we would make This actually might be more reasonable, as
Are they using |
See for example substrate, also I've heard folks are experimenting with WASM for plugin systems (although they could've migrated to WASI).
I think there is some interest, but looks like it's not a priority right now. Either way, I don't think we should introduce conceptually wrong solutions, just because stuff is used in a roundabout way due to the lack of better alternatives. |
I think that's fair. Would the idea of having [dependancies]
getrandom = "0.2"
# The 'rand' crate can just rename optional dependencies in lieu of features
wasm-bindgen = { package = "getrandom-wasm-bindgen", version = "0.2", optional = true }
stdweb = { package = "getrandom-stdweb", version = "0.2", optional = true } without breaking back-compat. A crate that only cares about [dependancies]
getrandom = "0.2"
getrandom-wasm-bindgen = "0.2" |
I am not yet sure how your custom RNG provider idea works yet, so I can't really tell. But note that we should not break users who have lines like this in their [dependencies]
rand = "0.7"
getrandom = { version = "0.1", features = ["wasm-bindgen"] } I think we can work around cascading feature from v0.1 to v0.2 by using semver-trick, but I don't see how it would work with your idea. In the worst case scenario we may have to wait until |
Huh, TIL about semver-trick. That’s very clever.
I’m pretty sure I can make it work, but I’ll need to double check with a
few tests. Supporting this scenario is important though, and we definitely
need it if we want to avoid just updating everything at one.
…On Thu, Sep 19, 2019 at 19:05 Artyom Pavlov ***@***.***> wrote:
I am not yet sure how your custom RNG provider idea works yet, so I can't
really tell. But note that we should not break users who have lines like
this in their Cargo.toml:
[dependencies]rand = "0.7"getrandom = { version = "0.1", features = ["wasm-bindgen"] }
I *think* we can work around cascading feature from v0.1 to v0.2 by using
semver-trick, but I don't see how it would work with your idea. In the
worst case scenario we may have to wait until rand v0.8 and rand_core v0.6
to do v0.3 release.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#107?email_source=notifications&email_token=ABKAIDHQOUUJXT6M2A6ZBBLQKQVWNA5CNFSM4IYQ3GFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7FKEXI#issuecomment-533373533>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABKAIDBHDYF76U7FXKJVIVTQKQVWNANCNFSM4IYQ3GFA>
.
|
The problem with semver-trick is that you need a new To back up a bit, I feel like I missed the whole rationale for this PR. In #71 we added the Shouldn't we wait until we have implemented a new solution for Regarding @josephlr's proposals:
Sounds interesting and possibly worth wider testing, if we can find a way to do that without risking lots of breakage (ideally with a pre-release version; unfortunately they don't tend to get enough attention; worse in this case that most users come through Though given the rationales against making assumptions about
This could work, but would be opt-in, akin to the current feature flags; in this case I think there's still good reason to keep the |
@dhardy this is a fair point. Do you want me to push the custom RNG proposal in this PR? Or close this PR and open a new one? |
I think we can just leave this PR on the side while you open a new PR for that. |
As mentioned in #109 I'm happy to merge this, since if it proves necessary to enough people we can add again later (but hopefully we won't need to). On the other hand I see no reason we need to remove the |
@josephlr |
Indeed, this may be a problem for @josephlr sorry for the poor communication on my part; the reason I didn't merge this myself was to wait for comment from @newpavlov. Lets leave this for now and move on to #109, but we may have to revisit this (perhaps for 0.2.1). |
Removes the “dummy” feature and “wasm32-unknown-unknown” dummy impl
Removes the “dummy” feature and “wasm32-unknown-unknown” dummy impl
This is a breaking change for #98, so it's being merged against the
0.2
branch.While this change alone would make it difficult for
rand_core
to usegetrandom 0.2
without exposing a breaking change itself (due towasm32-unknown-unknown
breaking), the upcoming PR to address #4 should help in this regard.