Restrict validation output to just validation errors in the API#1253
Restrict validation output to just validation errors in the API#1253kripken merged 4 commits intoWebAssembly:masterfrom
Conversation
|
Hmm, I find this quite useful myself as a developer :) How else would you print out the erroring module? If you add But if this is annoying it could be optional. Perhaps one of the current debug env vars ( |
|
Imho the respective tool (using the API) should provide printing of the entire module as an option, not the API itself where one function should do one thing. For instance, one could simply do leading to the exact same output as before, while there is no way to print just the validation messages (which I am interested in) as it is atm. Just removing this line and leaving it up to the user to print the module contents where necessary also avoids adding more options (do env vars even work in JS?). |
|
I see, I was thinking more form the point of view of a commandline tool. Yeah, I agree we should do it the way you propose, by making printing the module optional, and we should make it print the module in the commandline tools like wasm-opt, so the user of those tools doesn't see a change from this PR (while people making their own tools using the C API can choose to print the module or not). |
|
(About env vars and js, emscripten does support |
|
This commit should add explicit printing of the module to all places where it has been printed before but then wasn't due to the change. |
| assert(WasmValidator().validate(*modules[moduleName])); | ||
| bool valid = WasmValidator().validate(*modules[moduleName]); | ||
| if (!valid) { | ||
| WasmPrinter::printModule(modules[moduleName].get()); |
There was a problem hiding this comment.
Hmm, this does change the semantics, before it would not even check if assertions are off. But I see no downside to making this change, probably better actually.
|
Overall this looks like the right direction, but the CI errors show that we are printing the module when testing |
|
I am a bit puzzled what's going on there. Unfortunately, I cannot run the waterfall tests on Windows because there are no such binaries ( |
d38bab9 to
2e0a58e
Compare
|
Just checked: Local output is the same as shown on Travis. |
|
Yeah, that's odd - it seems like it should have been printed before too. Anyhow, your fix is the right one, in wasm-shell we actually don't want to print it, it has tests that are supposed to fail, without printing. |
This restricts validation output to validation errors in the API, leaving additional and possibly very longish printing of the entire module up to the respective tool.