Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser] testing #112909

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,12 @@ initDistroRid "$os" "$arch" "$crossBuild"
# The later changes are ignored when using the cache.
export DOTNETSDK_ALLOW_TARGETING_PACK_CACHING=0

if [[ "$arch" == "wasm" ]]; then
# LLVM + MSBuild can consume a lot of memory, so we set the GC limits to be more aggressive.
export DOTNET_GCHighMemPercent="10"
export DOTNET_GCHeapHardLimitPercent="20"
fi

# URL-encode space (%20) to avoid quoting issues until the msbuild call in /eng/common/tools.sh.
# In *proj files (XML docs), URL-encoded string are rendered in their decoded form.
cmakeargs="${cmakeargs// /%20}"
Expand Down
2 changes: 2 additions & 0 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<!-- We need to set this in order to get extensibility on xunit category traits and other arguments we pass down to xunit via MSBuild properties -->
<PropertyGroup>
<IsBrowserWasmProject Condition="'$(IsBrowserWasmProject)' == ''">true</IsBrowserWasmProject>
<WasmProfilers>browser</WasmProfilers>
<WasmBuildNative>true</WasmBuildNative>

<!-- set this when provisioning emsdk on CI -->
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(BrowserProjectRoot), 'emsdk'))</EMSDK_PATH>
Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@
{ "identity": "WasmSingleFileBundle", "defaultValueInRuntimePack": "$(WasmSingleFileBundle)" },
{ "identity": "WasmEnableSIMD", "defaultValueInRuntimePack": "$(WasmEnableSIMD)" },
{ "identity": "WasmEnableExceptionHandling", "defaultValueInRuntimePack": "$(WasmEnableExceptionHandling)" },
{ "identity": "WasmProfilers", "defaultValueInRuntimePack": "$(WasmProfilers)" },
{ "identity": "EmccMaximumHeapSize", "defaultValueInRuntimePack": "$(EmccMaximumHeapSize)" }
]
}
Expand Down
13 changes: 6 additions & 7 deletions src/mono/browser/runtime/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,17 +534,16 @@ EMSCRIPTEN_KEEPALIVE const char * mono_wasm_method_get_name (MonoMethod *method)
return res;
}

EMSCRIPTEN_KEEPALIVE const char * mono_wasm_method_get_name_ex (MonoMethod *method) {
const char *res;
EMSCRIPTEN_KEEPALIVE char * mono_wasm_method_get_name_ex (MonoMethod *method) {
char *res;
MONO_ENTER_GC_UNSAFE;
res = mono_method_get_name (method);
const char *method_name = mono_method_get_name (method);
// starts with .ctor or .cctor
if (mono_method_get_flags (method, NULL) & 0x0800 /* METHOD_ATTRIBUTE_SPECIAL_NAME */ && strlen (res) < 7) {
char *res_ex = (char *) malloc (128);
snprintf (res_ex, 128,"%s.%s", mono_class_get_name (mono_method_get_class (method)), res);
res = res_ex;
res = (char *) malloc (128);
snprintf (res, 128,"%s.%s", mono_class_get_name (mono_method_get_class (method)), method_name);
} else {
res = strdup (res);
res = strdup (method_name);
}
MONO_EXIT_GC_UNSAFE;
return res;
Expand Down
Loading