Skip to content

Commit 9616b74

Browse files
author
ahall
committed
fix: suppress WASM0001 sqlite3_config/db_config varargs warnings on TodoApp.Uno browserwasm
The browserwasm head emits a WASM0001 warning for every fixed-arity P/Invoke overload SQLitePCLRaw.provider.e_sqlite3 ships to work around sqlite3_config/sqlite3_db_config being variadic (varargs) native functions. This sample's actual SQLite usage (in-memory EF Core CRUD via AppDbContext) never calls those functions directly, so the warning is diagnostic-only noise from the WebAssembly SDK's build-time native-interop check. WASM0001 is a standard MSBuild task warning code (emitted via TaskLoggingHelper.LogWarning in dotnet/runtime's WasmAppBuilder), so it honors NoWarn like any other build warning - the same suppression already documented for Blazor WASM in docs/in-depth/client/advanced/blazor-wasm.md. Suppress it, scoped to the browserwasm TFM only, following the existing GetTargetPlatformIdentifier-conditional pattern used for SuppressTrimAnalysisWarnings in the same file (see #521/#534). Also add a short note to the Uno Platform sample docs pointing at the Blazor WASM page for more detail on the warning and how to suppress it in a consumer's own project. Closes #543
1 parent ddd8c04 commit 9616b74

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

docs/samples/todoapp/unoplatform.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ If you bump into issues at this point, ensure you can properly develop and run U
1818
!!! info Tested platforms
1919
The TodoApp.Uno sample is known to work on Android and Desktop. We have not tested on other platforms.
2020

21+
!!! info WASM0001 warning on the browserwasm head
22+
When building the `browserwasm` head, you may see a `WASM0001` warning about native varargs
23+
functions (`sqlite3_config`/`sqlite3_db_config`) in the bundled SQLite provider. This is
24+
harmless diagnostic noise from the WebAssembly SDK's native-interop check - the sample's
25+
actual SQLite usage never calls those functions directly - and is already suppressed for
26+
this sample's `.csproj`. See the [Blazor WASM support](../../in-depth/client/advanced/blazor-wasm.md#suppress-the-wasm0001-warning)
27+
page for more detail on why this warning occurs and how to suppress it in your own project.
28+
2129
## Deploy a datasync server to Azure
2230

2331
Before you begin adjusting the application for offline usage, you must [deploy a datasync service](./server.md). Make a note of the URI of the service before continuing.

samples/todoapp/TodoApp.Uno/TodoApp.Uno/TodoApp.Uno.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@
5252
$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm'
5353
">true</SuppressTrimAnalysisWarnings>
5454

55+
<!--
56+
e_sqlite3 (bundled via SQLitePCLRaw.bundle_e_sqlite3, pinned for #492) exposes variadic
57+
(varargs) native functions (sqlite3_config/sqlite3_db_config). The WebAssembly SDK's
58+
build-time native-interop check flags every fixed-arity P/Invoke overload SQLitePCLRaw
59+
ships to work around this (sqlite3_config_none, sqlite3_config_int, etc.) as WASM0001,
60+
even though this sample's actual SQLite usage (in-memory EF Core CRUD via AppDbContext)
61+
never calls sqlite3_config/sqlite3_db_config directly. This is diagnostic-only noise -
62+
WASM0001 is a standard MSBuild task warning code (emitted via TaskLoggingHelper.LogWarning
63+
in dotnet/runtime's WasmAppBuilder), so it honors NoWarn like any other build warning.
64+
Same documented, NoWarn-suppressible pattern as
65+
docs/in-depth/client/advanced/blazor-wasm.md. See #543.
66+
-->
67+
<NoWarn Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browserwasm'">$(NoWarn);WASM0001</NoWarn>
68+
5569
</PropertyGroup>
5670
<ItemGroup>
5771
<None Remove="Assets\AddItem.png" />

0 commit comments

Comments
 (0)