-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(crypto): CRP-2697 Move getrandom wasm32-unknown-unknown workaro…
…und to packages (#3926) This will allow us to publish it to crates.io for use by canister developers outside the monorepo. Rename from ic-crypto-getrandom-for-wasm to ic-dummy-getrandom-for-wasm since that more clearly indicates what it does. That this crate lived in crypto at all is just a historical accident; we happened to be the first team that upgraded a dependency which in turn had a dependency on `rand 0.8`. That is the version of `rand` which relies on `getrandom 0.2`, and `getrandom 0.2` is the first version which intentionally refuses to compile on `wasm32-unknown-unknown`. --------- Co-authored-by: IDX GitHub Automation <[email protected]>
- Loading branch information
Showing
15 changed files
with
53 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
rs/crypto/getrandom_for_wasm/Cargo.toml → ...es/ic-dummy-getrandom-for-wasm/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ic-dummy-getrandom-for-wasm | ||
============================= | ||
|
||
The `rand` crate is widely used in the Rust ecosystem. The `rand` crate in turn | ||
relies on `getrandom` to acquire cryptographic seed material. For policy | ||
reasons, `getrandom` refuses to compile on the `wasm32-unknown-unknown` target | ||
used by the Internet Computer. This prevents using `rand` without workarounds. | ||
|
||
This crate implements such a workaround; on `wasm32-unknown-unknown` target, it | ||
registers a custom getrandom implementation which just returns an error at | ||
runtime. On any other target, it does nothing. | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters