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

[wasi] Select mono components #100407

Merged
merged 11 commits into from
Apr 18, 2024
8 changes: 0 additions & 8 deletions src/mono/wasi/build/WasiApp.InTree.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,4 @@
<TrimMode>partial</TrimMode>
<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>
<!-- This is temporary hack for https://github.com/dotnet/runtime/issues/61294 -->
<ItemGroup>
<_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" />
<!-- FIXME: This will exclude the diagnostics component if tracing is not on and threads are not on. Which means that if you turn on threading, you will get diagnostics. Is this what we want? -->
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(FeatureWasmPerfTracing)' != 'true' and $(FeatureWasmManagedThreads) != 'true'"/>
<_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-stub-static.a" />
<_MonoRuntimeComponentDontLink Include="libmono-component-marshal-ilgen-stub-static.a" />
</ItemGroup>
</Project>
21 changes: 17 additions & 4 deletions src/mono/wasi/build/WasiApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
_WasmGenerateNodeScripts;
</WasmGenerateAppBundleDependsOn>

<WasiWriteRspForLinkingDependsOn>
lewing marked this conversation as resolved.
Show resolved Hide resolved
$(WasiWriteRspForLinkingDependsOn);
_WasmSelectRuntimeComponentsForLinking;
_WasiGetWasiOutputFileName;
</WasiWriteRspForLinkingDependsOn>
<WasiWriteRspForLinkingDependsOn Condition="'$(UsingWasiRuntimeWorkload)' == 'true'">
$(WasiWriteRspForLinkingDependsOn);
_MonoSelectRuntimeComponents;
</WasiWriteRspForLinkingDependsOn>

<SelfContained Condition="'$(IsWasiProject)' == 'true'">true</SelfContained>

<!-- Temporarily `false`, till sdk gets a fix for supporting the new file -->
Expand Down Expand Up @@ -261,7 +271,7 @@
</Target>

<Target Name="_WasiWriteRspForLinking"
DependsOnTargets="_WasmSelectRuntimeComponentsForLinking;_WasiGetWasiOutputFileName"
DependsOnTargets="$(WasiWriteRspForLinkingDependsOn)"
BeforeTargets="_WasmWriteRspForLinking"
Returns="@(_WasmLinkStepArgs)">

Expand Down Expand Up @@ -296,12 +306,15 @@
<_WasmSIMDLibToExclude Condition="'$(WasmEnableSIMD)' == 'true'">libmono-wasm-nosimd.a</_WasmSIMDLibToExclude>
</PropertyGroup>

<ItemGroup>
<_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(UsingWasiRuntimeWorkload)' != 'true'" /> <!-- Just for in-tree build + CI -->
</ItemGroup>

<ItemGroup>
<!-- order matters -->
<_WasmNativeFileForLinking Include="%(_BitcodeFile.ObjectFile)" />
<!--<_WasmNativeFileForLinking Include="%(_WasmSourceFileToCompile.ObjectFile)" />-->
<_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" />
<_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>

<_WasmNativeFileForLinking
Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)*.a"
Expand Down Expand Up @@ -440,4 +453,4 @@ wasi.start(instance);
</Target>

<!--<Target Name="_WasmCalculateInitialHeapSize" />-->
</Project>
</Project>
15 changes: 11 additions & 4 deletions src/mono/wasm/build/WasmApp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,16 @@
<ItemGroup>
<UpToDateCheckInput Include="@(NativeFileReference)" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Debug' and '@(_MonoComponent->Count())' == 0">
<_MonoComponent Include="hot_reload;debugger" />

<PropertyGroup>
<_WasmDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' != '0'">true</_WasmDebuggerSupport>
<_WasmDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' == '0'">false</_WasmDebuggerSupport>
<_WasmDebuggerSupport Condition="'$(_WasmDebuggerSupport)' == '' and '$(WasmBuildingForNestedPublish)' == 'true'">false</_WasmDebuggerSupport> <!-- publish -->
<_WasmDebuggerSupport Condition="'$(_WasmDebuggerSupport)' == ''">true</_WasmDebuggerSupport>
</PropertyGroup>
<ItemGroup Condition="'$(_WasmDebuggerSupport)' == 'true'">
<_MonoComponent Include="debugger" />
<_MonoComponent Include="hot_reload" />
</ItemGroup>
<!-- PUBLISH -->

Expand Down Expand Up @@ -590,7 +597,7 @@
</Target>

<Target Name="_ScanAssembliesDecideLightweightMarshaler">
<ItemGroup>
<ItemGroup>
<_AssembliesToScan Include="@(_WasmAssembliesInternal)" />
</ItemGroup>

Expand Down
Loading