-
Notifications
You must be signed in to change notification settings - Fork 190
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
Feature flags: js, ~~rustix~~ #574
base: master
Are you sure you want to change the base?
Conversation
Size of a dependency's Cargo.lock: 33 -> 29
Size of a dependency's Cargo.lock: 29 -> 16
As I wrote in the issue, I think it's better to introduce an |
@newpavlov features must be additive, so we can't use an The only real alternatives I see here are (1) something similar to this PR but don't enable the backend by default (i.e. require using the feature flag and setting |
Merge due to #573. |
This adds two feature flags: "js" and "rustix". These both enable the corresponding backend and use it by default (still allowing override with
getrandom_backend
, except thatwasm32
sans OS has no viable alternative).Result: a minimal crate dependant on
getrandom
has its lockfile reduced from 33 to 16 entries. Going further than this would require disabling WASI and/or Windows targets by default (windows-targets in particular adds a lot of entries).Compromise: a direct dependency on
getrandom
is needed to enable the required target. And since this also default-enables the target, it likely should only be added in the final binary, as withgetrandom v0.2
. I considered not default-enabling the backend (i.e. one needs to both use--features=js
andgetrandom_backend=wasm_js
to use the backend) but this is likely confusing (besides being tedious).I'm not sure whether this is actually a good idea, but I don't see a better alternative than simply choosing not to address the issue of a large lockfile brought up here.