Skip to content
Merged
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
8 changes: 0 additions & 8 deletions eng/native.wasm.targets
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,9 @@
<EmccExportedRuntimeMethod Include="UTF8ArrayToString" />
<EmccExportedRuntimeMethod Include="lengthBytesUTF8" />
<EmccExportedRuntimeMethod Include="stringToUTF8Array" />
<EmccExportedRuntimeMethod Include="FS_createPath" />
<EmccExportedRuntimeMethod Include="FS_createDataFile" />
<EmccExportedRuntimeMethod Include="removeRunDependency" />
<EmccExportedRuntimeMethod Include="addRunDependency" />
<EmccExportedRuntimeMethod Include="addFunction" />
<EmccExportedRuntimeMethod Include="safeSetTimeout" />
<EmccExportedRuntimeMethod Include="runtimeKeepalivePush" />
<EmccExportedRuntimeMethod Include="runtimeKeepalivePop" />
<EmccExportedRuntimeMethod Include="maybeExit" />
<EmccExportedRuntimeMethod Include="abort" />

<EmccExportedFunction Include="_free" />
Expand All @@ -60,8 +54,6 @@
<EmccExportedFunction Include="stackAlloc" />
<EmccExportedFunction Include="stackRestore" />
<EmccExportedFunction Include="stackSave" />
<!-- TODO-WASM hide -->
<EmccExportedFunction Include="_GetDotNetRuntimeContractDescriptor" />
</ItemGroup>
<PropertyGroup>
<_EmccExportedRuntimeMethods>@(EmccExportedRuntimeMethod -> '%(Identity)',',')</_EmccExportedRuntimeMethods>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Debug
buildConfig: Release
runtimeFlavor: CoreCLR
platforms:
- ${{ platform }}
Expand All @@ -42,9 +42,9 @@ jobs:
jobParameters:
dependsOn:
- ${{ if eq(platform, 'browser_wasm') }}:
- build_browser_wasm_linux_Debug_AllSubsets_CoreCLR
- build_browser_wasm_linux_Release_AllSubsets_CoreCLR
- ${{ if eq(platform, 'browser_wasm_win') }}:
- build_browser_wasm_windows_Debug_AllSubsets_CoreCLR
- build_browser_wasm_windows_Release_AllSubsets_CoreCLR
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
testGroup: innerloop
nameSuffix: CoreCLR_WasmBuildTests
Expand All @@ -55,14 +55,14 @@ jobs:
displayName: Download built nugets for singlethreaded runtime
inputs:
buildType: current
artifactName: 'BuildArtifacts_browser_wasm_$(_hostedOs)_Debug_AllSubsets_CoreCLR'
artifactName: 'BuildArtifacts_browser_wasm_$(_hostedOs)_Release_AllSubsets_CoreCLR'
downloadType: single
downloadPath: '$(Build.SourcesDirectory)/artifacts'

- task: CopyFiles@2
displayName: Copy single threaded assets
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Debug_AllSubsets_CoreCLR'
SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Release_AllSubsets_CoreCLR'
TargetFolder: '$(Build.SourcesDirectory)/artifacts'
CleanTargetFolder: false

Expand Down
101 changes: 101 additions & 0 deletions eng/pipelines/common/templates/wasm-coreclr-library-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
parameters:
alwaysRun: false
extraBuildArgs: ''
extraHelixArguments: ''
isExtraPlatformsBuild: false
isWasmOnlyBuild: false
nameSuffix: ''
platforms: []
scenarios: ['WasmTestOnChrome']
shouldContinueOnError: false
shouldRunSmokeOnly: false

jobs:

#
# Build for Browser/wasm and test it
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: coreclr
platforms: ${{ parameters.platforms }}
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
variables:
# map dependencies variables to local variables
- name: alwaysRunVar
value: ${{ parameters.alwaysRun }}
# - wasm darc deps changed
# - any libs that can have wasm specific changes
# - any other wasm specific changes that are not wbt, or dbg
- name: shouldRunOnDefaultPipelines
value: $[
or(
eq(variables['wasmDarcDependenciesChanged'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_chrome.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_specific_except_wbt_dbg.containsChange'], true))
]
# run smoke tests only if:
# - explicitly requested
# - libraries or illink changed and no wasm specific changes
- name: shouldRunSmokeOnlyVar
value: $[
or(
eq('${{ parameters.shouldRunSmokeOnly }}', 'true'),
and(
eq('${{ parameters.shouldRunSmokeOnly }}', 'onLibrariesAndIllinkChanges'),
ne(variables['wasmDarcDependenciesChanged'], true),
or(
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true),
eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true)
),
ne(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_chrome.containsChange'], true),
ne(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_specific_except_wbt_dbg.containsChange'], true)
)
)
]
- name: _wasmRunSmokeTestsOnlyArg
value: /p:RunSmokeTestsOnly=$(shouldRunSmokeOnlyVar)
- name: chromeInstallArg
${{ if containsValue(parameters.scenarios, 'WasmTestOnChrome') }}:
value: /p:InstallChromeForTests=true
${{ else }}:
value: ''
- name: firefoxInstallArg
${{ if containsValue(parameters.scenarios, 'WasmTestOnFirefox') }}:
value: /p:InstallFirefoxForTests=true
${{ else }}:
value: ''
- name: v8InstallArg
${{ if containsValue(parameters.scenarios, 'WasmTestOnV8') }}:
value: /p:InstallV8ForTests=true
${{ else }}:
value: ''

jobParameters:
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
testGroup: innerloop
nameSuffix: LibraryTestsCoreCLR${{ parameters.nameSuffix }}
buildArgs: -s clr+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) $(chromeInstallArg) $(firefoxInstallArg) $(v8InstallArg) /maxcpucount:1 ${{ parameters.extraBuildArgs }}
timeoutInMinutes: 240
# if !alwaysRun, then:
# if this is runtime-wasm (isWasmOnlyBuild):
# - then run only if it would not have run on default pipelines (based
# on path changes)
# - else run based on path changes
condition: >-
or(
eq(variables['alwaysRunVar'], true),
eq(variables['isDefaultPipeline'], variables['shouldRunOnDefaultPipelines']))
# extra steps, run tests
postBuildSteps:
- template: /eng/pipelines/libraries/helix.yml
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: CoreCLR_$(_BuildConfig)
extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArguments }}
scenarios: ${{ parameters.scenarios }}
14 changes: 13 additions & 1 deletion eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ extends:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: Debug
buildConfig: Release
platforms:
- browser_wasm
- browser_wasm_win
Expand Down Expand Up @@ -862,6 +862,18 @@ extends:
scenarios:
- WasmTestOnChrome

