Repository navigation
Conversation
PinMameDotNet P/Invokes libpinmame.so on Linux, but the linux-x64 native package ships libpinmame.so.<version> only, so Unity can't load PinMAME (DllNotFoundException). Copy it as libpinmame.so (same RenamedPlugins mechanism as win-x64), delete stale versioned copies, and rename the .meta to keep its GUID and importer settings. Written and submitted with AI (Claude); tested by Ben on Ubuntu 24.04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Comments Outside DiffThese findings could not be posted inline.
|
Problem
On Linux, entering Play mode with the PinMAME gamelogic engine fails with
DllNotFoundException: libpinmame.soinPinMameApi.IsRunning()(fromOnInit). Nothing runs.Root cause
PinMameDotNet.dllfromruntimes/linuxP/Invokes exactlylibpinmame.so, but thePinMame.Native.linux-x64package ships onlylibpinmame.so.3.7.0(SONAMElibpinmame.so.3.7.0).PluginsDeploycopiesnative/*unchanged, so Unity never finds a library with the expected name. CI copies the samePlugins/linux-x64folder into the UPM package, so the published package likely has the same problem. Windows already has the equivalent fix (pinmame64.dllcopied aspinmame.dll).Fix (csproj + meta rename)
linux-x64, stop copyingnative/*as-is and copylibpinmame.so.*toPlugins/linux-x64/libpinmame.soinstead (sameRenamedPluginsmechanism as win-x64).libpinmame.so.<version>left by older builds (.metafiles are excluded from the glob).git mv libpinmame.so.3.7.0.meta libpinmame.so.meta, keeping the GUID and the Editor + Linux64 importer settings.macOS likely has the same mismatch (the binding imports
libpinmame.dylib, the package shipslibpinmame.3.7.0.dylib; a manual symlink was needed on a Mac in March). Not changed here because it couldn't be tested.How tested (Ubuntu 24.04, Unity 6000.5.0f1)
dotnet build VisualPinball.Engine.PinMAME/VisualPinball.Engine.PinMAME.csproj -c Release -r linux-x64with a stalelibpinmame.so.3.7.0seeded in the folder: 0 errors;Plugins/linux-x64containslibpinmame.so(byte-identical to the NuGet native) +libpinmame.so.meta,PinMameDotNet.dll,VisualPinball.Engine.PinMAME.dll; the versioned copy is removed.DllNotFoundException: libpinmame.so; after, PinMAME starts,Game started., and the game plays (coin, start, trough eject, plunger, drain, next ball). The in-editor test used a hand-made.meta; this PR keeps the original GUID via the rename, with the same importer settings.🤖 Generated with Claude Code