Uno.Wasm.Bootstrap
Uno.Wasm.Bootstrap copied to clipboard
Cannot build AOT with existing instructions
Using the directions here you cannot build wasm AOT. Verified by creating test project that builds successfully using the above directions, and fails to build after updating to latest Uno.Wasm.Bootstrap.
To reproduce: using the directions, built the attached project. Update the attached project to the latest Uno packages, clean, and attempt to build again - it fails with the error ' The EMSDK version is not compatible with the current mono SDK. Install 1.38.43'
If you install EMSDK 1.38.43 with:
./emsdk install sdk-1.38.43-64bit ./emsdk activate sdk-1.38.43-64bit
Then you still receive the same error.
The file "upstream/emscripten/emscripten-version.txt" does not seem to exist in the later EMSDK versions. Even if you fix that the compilation fails at the packager stage (ninja exits with error code), I did not attempt to debug the issue further.
These validations have been added in v1.1.x-dev packages to enable the support for the latest mono and emscripten upstream builds, but AOT is still unstable, which is why I unlisted the package from nuget. Please do not update to those builds unless you intend to debug and submit a PR to mono to fix the issues :)
The version 1.0.0-dev.302 is the last known good version, and I'll be promoting it soon to 1.0.0 stable.
For instructions on how to build it, please follow this blog post.
Now, specifically about upstream/emscripten/emscripten-version.txt
, the file exists but the emscripten upstream builds have to be installed in order for the validation to work. upstream is needed as the LLVM backend is enabled in that build.
What are the current instructions at this point? I am still trying to get AOT working but I cant for the life of me find a working set. I get either mono SDK is not compatible, or I get this with the latest dev branches:
FAILED: netstandard.dll.o (TaskId:607) bash -c 'source ./emsdk_env.sh && emcc -Oz -g -s USE_ZLIB=1 -s DISABLE_EXCEPTION_CATCHING=0 -s WASM_OBJECT_FILES=0 -s ASSERTIONS=1 -s WASM=1 -s USE_ZLIB=0 -s ALLOW_MEMORY_GROWTH=1 -s BINARYEN=1 -s TOTAL_MEMORY=134217728 -s ALIASING_FUNCTION_POINTERS=0 -s NO_EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall', 'cwrap', 'setValue', 'getValue', 'UTF8ToString']" -s "EXPORTED_FUNCTIONS=['___cxa_is_pointer_type', '___cxa_can_catch']" -s "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=['setThrew', 'memset']" -c -o netstandard.dll.o netstandard.dll.bc' (TaskId:607) Traceback (most recent call last): (TaskId:607) File "/home/user/emsdk/upstream/emscripten/emcc.py", line 3681, in <module> (TaskId:607) sys.exit(run(sys.argv)) (TaskId:607) File "/home/user/emsdk/upstream/emscripten/emcc.py", line 1010, in run (TaskId:607) assert has_source_inputs or has_header_inputs, 'Must have source code or header inputs to use -c or -S' (TaskId:607) AssertionError: Must have source code or header inputs to use -c or -S (TaskId:607)
I would love to be able to get this to AOT so we can test our app. Its just too slow otherwise to even log in. Thanks a ton!
edit: I should note going down to: <PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.302" /> <DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.302" />
tells me I am blocked by the package config.
Looking at the logs, it seems like you're using the 1.1 dev bits of the bootstrapper, which are not yet ready for prime time (should be soon though #128).
Make sure to use the 1.0.0 bits, for which the instructions are appropriate, aside from the emscripten version which should be 1.38.31 (https://github.com/unoplatform/Uno.Wasm.Bootstrap/blob/release/1.0/.vsts-ci.yml#L82 from release 1.0 branch)
GitHub
A simple nuget package to run C# code in a WASM-compatible browser - unoplatform/Uno.Wasm.Bootstrap
@jeromelaban Awesome! Thanks much, Ill switch everything to the correct versions and do some testing.
@jeromelaban ok, I ran aot with all the assemblies removed that gave errors for now. I get a new error that it fails on:
cache:INFO: generating system asset: generated_struct_info.json... (this will be cached in "/home/user/.emscripten_cache/asmjs/generated_struct_info.json" for subsequent builds) (TaskId:589) cache:INFO: - ok (TaskId:589) error: undefined symbol: aot_wrapper_alloc_0_Alloc_obj_ii (TaskId:589) warning: To disable errors for undefined symbols use
-s ERROR_ON_UNDEFINED_SYMBOLS=0 (TaskId:589) error: undefined symbol: aot_wrapper_alloc_1_AllocVector_obj_iiii (TaskId:589) error: undefined symbol: aot_wrapper_alloc_2_AllocSmall_obj_iiii (TaskId:589) error: undefined symbol: aot_wrapper_icall___emul_fconv_to_u4 (TaskId:589) error: undefined symbol: aot_wrapper_icall___emul_frem (TaskId:589) error: undefined symbol: aot_wrapper_icall_mini_llvmonly_init_vtable_slot (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_array_to_lparray (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_delegate_begin_invoke (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_delegate_end_invoke (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_fill_class_rgctx (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_fill_method_rgctx (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_generic_class_init (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_gsharedvt_constrained_call (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_helper_ldstr (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_helper_ldstr_mscorlib (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_helper_newobj_mscorlib (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_monitor_enter_internal (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_monitor_enter_v4_internal (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_object_castclass_unbox (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_string_new_wrapper_internal (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_string_to_utf8str (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_thread_get_undeniable_exception (TaskId:589) error: undefined symbol: aot_wrapper_icall_mono_thread_interruption_checkpoint (TaskId:589) error: undefined symbol: aot_wrapper_icall_monoeg_g_free (TaskId:589) error: undefined symbol: aot_wrapper_icall_ves_icall_object_new_specific (TaskId:589) error: undefined symbol: aot_wrapper_icall_ves_icall_string_new_wrapper (TaskId:589) error: undefined symbol: aot_wrapper_icall_ves_icall_thread_finish_async_abort (TaskId:589) Error: Aborting compilation due to previous errors (TaskId:589)
Is this a known issue with the current setup? And if we put in "-s ERROR_ON_UNDEFINED_SYMBOLS=0", will that cause issues? If so where should we put it in to test?
Also, I dont want to hijack this thread, is there a better place to discus this or should I make a new issue?
Thanks again!
EDIT: I think I found the chat area to ask this question, disregard if so.