Repository navigation
fix(webgpu): Export the wgpu functions from iOS apps - #25663
Merged
ramezgerges merged 2 commits intoOct 26, 2026
Merged
ramezgerges merged 2 commits into
ramezgerges merged 2 commits into
Conversation
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]>
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
1 of 5 tasks
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]>
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
ajpinedam
approved these changes
Oct 25, 2026
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. |
2 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
_UnoWebGpuLinkIosNativelinkedlibwgpu_native.abut never exported its functions. The final link only exports listed symbols, so an app getting WebGPU from the packages failed at startup withEntryPointNotFoundException. The in-repo build exports them through a separate,nm-based target, so it never hit this.The package now:
buildTransitive/wgpu-native-ios.symbols, 228 names, identical in the device and both simulator slices) and declares them asReferenceNativeSymbol. 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 nonm(MSBuild on Windows for a paired Mac);MetalandQuartzCoreon theNativeReference: kept functions are no longer dead-stripped, so the Metal calls they make must resolve (otherwise the link fails on_MTLCreateSystemDefaultDevicein 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 withnmof 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):Uno.WinUI.Composition.WebGpu7.0.0-dev.2420,UnoFeaturesSkia;WebGpu, only the WebGPU graphics backend registered):wgpusymbols; startup fails withWebGpuGraphicsProvider/WebGpu: context factory threw (EntryPointNotFoundException), as reported;adapter='Apple iOS simulator GPU' backend=Metal), and the page renders. Same with-p:NoSymbolStrip=false, which strips like a device build (41,697 symbols down to 1,301, all 228 wgpu exports kept).MSB4062on these published packages (Building with the WebGpu feature fails with MSB4062 for DetectWebGpuUsage_v0 in a CI-built Uno.Sdk #25336, fixed by fix(sdk): Move WebGPU usage detection into Uno.Sdk #25580).dlsym(wgpuCreateInstance)fails; this change gives 228 and the lookup succeeds.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 ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code