wasm-opt-rs icon indicating copy to clipboard operation
wasm-opt-rs copied to clipboard

Fix unicode paths on windows

Open brson opened this issue 3 years ago • 4 comments

I'm not confident that the conversions are correct. We need some tests that take input and output files with extended-unicode paths, both tests of the api, and of the wasm-opt binary.

brson avatar Aug 15 '22 00:08 brson

master has in ignored test now. Unicode paths don't work on windows yet, but also binaryen just prints to console and exits when it fails to read a file:

Failed opening 'C:\cygwin64\tmp\unicode-α℗$∞ℳ-NgRaw4\hello_world.wasm'

brson avatar Aug 18 '22 22:08 brson

My suspicion is that binaryen doesn't work with unicode paths on windows because it doesn't have any explicit wide char support. I am investigating whether the wasm-opt CLI does somehow work with unicode paths - maybe there's some compatibility hack inside the c++ library, or some alternate way to encode unicode paths on windows that doesn't use wide chars.

brson avatar Aug 30 '22 21:08 brson

I have made progress on this in my binaryen unicode branch: https://github.com/brson/binaryen/tree/unicode

It is able to build a wasm-opt that handles unicode paths on windows. Still have to convert all the other binaries, do some simplifications, write some tests, and figure out how to integrate it into this crate.

brson avatar Jan 25 '23 22:01 brson

This is fixed in binaryen now. Doesn't seem to be in 116, so I'll try to retest in 117.

brson avatar Oct 23 '23 21:10 brson