W5
This commit is contained in:
+13
-1
@@ -860,13 +860,25 @@ void compile_shared_unit(Request* context, SharedUnit* su)
|
||||
));
|
||||
|
||||
if(su->compiler_messages.length() == 0 && !su->opt_so_optional && compiler_wasm_unit_compile_enabled(context))
|
||||
su->compiler_messages = trim(shell_exec(shell_escape(compiler_wasm_compile_script(context))+" "+
|
||||
{
|
||||
// The wasm side-module build is best-effort: a unit that cannot compile
|
||||
// to wasm (e.g. try/catch) still works via the native .so and falls back
|
||||
// to native at request time. Record the failure, never fail the unit on
|
||||
// it. On failure, remove any stale .wasm so the backend won't serve it.
|
||||
String wasm_messages = trim(shell_exec(shell_escape(compiler_wasm_compile_script(context))+" "+
|
||||
shell_escape(su->src_path)+" "+
|
||||
shell_escape(su->bin_path)+" "+
|
||||
shell_escape(su->file_name)+" "+
|
||||
shell_escape(su->pre_file_name)+" "+
|
||||
shell_escape(su->wasm_file_name)
|
||||
));
|
||||
if(wasm_messages.length() > 0)
|
||||
{
|
||||
file_put_contents(su->wasm_check_file_name, wasm_messages + "\n");
|
||||
file_unlink(su->wasm_name);
|
||||
printf("(i) wasm side-module unavailable for %s (native .so serves it)\n", su->file_name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
if(su->compiler_messages.length() > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user