Fix pack size related marshal issues.#1
Conversation
And sorted Skippedlines
Do we accept every time Steamworks SDK updates we regenerate special struct table by C++ compiler? Or we just using this method to debug marshal bugs when it happens again? |
…ps://github.com/Akarinnnnn/Steamworks.NET.AnyCPU into anycpu-packable-fix-align-by-conditionalmarshal
Update pre-baked generator resource. Make `SteamMarshallerTable` public. Added `.editorconfig` to enforce style.
|
It builds, but as soon as SteamManager.cs tries to load steam_api, it throws an error and crashes. |
|
Which branch areyou building aginast? I'm working on a super long named branch.
…---Original---
From: ***@***.***>
Date: Mon, Feb 23, 2026 15:27 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [Akarinnnnn/Steamworks.NET.AnyCPU] Fix pack size related marshalissues. (PR #1)
sandsalamand left a comment (Akarinnnnn/Steamworks.NET.AnyCPU#1)
It builds, but as soon as SteamManager.cs tries to load steam_api, it throws an error and crashes.
ERROR: [Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details. ERROR: System.DllNotFoundException: Unable to load shared library 'steam_api' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: ERROR: /usr/lib/dotnet/shared/Microsoft.NETCore.App/9.0.13/steam_api.so: cannot open shared object file: No such file or directory ERROR: /usr/lib/dotnet/shared/Microsoft.NETCore.App/9.0.13/libsteam_api.so: cannot open shared object file: No such file or directory ERROR: /usr/lib/dotnet/shared/Microsoft.NETCore.App/9.0.13/steam_api: cannot open shared object file: No such file or directory ERROR: /usr/lib/dotnet/shared/Microsoft.NETCore.App/9.0.13/libsteam_api: cannot open shared object file: No such file or directory ERROR: ERROR: at Steamworks.NativeMethods.SteamAPI_RestartAppIfNecessary(AppId_t unOwnAppID) ERROR: at Steamworks.SteamAPI.RestartAppIfNecessary(AppId_t unOwnAppID) ERROR: at SteamManager._EnterTree() in /home/sand/Documents/homunculus-fighters/MirageSteamworks/Runtime/SteamManager.cs:line 100<Node#27229423002>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
I'm on |
|
I'll investgate it at 10:30 UTC+8.
…---Original---
From: ***@***.***>
Date: Tue, Feb 24, 2026 09:10 AM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [Akarinnnnn/Steamworks.NET.AnyCPU] Fix pack size related marshalissues. (PR #1)
sandsalamand left a comment (Akarinnnnn/Steamworks.NET.AnyCPU#1)
I'm on anycpu-packable-fix-align-by-conditionalmarshal
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Ok. In case this helps you, the steps that I followed to get that error above were:
|
It's little hard for me to follow your steps, especially I use WSL2 for Linux testing that possibly hard to run Godot editor. But I remember Godot uses standard .NET SDK to build scripts. It can help you copy steam .so files to proper location, but it also stops you from manual replace them. Though your step 1 and 2 successfully replaced original V2 files, it might still being overwritten by .NET SDK. Try modify your |
|
Notably this line: <PackageReference Include="Steamworks.NET.AnyCPU" Version="2025.162.7-a-socketmarshal.1" />Replace |
| extension = ".dylib"; | ||
| else | ||
| extension = ".so"; // I can't imagine what else platforms other than linux that | ||
| // Steamworks.NET.AnyCPU will run on, but let's be future proof |
There was a problem hiding this comment.
You are adding the correct extension but not the lib prefix. On Linux and Mac the steam_api file is called libsteam_api .
There was a problem hiding this comment.
I changed these lines to:
string prefix = "lib"; // The library is called libsteam_api on Linux and MacOS
// Will be libsteam_api.so on Linux and libsteam_api.dylib on MacOS
string unixLibraryName = prefix + SysPath.ChangeExtension(libraryName, extension);
string path = SysPath.Combine(assemblyLocation, unixLibraryName);
It did not solve the problem, but I confirmed that it is now the correct name "libsteam_api.so" on Linux.
I've got a Godot game building and ran it on a steam deck through steam with version 2025.162.6.b-socket.1 if it helps. I can try updating to this one to make sure it works on my demo project if it helps out at all |
Move Any CPU native resolve logic to another file. Minor changes to .editorconfig
Your game is working right? Which version of Godot are you two using? There might be some version caused differences. |
This PR is too large now, code style (#if order) will be discussed and fixed in upcoming PR.
Our goal is to fix most callback system related marshal issues.
Added a conditional marshalling table to decide which alignment to use at runtime, this should fix most callback-retrieve related issues.
Struct parameters in interface methods are
stillneed to fix. Edit: Completed.I think we
stillneed some effort to fix parameters, maybe we still have to ship different assembly for different platforms.Edit: Parameter marshal is done, through it looks ugly.
Now the only problem is to find out which struct we treat it specially, in generation process.