gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.61k stars 923 forks source link

WASM Image Tests Do Nothing #4290

Open cwfitzgerald opened 1 year ago

cwfitzgerald commented 1 year ago

Currently all the tests that rely on reading/writing files from disk do not work on wasm and don't actually check the result against anything.

We should build, as part of the xtask infra, a simple http server which allows arbitrary reads/writes as well as flip analysis (as that doesn't compile to wasm). We should look at https://docs.rs/tiny_http/ for this purpose.

kpreid commented 1 year ago

simple http server which allows arbitrary reads/writes

Please make sure it at least has a (sound) parent directory restriction and a file extension restriction, so nobody gets a dev server + a ssh tunnel or something adding up to a vulnerability.

cwfitzgerald commented 1 year ago

Yeah I can add some kind of basic protection, but I don't think I can promise any kind of real safety.

At the least it will only be accessible as part of the xtask that runs the tests.