Skip to content

Commit 2ffdb87

Browse files
radekdoulikCopilot
andcommitted
Address review feedback on the wasm corerun kit
Fix a stale breadcrumb in testkit.cmake that pointed at a file name the kit never shipped under, and stop compiling the profiler test library on wasm. The profiler tree is already CLRTestTargetUnsupported for browser, but its native directory is picked up by the recursive globber in src/tests, so it built 30+ sources that nothing can ever link. Guard it the same way the sibling ijw directory guards itself, which drops the browser native test build from 118 static archives to 117. Also note why the '%24' and '%25' escapes in CLRTest.WasmCorerun.targets are deliberate: '%24' keeps a property name literal in an error message instead of expanding it, and '%25' is an escaped '%', so the response-file guard already rejects any percent escape. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 19490400-17c9-47ef-9240-064c65690470
1 parent 78bcb23 commit 2ffdb87

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎src/coreclr/hosts/corerun/wasm/testkit.cmake‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# own native library cannot run against the prebuilt corerun.js -- the test's
88
# native code, and the call tables generated for it, have to be linked into the
99
# host itself. The runtime test build therefore re-links a test-specific corerun
10-
# outside of CMake (see src/tests/Common/CLRTest.NativeRelink.targets).
10+
# outside of CMake (see src/tests/Common/CLRTest.WasmCorerun.targets).
1111
#
1212
# This module exports everything that re-link needs:
1313
# * libcorerun_static.a -- corerun's own objects, so the host does not have to

‎src/tests/Common/CLRTest.WasmCorerun.targets‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ against CORE_ROOT, and no SDK is involved. Only the generator task assembly is s
130130
<Error Condition="'$(_WasmCorerunSkip)' != 'true' and !Exists('$(WasmCorerunKitDir)corerun-link.rsp')"
131131
Text="The corerun link kit is missing from '$(WasmCorerunKitDir)'. Build the 'clr.hosts' subset for browser-wasm first (the kit is produced by src/coreclr/hosts/corerun/wasm/testkit.cmake)." />
132132

133+
<!-- '%24' below is an escaped '$': these messages name the property literally and then show its
134+
value, so they read as e.g. "$(TasksConfiguration)='Checked'". Writing a bare '$' would
135+
expand the property and lose the name. -->
133136
<Error Condition="'$(_WasmCorerunSkip)' != 'true' and !Exists('$(WasmAppBuilderDir)WasmAppBuilder.dll')"
134137
Text="WasmAppBuilder.dll was not found at '$(WasmAppBuilderDir)'. It is built by the 'tasks' subset into %24(TasksConfiguration)='$(TasksConfiguration)'; build the repo in that configuration, or pass /p:TasksConfiguration=&lt;config&gt; to the test build." />
135138

@@ -195,7 +198,8 @@ against CORE_ROOT, and no SDK is involved. Only the generator task assembly is s
195198
</PropertyGroup>
196199

197200
<!-- The text round-trips through MSBuild properties and WriteLinesToFile, which would split on
198-
';' and reinterpret '%xx'. testkit.cmake never emits either; fail loudly if that changes. -->
201+
';' and reinterpret '%xx'. '%25' is an escaped '%', so the check below catches any percent
202+
escape. testkit.cmake never emits either; fail loudly if that changes. -->
199203
<Error Condition="$(_WasmCorerunCompileRspText.Contains(';')) or $(_WasmCorerunLinkRspText.Contains(';')) or
200204
$(_WasmCorerunCompileRspText.Contains('%25')) or $(_WasmCorerunLinkRspText.Contains('%25'))"
201205
Text="The corerun link kit response files must not contain ';' or '%25' - see src/coreclr/hosts/corerun/wasm/testkit.cmake." />

‎src/tests/profiler/native/CMakeLists.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Profiler tests launch a second corerun process and load the profiler as a shared library, and
2+
# WebAssembly has neither process creation nor dynamic loading, so none of them can run there
3+
# (the managed side is CLRTestTargetUnsupported in ../Directory.Build.props). This directory is
4+
# picked up unconditionally by the recursive add_subdirectory globber in src/tests/CMakeLists.txt,
5+
# so it must exclude itself rather than compile 30+ sources nothing will ever link.
6+
if (CLR_CMAKE_TARGET_ARCH_WASM)
7+
return()
8+
endif()
9+
110
project(Profiler)
211

312
set(SOURCES

0 commit comments

Comments
 (0)