# WebAssembly CoreCLR
- template: /eng/pipelines/common/templates/wasm-coreclr-library-tests.yml
parameters:
platforms:
- browser_wasm
alwaysRun: ${{ variables.isRollingBuild }}
shouldRunSmokeOnly: true
# TODO consider shouldContinueOnError: true
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
scenarios:
- WasmTestOnChrome

# EAT Library tests - only run on linux
- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
parameters:
Expand Down
13 changes: 12 additions & 1 deletion eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<DisableBuildCompression>true</DisableBuildCompression>
<PublishTrimmed>false</PublishTrimmed>
<PublishTrimmed Condition="'$(RunAOTCompilation)' == 'true' or '$(TestTrimming)' == 'true'">true</PublishTrimmed>
<WasmTestSupport Condition="'$(RuntimeFlavor)' == 'CoreCLR'">true</WasmTestSupport>
<_WasmInTreeDefaults>false</_WasmInTreeDefaults>

<ResolveWasmOutputsDependsOn>
Expand Down Expand Up @@ -53,6 +52,18 @@
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">true</EventSourceSupport>
<NullabilityInfoContextSupport Condition="'$(NullabilityInfoContextSupport)' == ''">true</NullabilityInfoContextSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'CoreCLR'">
<WasmTestSupport>true</WasmTestSupport>
<WasmTestExitOnUnhandledError>true</WasmTestExitOnUnhandledError>
<WasmTestAppendElementOnExit>true</WasmTestAppendElementOnExit>
<WasmTestLogExitCode>true</WasmTestLogExitCode>
</PropertyGroup>

<!-- TODO-WASM https://github.com/dotnet/runtime/issues/120248 (CoreCLR on wasm defaults) -->
<PropertyGroup Condition="'$(RuntimeFlavor)' == 'CoreCLR'">
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<WasmEnableWebcil>false</WasmEnableWebcil>
</PropertyGroup>

<ItemGroup>
<Content Include="$(MonoProjectRoot)browser\test-main.js" Link="wwwroot\test-main.js" CopyToOutputDirectory="PreserveNewest" Condition="'$(IsFunctionalTest)' != 'true'" />
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/interpreter/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4094,6 +4094,8 @@ void InterpCompiler::EmitCanAccessCallout(CORINFO_RESOLVED_TOKEN *pResolvedToken

void InterpCompiler::EmitCallsiteCallout(CorInfoIsAccessAllowedResult accessAllowed, CORINFO_HELPER_DESC* calloutDesc)
{
// WASM-TODO: https://github.com/dotnet/runtime/issues/121955
#ifndef TARGET_WASM
if (accessAllowed == CORINFO_ACCESS_ILLEGAL)
{
int32_t svars[CORINFO_ACCESS_ALLOWED_MAX_ARGS];
Expand Down Expand Up @@ -4164,6 +4166,7 @@ void InterpCompiler::EmitCallsiteCallout(CorInfoIsAccessAllowedResult accessAllo
}
m_pLastNewIns->data[0] = GetDataForHelperFtn(calloutDesc->helperNum);
}
#endif // !TARGET_WASM
}

static OpcodePeepElement peepRuntimeAsyncCall[] = {
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/vm/corelib.h
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,9 @@ DEFINE_CLASS(THREAD, Threading, Thread)
DEFINE_METHOD(THREAD, START_CALLBACK, StartCallback, IM_RetVoid)
DEFINE_METHOD(THREAD, POLLGC, PollGC, NoSig)
DEFINE_METHOD(THREAD, ON_THREAD_EXITING, OnThreadExiting, IM_RetVoid)
#ifdef FOR_ILLINK
DEFINE_METHOD(THREAD, CTOR, .ctor, IM_RetVoid)
#endif // FOR_ILLINK

#ifdef FEATURE_OBJCMARSHAL
DEFINE_CLASS(AUTORELEASEPOOL, Threading, AutoreleasePool)
Expand Down
Loading
Loading