Skip to content

fix(webgpu): Export the wgpu functions from iOS apps - #25663

Merged
ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/webgpu-ios-export-symbols
Oct 26, 2026
Merged

ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/webgpu-ios-export-symbols

Conversation

@ramezgerges

@ramezgerges ramezgerges commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25657

PR Type:

🐞 Bugfix

What changed? 🚀

On iOS, wgpu-native is linked statically and the WebGPU loader looks its functions up on the main program handle, which only sees exported symbols. The package's _UnoWebGpuLinkIosNative linked libwgpu_native.a but never exported its functions. The final link only exports listed symbols, so an app getting WebGPU from the packages failed at startup with EntryPointNotFoundException. The in-repo build exports them through a separate, nm-based target, so it never hit this.

The package now:

  • ships the list of wgpu-native's public functions (buildTransitive/wgpu-native-ios.symbols, 228 names, identical in the device and both simulator slices) and declares them as ReferenceNativeSymbol. The SDK then exports them at link time and keeps them through the symbol strip (strip -i -s mtouch-symbols.list), which is on by default for device builds and keeps only that list. Exporting by pattern at link time alone (the first commit) survives the link but not the strip. The list ships in the package because consumers may have no nm (MSBuild on Windows for a paired Mac);
  • links Metal and QuartzCore on the NativeReference: kept functions are no longer dead-stripped, so the Metal calls they make must resolve (otherwise the link fails on _MTLCreateSystemDefaultDevice in an app that doesn't link Metal itself).

The repo's own iOS provisioning (wgpu-native.targets) now uses the same list instead of generating one, and on macOS compares it with nm of the downloaded archive, failing with a regeneration hint if a wgpu-native bump changes the exported functions.

Validation

On macOS 27, Xcode 27.1, .NET 11 rc.2 iOS workload, iOS 27 simulator, Release (iossimulator-arm64):

Not covered: an actual device (ios-arm64) build; the stripped simulator build above exercises the same strip step. The package ships no tvOS slices, so tvOS WebGPU from the packages remains unsupported, as before.

PR Checklist ✅

🤖 Generated with Claude Code

The package linked wgpu-native statically but left its functions out of
the app's export list, so the loader could not find them on the main
program handle (EntryPointNotFoundException). They are now exported by
pattern, with the Metal they need, so no symbol list has to be generated.

Fixes unoplatform#25657

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

Exporting by pattern at link time is not enough: the symbol strip, on by
default for device builds, keeps only the SDK's symbol list, so the wgpu
functions vanished again. The package now ships their list and declares
it as ReferenceNativeSymbol. The repo's provisioning uses the same list
and checks it against the archive with nm on macOS.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Oct 23, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@mergify

mergify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ramezgerges
ramezgerges merged commit 67957f6 into unoplatform:master Oct 26, 2026
56 checks passed
@ramezgerges
ramezgerges deleted the dev/rara/webgpu-ios-export-symbols branch October 26, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: an app using WebGPU from the NuGet packages can't start (EntryPointNotFoundException): the package doesn't export the wgpu symbols

3 participants