-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-net-report): Support wasm32 building & running (#3139)
## Description This makes iroh-net-report compile to Wasm. We make sure it's likely to work by grepping the generated Wasm file for "env" imports (which would make it not work in browsers). Mostly this will disable functionality in iroh-net-report for the browser target - specifically, it disables STUN, QAD, ICMP and all other probes besides HTTPS to relays. I've experimentally verified this code works with an integration test, it's really hard to come up with a good strategy for automating this testing due to requiring running cross-languages. I'd like to do that as a follow-up once #3145 is merged. ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant.
- Loading branch information
Showing
10 changed files
with
629 additions
and
277 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use cfg_aliases::cfg_aliases; | ||
|
||
fn main() { | ||
// Setup cfg aliases | ||
cfg_aliases! { | ||
// Convenience aliases | ||
wasm_browser: { all(target_family = "wasm", target_os = "unknown") }, | ||
} | ||
} |
Oops, something went wrong.