* [wasm] Enable dedup by default.
* [wasm] Enable symbol map for AOT tests too
* MonoAOTCompiler: Fix up the path for the output items if they had been
.. copied to `aot-in` for the compilation step.
Example:
- when using WasmDedup=true, we get the main assemblies in `publish`
directory after linking, but `aot-instances.dll` is in different directory.
- this causes `MonoAOTCompiler` to copy all of them to a temporary `aot-in` dir for compiling with `mono-aot-cross`.
- And when the output items are set, we get:
```
Output Item(s):
_WasmAssembliesInternal=
obj/Debug/net8.0/browser-wasm/wasm/for-publish/aot-in/Debug_u4nbxx3i.gc5.dll
LlvmBitcodeFile=obj/Debug/net8.0/browser-wasm/wasm/for-publish/Debug_u4nbxx3i.gc5.dll.bc
```
- here the `ItemSpec` is incorrectly set to the temporary `aot-in` path
- which can cause build failures in the following build steps
* WBT: remove redundant case
Co-authored-by: Ankit Jain <radical@gmail.com>
- for AOT library tests, we use WasmNativeStrip=false, so we already have symbols
-->
<WasmNativeStrip Condition="'$(WasmNativeStrip)' == ''">false</WasmNativeStrip>
- <WasmEmitSymbolMap Condition="'$(WasmEmitSymbolMap)' == '' and '$(RunAOTCompilation)' != 'true'">true</WasmEmitSymbolMap>
+ <WasmEmitSymbolMap Condition="'$(WasmEmitSymbolMap)' == ''">true</WasmEmitSymbolMap>
<!-- Run only if previous command succeeded -->
<_ShellCommandSeparator Condition="'$(OS)' == 'Windows_NT'">&&</_ShellCommandSeparator>
{
var data = new TheoryData<string, bool, bool>();
data.Add("Debug", false, false);
- data.Add("Debug", false, false);
data.Add("Debug", false, true);
data.Add("Release", false, false); // Release relinks by default
-->
<PropertyGroup>
- <WasmDedup Condition="'$(WasmDedup)' == ''">false</WasmDedup>
+ <WasmDedup Condition="'$(WasmDedup)' == ''">true</WasmDedup>
<WasmEnableExceptionHandling Condition="'$(WasmEnableExceptionHandling)' == ''">false</WasmEnableExceptionHandling>
<WasmEnableSIMD Condition="'$(WasmEnableSIMD)' == ''">false</WasmEnableSIMD>
ITaskItem newAsm = new TaskItem(newPath);
asmItem.CopyMetadataTo(newAsm);
- asmItem.SetMetadata(s_originalFullPathMetadataName, asmPath);
+ newAsm.SetMetadata(s_originalFullPathMetadataName, asmPath);
newAssemblies.Add(newAsm);
}
List<ITaskItem> outItems = new(originalAssemblies.Count);
foreach (ITaskItem item in originalAssemblies)
{
- if (dict.TryGetValue(item.GetMetadata("FullPath"), out ITaskItem? dictItem))
- outItems.Add(dictItem);
+ if (!dict.TryGetValue(item.GetMetadata("FullPath"), out ITaskItem? dictItem))
+ continue;
+
+ string originalFullPath = item.GetMetadata(s_originalFullPathMetadataName);
+ if (!string.IsNullOrEmpty(originalFullPath))
+ dictItem.ItemSpec = originalFullPath;
+
+ outItems.Add(dictItem);
}
return outItems;
}