Skip to content

fix: suppress WASM0001 sqlite3_config/db_config varargs warnings on TodoApp.Uno browserwasm#567

Merged
adrianhall merged 2 commits into
CommunityToolkit:mainfrom
adrianhall:issues/543
Jul 11, 2026
Merged

fix: suppress WASM0001 sqlite3_config/db_config varargs warnings on TodoApp.Uno browserwasm#567
adrianhall merged 2 commits into
CommunityToolkit:mainfrom
adrianhall:issues/543

Conversation

@adrianhall

Copy link
Copy Markdown
Collaborator

Summary

Fixes #543.

The browserwasm head of TodoApp.Uno emits a block of WASM0001 warnings about unsupported native varargs functions in the bundled SQLite provider:

warning WASM0001: Found a native function (sqlite3_config) with varargs in e_sqlite3. Calling such functions is not supported, and will fail at runtime. Managed DllImports:
warning WASM0001:     System.Int32 sqlite3_config_none(System.Int32) (in [SQLitePCLRaw.provider.e_sqlite3] SQLitePCL.SQLite3Provider_e_sqlite3+NativeMethods)
...
warning WASM0001: Found a native function (sqlite3_db_config) with varargs in e_sqlite3. Calling such functions is not supported, and will fail at runtime. Managed DllImports:

CI run that surfaced this: https://github.com/CommunityToolkit/Datasync/actions/runs/29093946725 (todoapp-uno / browserwasm job)

Root cause

e_sqlite3's native sqlite3_config/sqlite3_db_config C functions are variadic (varargs), which the WebAssembly toolchain's managed-to-native interop cannot support. SQLitePCLRaw.provider.e_sqlite3 ships several fixed-arity P/Invoke overloads (sqlite3_config_none, sqlite3_config_int, sqlite3_config_log, etc.) to work around this for the specific configuration calls SQLitePCLRaw itself needs — the WebAssembly SDK's build-time native-interop check flags all of them anyway as a blanket "any varargs-shaped native symbol is risky" warning, even though this sample's actual SQLite usage (AppDbContext configured with UseSqlite against an in-memory connection in App.xaml.cs) never calls sqlite3_config/sqlite3_db_config directly.

Why suppress rather than fix the code

WASM0001 is emitted via TaskLoggingHelper.LogWarning(..., warningCode: "WASM0001", ...) in dotnet/runtime's WasmAppBuilder (PInvokeTableGenerator.csLogAdapter.Warning) — the standard MSBuild task-warning overload, which honors $(NoWarn)/warnings-as-errors filtering like any other build warning (CS*, NETSDK*, etc.). This repo already documents and uses exactly this suppression for the same warning on the Blazor WASM sample, in docs/in-depth/client/advanced/blazor-wasm.md (added in #394):

<PropertyGroup>
    <NoWarn>$(NoWarn);WASM0001</NoWarn>
</PropertyGroup>

Unlike the Blazor WASM sample — which never actually uses SQLite and instead removes the unused native asset before the workload check runs (see #523) — TodoApp.Uno genuinely configures EF Core with the SQLite provider on every head, including browserwasm, so that trick doesn't apply here. Suppression is the correct fix, matching the issue's own root-cause analysis.

Changes

Testing

  • dotnet restore / dotnet build --configuration Debug on Datasync.Toolkit.sln — succeeded, 0 warnings / 0 errors. (This solution doesn't include the edited sample project, confirming no impact on the core library.)
  • dotnet test Datasync.Toolkit.sln --no-build --configuration DebugCommunityToolkit.Datasync.Client.Test: 1432/1432 passed, plus all non-container-dependent server test suites passed 100%. Server.Test/Server.MongoDB.Test/Server.EntityFrameworkCore.Test had pre-existing, environment-only failures (no local Docker daemon; those suites depend on TestContainers) — unrelated to this change, matching the precedent noted in fix: suppress IL2026/IL2104 trim analysis warnings on mobile TodoApp samples #531.
  • Triggered build-samples.yml on this branch via workflow_dispatch: run 29150192782 — all jobs succeeded, including todoapp-uno / browserwasm, which now reports 0 Warning(s) (previously the block of WASM0001 warnings shown above), and the all-samples-built aggregation gate.

Related

…odoApp.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 CommunityToolkit#521/CommunityToolkit#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 CommunityToolkit#543
@adrianhall adrianhall merged commit ae7df2a into CommunityToolkit:main Jul 11, 2026
23 checks passed
@adrianhall adrianhall deleted the issues/543 branch July 11, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TodoApp.Uno: WASM0001 sqlite3_config/db_config varargs warnings on browserwasm head

1 participant