Open CryZe opened 5 years ago
Looks like parsing from actual files doesn't work either, so I guess we skip that too. However we have one test where we encode and immediately parse a run as LSS. There we don't need a file system, so in theory it should work. But it doesn't, because the parsing uses the memchr crate internally, which uses cpuid + core::arch on x86, which isn't supported by miri. So if we want to test parsing (which we really should want), then memchr needs to cfg(miri) in the fallback implementation they have. So I guess I'll mark this as blocked in the meantime.
For the file parsing we can just include_str / include_bytes them into the tests. Then we can just parse them normally, once memchr works.
This is now unblocked. memchr 2.3.1 just got released and is miri compatible. AAaaaannnd it's yanked. I guess 2.3.2 will be released soon though.
One problem I'm seeing is that running the tests with miri is VERY SLOW. It's so slow that this is going to cost us a lot of time on CI. Maybe we could run it periodically instead of for every PR.
Run all the suitable tests with miri. Panicking ones and possibly really expensive ones should probably be skipped. Random numbers, such as necessary for Hash Maps are now possible with -Zmiri-seed=123. Accessing time stamps doesn't work with miri either, but fortunately, we already dealt with this problem for wasm-unknown, so miri is just another platform where we mock the time stamps.