WASM bugs with `--closed-world`: "publicly exposed type disallowed"
sgammon opened this issue · 11 comments
Describe the bug
When trying to build the WASM samples on macOS, the new --closed-world
flag is causing some issues. At first, I needed to build binaryen
from trunk to get access to the --closed-world
flag at all. Then, after building from trunk, I get the errors listed below.
Expand to see error
INFO: Analyzed target //elide/runtime/wasm:app (1 packages loaded, 3 targets configured). INFO: Found 1 target... ERROR: /Users/sam/Workspace/elide/runtime/elide/runtime/wasm/BUILD.bazel:36:19: Compiling to WASM (stage 2) failed: (Exit 1): sandbox-exec failed: error executing command (cd /private/var/tmp/_bazel_sam/c0ebc818094f3f93979fa2f76ac9e009/sandbox/darwin-sandbox/1849/execroot/elide && \ exec env - \ TMPDIR=/var/folders/pd/mk9dc77s7cx3j21n6pdt7v200000gn/T/ \ /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_sam/c0ebc818094f3f93979fa2f76ac9e009/sandbox/darwin-sandbox/1849/sandbox.sb /var/tmp/_bazel_sam/install/6b64cf61be23912f883b7ed0a05b85cf/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_google_j2cl/third_party/binaryen --enable-exception-handling --enable-gc --enable-reference-types --enable-sign-ext --enable-strings --enable-nontrapping-float-to-int --nominal --traps-never-happen --debuginfo '--symbolmap=bazel-out/darwin_arm64-fastbuild/bin/elide/runtime/wasm/app.map' -o bazel-out/darwin_arm64-fastbuild/bin/elide/runtime/wasm/app.wasm --output-source-map bazel-out/darwin_arm64-fastbuild/bin/elide/runtime/wasm/app_source.map --output-source-map-url app_debug/app_source.map '--partial-inlining-ifs=4' '-fimfs=50' --closed-world --gufa -O3 -O3 -O3 --gufa -O3 --intrinsic-lowering --gufa -O3 -O3 --input-source-map bazel-out/darwin_arm64-fastbuild/bin/elide/runtime/wasm/app_intermediate_source_map bazel-out/darwin_arm64-fastbuild/bin/elide/runtime/wasm/app_intermediate_wasm_output.wasm) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Object, on (struct (field (ref $struct.0) (ref $struct.1) (mut i32))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Class, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (ref null $struct.2) (ref null $struct.2) i8 i8 i8 i32 (ref null $struct.3) (ref null $struct.3) (mut (ref null $struct.4))) $struct.5) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Class.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8) (ref $func.9) (ref $func.10) (ref $func.11) (ref $func.12) (ref $func.13) (ref $func.14) (ref $func.15)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Class.itable, on (struct_subtype (field (ref $struct.0) (ref $struct.1) dataref dataref dataref dataref dataref) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.String, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut stringref) (mut i32)) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfObject, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut i32) (mut (ref null $array.0))) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfObject.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8) (ref $func.9) (ref $func.10)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfObject.itable, on (struct_subtype (field (ref $struct.0) dataref dataref (ref $struct.1) dataref dataref dataref) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Object.array, on (array (mut (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut i32)) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.itable, on (struct_subtype (field (ref $struct.0) dataref dataref (ref $struct.1) dataref dataref dataref) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.io.Serializable.vtable, on (struct) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Cloneable.vtable, on (struct) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Object.itable, on (struct_subtype (field dataref dataref dataref dataref dataref dataref dataref) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $itable, on (struct (field dataref dataref dataref dataref dataref dataref dataref)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_equals__java_lang_Object__boolean, on (func (param (ref $struct.0) (ref null $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_hashCode__int, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toString__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getClass__java_lang_Class, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getLength__int, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_newArray__int__java_lang_Object_$pp_javaemul_internal, on (func (param (ref $struct.0) i32) (result (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_setLength__int__void_$pp_javaemul_internal, on (func (param (ref $struct.0) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_copyFrom__int__javaemul_internal_WasmArray__int__int__void_$pp_javaemul_internal, on (func (param (ref $struct.0) i32 (ref null $struct.1) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Object.vtable, on (struct (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_setLength__int__void, on (func (param (ref $struct.0) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_push__java_lang_Object__void, on (func (param (ref $struct.0) (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insertFrom__int__javaemul_internal_WasmArray_OfObject__void, on (func (param (ref $struct.0) i32 (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.String.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8) (ref $func.9) (ref $func.10) (ref $func.11) (ref $func.12) (ref $func.13) (ref $func.14) (ref $func.15) (ref $func.16) (ref $func.17) (ref $func.18) (ref $func.19) (ref $func.20) (ref $func.21) (ref $func.22) (ref $func.23) (ref $func.24) (ref $func.25) (ref $func.26) (ref $func.27) (ref $func.28) (ref $func.29) (ref $func.30) (ref $func.31) (ref $func.32) (ref $func.33) (ref $func.34) (ref $func.35) (ref $func.36) (ref $func.37) (ref $func.38) (ref $func.39) (ref $func.40) (ref $func.41) (ref $func.42) (ref $func.43) (ref $func.44) (ref $func.45) (ref $func.46) (ref $func.47) (ref $func.48) (ref $func.49) (ref $func.50) (ref $func.51) (ref $func.52) (ref $func.53) (ref $func.54)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.String.itable, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (ref $struct.2) dataref dataref dataref dataref) $struct.3) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Comparable.vtable, on (struct (field (ref $func.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.CharSequence.vtable, on (struct (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_charAt__int__char, on (func (param (ref $struct.0) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_chars__java_util_stream_IntStream, on (func (param (ref $struct.0)) (result (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_length__int, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_subSequence__int__int__java_lang_CharSequence, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_compareTo__java_lang_Object__int, on (func (param (ref $struct.0) (ref null $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_codePointAt__int__int, on (func (param (ref $struct.0) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_codePointBefore__int__int, on (func (param (ref $struct.0) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_codePointCount__int__int__int, on (func (param (ref $struct.0) i32 i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_compareTo__java_lang_String__int, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_compareToIgnoreCase__java_lang_String__int, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_concat__java_lang_String__java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_contains__java_lang_CharSequence__boolean, on (func (param (ref $struct.0) (ref null $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_contentEquals__java_lang_CharSequence__boolean, on (func (param (ref $struct.0) (ref null $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_contentEquals__java_lang_StringBuffer__boolean, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_endsWith__java_lang_String__boolean, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_equalsIgnoreCase__java_lang_String__boolean, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getBytes__arrayOf_byte, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getBytes__java_lang_String__arrayOf_byte, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getBytes__java_nio_charset_Charset__arrayOf_byte, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getChars__int__int__arrayOf_char__int__void, on (func (param (ref $struct.0) i32 i32 (ref null $struct.1) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getChars0__int__int__arrayOf_char__int__void_$pp_java_lang, on (func (param (ref $struct.0) i32 i32 (ref null $struct.1) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_indexOf__int__int, on (func (param (ref $struct.0) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_indexOf__int__int__int, on (func (param (ref $struct.0) i32 i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_indexOf__java_lang_String__int, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_indexOf__java_lang_String__int__int, on (func (param (ref $struct.0) (ref null $struct.1) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_isEmpty__boolean, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_lastIndexOf__int__int, on (func (param (ref $struct.0) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_lastIndexOf__int__int__int, on (func (param (ref $struct.0) i32 i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_lastIndexOf__java_lang_String__int, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_lastIndexOf__java_lang_String__int__int, on (func (param (ref $struct.0) (ref null $struct.1) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_matches__java_lang_String__boolean, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_offsetByCodePoints__int__int__int, on (func (param (ref $struct.0) i32 i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_regionMatches__boolean__int__java_lang_String__int__int__boolean, on (func (param (ref $struct.0) i32 i32 (ref null $struct.1) i32 i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_regionMatches__int__java_lang_String__int__int__boolean, on (func (param (ref $struct.0) i32 (ref null $struct.1) i32 i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_replace__char__char__java_lang_String, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_replace__java_lang_CharSequence__java_lang_CharSequence__java_lang_String, on (func (param (ref $struct.0) (ref null $struct.0) (ref null $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_replaceAll__java_lang_String__java_lang_String__java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1) (ref null $struct.1)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_replaceFirst__java_lang_String__java_lang_String__java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1) (ref null $struct.1)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_split__java_lang_String__arrayOf_java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_split__java_lang_String__int__arrayOf_java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1) i32) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_startsWith__java_lang_String__boolean, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_startsWith__java_lang_String__int__boolean, on (func (param (ref $struct.0) (ref null $struct.1) i32) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_substring__int__java_lang_String, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_substring__int__int__java_lang_String, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toCharArray__arrayOf_char, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toLowerCase__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toLowerCase__java_util_Locale__java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toUpperCase__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toUpperCase__java_util_Locale__java_lang_String, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_trim__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_toJsString__java_lang_String_NativeString, on (func (param (ref $struct.0)) (result stringref)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.util.Locale, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32)) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.util.Locale.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.util.Locale.itable, on (struct_subtype (field dataref dataref dataref dataref dataref dataref dataref) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfChar, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut i32) (mut (ref null $array.0))) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfChar.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfChar.itable, on (struct_subtype (field (ref $struct.0) dataref dataref (ref $struct.1) dataref dataref dataref) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $char.array, on (array (mut i16)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.nio.charset.Charset, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (ref null $struct.2)) $struct.3) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfByte, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut i32) (mut (ref null $array.0))) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfByte.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8) (ref $func.9)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $javaemul.internal.WasmArray.OfByte.itable, on (struct_subtype (field (ref $struct.0) dataref dataref (ref $struct.1) dataref dataref dataref) $struct.2) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $byte.array, on (array (mut i8)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_push__byte__void, on (func (param (ref $struct.0) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.nio.charset.Charset.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.nio.charset.Charset.itable, on (struct_subtype (field dataref (ref $struct.0) dataref dataref dataref dataref dataref) $struct.1) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_name__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_compareTo__java_nio_charset_Charset__int, on (func (param (ref $struct.0) (ref null $struct.1)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.StringBuffer, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut (ref null $struct.2)) (mut i32) (mut i8)) $struct.3) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.StringBuffer.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8) (ref $func.9) (ref $func.10) (ref $func.11) (ref $func.12) (ref $func.13) (ref $func.14) (ref $func.15) (ref $func.16) (ref $func.17) (ref $func.18) (ref $func.19) (ref $func.20) (ref $func.21) (ref $func.22) (ref $func.23) (ref $func.24) (ref $func.25) (ref $func.26) (ref $func.27) (ref $func.28) (ref $func.29) (ref $func.30) (ref $func.31) (ref $func.32) (ref $func.33) (ref $func.34) (ref $func.35) (ref $func.36) (ref $func.37) (ref $func.38) (ref $func.39) (ref $func.40) (ref $func.41) (ref $func.42) (ref $func.43) (ref $func.44) (ref $func.45) (ref $func.46) (ref $func.47) (ref $func.48) (ref $func.49) (ref $func.50) (ref $func.51) (ref $func.52) (ref $func.53) (ref $func.54) (ref $func.55) (ref $func.56) (ref $func.57) (ref $func.58) (ref $func.59) (ref $func.60) (ref $func.61) (ref $func.62) (ref $func.63) (ref $func.64) (ref $func.65) (ref $func.66) (ref $func.67) (ref $func.68) (ref $func.69)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.StringBuffer.itable, on (struct_subtype (field (ref $struct.0) dataref (ref $struct.1) (ref $struct.2) dataref dataref dataref) $struct.3) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.AbstractStringBuilder, on (struct_subtype (field (ref $struct.0) (ref $struct.1) (mut i32) (mut (ref null $struct.2)) (mut i32) (mut i8)) $struct.3) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.AbstractStringBuilder.vtable, on (struct_subtype (field (ref $func.0) (ref $func.1) (ref $func.2) (ref $func.3) (ref $func.4) (ref $func.5) (ref $func.6) (ref $func.7) (ref $func.8) (ref $func.9) (ref $func.10) (ref $func.11) (ref $func.12) (ref $func.13) (ref $func.14) (ref $func.15) (ref $func.16) (ref $func.17) (ref $func.18) (ref $func.19) (ref $func.20) (ref $func.21) (ref $func.22) (ref $func.23) (ref $func.24) (ref $func.25) (ref $func.26) (ref $func.27) (ref $func.28) (ref $func.29) (ref $func.30) (ref $func.31) (ref $func.32) (ref $func.33) (ref $func.34) (ref $func.35)) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.AbstractStringBuilder.itable, on (struct_subtype (field dataref dataref dataref dataref dataref dataref dataref) $struct.0) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getValue__arrayOf_char_$pp_java_lang, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_shareValue__arrayOf_char_$pp_java_lang, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_appendNull__void_$pp_java_lang, on (func (param (ref $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append0__arrayOf_char__void_$pp_java_lang, on (func (param (ref $struct.0) (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append0__arrayOf_char__int__int__void_$pp_java_lang, on (func (param (ref $struct.0) (ref null $struct.1) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append0__char__void_$pp_java_lang, on (func (param (ref $struct.0) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append0__java_lang_String__void_$pp_java_lang, on (func (param (ref $struct.0) (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append0__java_lang_CharSequence__int__int__void_$pp_java_lang, on (func (param (ref $struct.0) (ref null $struct.0) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_capacity__int, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_delete0__int__int__void_$pp_java_lang, on (func (param (ref $struct.0) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_deleteCharAt0__int__void_$pp_java_lang, on (func (param (ref $struct.0) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_ensureCapacity__int__void, on (func (param (ref $struct.0) i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert0__int__arrayOf_char__void_$pp_java_lang, on (func (param (ref $struct.0) i32 (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert0__int__arrayOf_char__int__int__void_$pp_java_lang, on (func (param (ref $struct.0) i32 (ref null $struct.1) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert0__int__char__void_$pp_java_lang, on (func (param (ref $struct.0) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert0__int__java_lang_String__void_$pp_java_lang, on (func (param (ref $struct.0) i32 (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert0__int__java_lang_CharSequence__int__int__void_$pp_java_lang, on (func (param (ref $struct.0) i32 (ref null $struct.0) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_replace0__int__int__java_lang_String__void_$pp_java_lang, on (func (param (ref $struct.0) i32 i32 (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_reverse0__void_$pp_java_lang, on (func (param (ref $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_setCharAt__int__char__void, on (func (param (ref $struct.0) i32 i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_trimToSize__void, on (func (param (ref $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.Appendable.vtable, on (struct (field (ref $func.0) (ref $func.1) (ref $func.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__char__java_lang_Appendable, on (func (param (ref $struct.0) i32) (result (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_CharSequence__java_lang_Appendable, on (func (param (ref $struct.0) (ref null $struct.0)) (result (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_CharSequence__int__int__java_lang_Appendable, on (func (param (ref $struct.0) (ref null $struct.0) i32 i32) (result (ref null $struct.0))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__boolean__java_lang_StringBuffer, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__char__java_lang_StringBuffer, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__double__java_lang_StringBuffer, on (func (param (ref $struct.0) f64) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__float__java_lang_StringBuffer, on (func (param (ref $struct.0) f32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__long__java_lang_StringBuffer, on (func (param (ref $struct.0) i64) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_Object__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_String__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_StringBuffer__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__arrayOf_char__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__arrayOf_char__int__int__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.1) i32 i32) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_CharSequence__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_append__java_lang_CharSequence__int__int__java_lang_StringBuffer, on (func (param (ref $struct.0) (ref null $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_appendCodePoint__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_delete__int__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_deleteCharAt__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__char__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__boolean__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__long__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 i64) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__double__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 f64) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__float__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 f32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__java_lang_Object__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 (ref null $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__java_lang_String__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__arrayOf_char__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__arrayOf_char__int__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 (ref null $struct.1) i32 i32) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__java_lang_CharSequence__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 (ref null $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_insert__int__java_lang_CharSequence__int__int__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 (ref null $struct.0) i32 i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_replace__int__int__java_lang_String__java_lang_StringBuffer, on (func (param (ref $struct.0) i32 i32 (ref null $struct.1)) (result (ref null $struct.2))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_reverse__java_lang_StringBuffer, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $java.lang.reflect.Type.vtable, on (struct) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getName__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getCanonicalName__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getSimpleName__java_lang_String, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getComponentType__java_lang_Class, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getArrayType__int__java_lang_Class_$pp_java_lang, on (func (param (ref $struct.0) i32) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_isArray__boolean, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_isEnum__boolean, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_isInterface__boolean, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_isPrimitive__boolean, on (func (param (ref $struct.0)) (result i32)) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getEnumConstants__arrayOf_java_lang_Object, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_getSuperclass__java_lang_Class, on (func (param (ref $struct.0)) (result (ref null $struct.1))) [wasm-validator error in module] publicly exposed type disallowed with a closed world: $function.m_desiredAssertionStatus__boolean, on (func (param (ref $struct.0)) (result i32)) Fatal: error validating input
To Reproduce
No snippet needed, just building the WASM sample
Bazel version
Please include version of Bazel that you are running J2CL with:
$ bazel version
Bazelisk version: v1.11.0
Build label: 5.2.0
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 7 16:11:09 2022 (1654618269)
Build timestamp: 1654618269
Build timestamp as int: 1654618269
Expected behavior
I expected it to build
after switching to the PR tagged in this issue, and removing only the --closed-world
flag, the WASM sample built for me. adding the flag back fails the build again. maybe i need some additional flag to cover these publics? thank you J2CL team for considering this issue.
another bug building the WASM sample, but this time building the JS app:
external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:85: ERROR - could not determine the type of this expression
'ConsoleLogger.log': (level, message) => console[level](message),
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to the `suppress` attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.
Expand to see full error
ERROR: /Users/sam/Workspace/elide/runtime/elide/runtime/wasm/BUILD.bazel:82:17: Compiling 3 JavaScript files to elide/runtime/wasm/jsapp.js failed: (Exit 1): ClosureWorker failed: error executing command bazel-out/host/bin/external/io_bazel_rules_closure/java/io/bazel/rules/closure/ClosureWorker @@bazel-out/darwin_arm64-fastbuild/bin/elide/runtime/wasm/jsapp.js-0.params external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:85: ERROR - could not determine the type of this expression 'ConsoleLogger.log': (level, message) => console[level](message), ^ ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to the `suppress` attribute of: @com_google_j2cl//jre/java:j2wasm_js Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:85: ERROR - could not determine the type of this expression
'ConsoleLogger.log': (level, message) => consolelevel,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:85: ERROR - could not determine the type of this expression
'ConsoleLogger.log': (level, message) => consolelevel,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:118: ERROR - could not determine the type of this expression
'createBuffer': size => new Array(size),
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:119: ERROR - could not determine the type of this expression
'setBufferAt': (buffer, index, value) => buffer[index] = value,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:119: ERROR - could not determine the type of this expression
'setBufferAt': (buffer, index, value) => buffer[index] = value,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:119: ERROR - could not determine the type of this expression
'setBufferAt': (buffer, index, value) => buffer[index] = value,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:120: ERROR - could not determine the type of this expression
'getBufferAt': (buffer, index) => buffer[index],
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:120: ERROR - could not determine the type of this expression
'getBufferAt': (buffer, index) => buffer[index],
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:121: ERROR - could not determine the type of this expression
'getLength': s => s.length,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.external/com_google_j2cl/jre/java/super-wasm/j2wasm.js:121: ERROR - could not determine the type of this expression
'getLength': s => s.length,
^
ProTip: "JSC_UNKNOWN_EXPR_TYPE" or "missingSourcesWarnings" or "reportUnknownTypes" can be added to thesuppress
attribute of:
@com_google_j2cl//jre/java:j2wasm_js
Alternatively /** @suppress {reportUnknownTypes} */ can be added to the source file.11 error(s), 0 warning(s), 96.0% typed
INFO: Elapsed time: 49.506s, Critical Path: 29.58s
INFO: 401 processes: 47 internal, 245 darwin-sandbox, 53 local, 56 worker.
FAILED: Build did NOT complete successfully
console
is defined in the externs for the closure compiler. It might be a configuration or version issue, not sure. But our wasm backend is in flux and sometimes it needs very specific versions of Chrome and binaryen.
It is a bit rough on the edges and we haven't focused yet on making the opensource version seamless.
oh, i should have noticed this was console related @rluble, i am building with --env=CUSTOM
for a pure-JS environment. passing a blanket suppression got me working for now. it would help if the j2wasm_*
rules allowed kwargs
which they pass to the underlying closure calls; i've made such a change on my branch and can offer it as a PR if the team is interested.
thank you for getting back to me
also, maybe it would be helpful if i wrote some rules that install the right Binaryen bins? any interest there too, if i set that up? thanks again
(i should also say, make sure to expand the error in the bug, the JS one above may be console related, but I'm not sure the main one is)
It looks like you hit some in between versions, pls for now use an earlier version of binaryen. (I will keep this issue open though to ensure the problem will be fixed in open source as well).
j2wasm_application rule, the way imports work etc. will through some overhaul. We can discuss again in couple of months and looks for potential improvements there.
also, maybe it would be helpful if i wrote some rules that install the right Binaryen bins
Yes, that would be cool (though it may require some active maintenance if you would like to bite bullet)
@gkdn if memory serves i had to use a latest version of binaryen to support --closed-world
, but adding the ability to pass parameters and dropping the invalid ones lets me use the latest release. we're thinking of using J2CL and J2WASM again for a new project and if we do, we'd be happy to write some quick binaryen rules.
I think all the closed-world
issues are fixed. Closing this for now, let me know if not.