Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steamdeck / Linux Build #77

Closed
LauraWebdev opened this issue Jan 17, 2024 · 4 comments
Closed

Steamdeck / Linux Build #77

LauraWebdev opened this issue Jan 17, 2024 · 4 comments
Assignees
Labels
bug Something isn't working external External dependencies & install/uninstall experience help wanted Extra attention is needed
Milestone

Comments

@LauraWebdev
Copy link
Collaborator

Currently, the release pipeline does not package libwebkit2gtk into the executable to be able to be run on Linux without installing additional packages. This is especially bad since the SteamDeck (one of our target devices) do not allow installation of arbitrary packages.

As laid out in tryphotino/photino.Documentation#18 (comment), there seems to be a way to package the dependency itself.

@LauraWebdev LauraWebdev added bug Something isn't working help wanted Extra attention is needed external External dependencies & install/uninstall experience labels Jan 17, 2024
@LauraWebdev LauraWebdev added this to the Release 3.0.0 milestone Jan 17, 2024
@LauraWebdev LauraWebdev self-assigned this Jan 17, 2024
@LauraWebdev
Copy link
Collaborator Author

LauraWebdev commented Jan 17, 2024

I've put a copy of the packages into the SpinShareClient/lib/linux folder and extended the SpinShareClient.csproj to include those libs in the build (which it seemingly does, as seen by the bigger zip size). Testing on a real SteamDeck resulted in the error that libwebkit2gtk-4.1-0.so could not be loaded/found though.

Maybe we'll have to wait with this issue until @philippjbauer / @MikeYeager / @tryphotino have released their documentation for publishing under Linux in the future.

@philippjbauer
Copy link

Hi Laura! Over the last few days I dug deeper into the issue. Looking at the build output folder, do you find the library in the root of the output folder alongside the YourProjectName.dll file? Do you get a console window when you switch the OutputType from WinExe to Exe in your csproj file? The debug information could help nail this down. On the Steam Deck you should have a folder for your project in ~/.net/YourProjectName with folders that include your build output after extraction from single file. You should find the library in there.

It might help if you add the following code to your Program.cs (before calling PhotinoWindow) to force the current working path to the path the executable is in:

// This is more accurate than Directory.CurrentDirectory() to get the Working Directory
string entryAssemblyLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

// Set the current directory to the location of the executable
// This may be necessary for the native libraries to load properly
Directory.SetCurrentDirectory(entryAssemblyLocation);

@LauraWebdev
Copy link
Collaborator Author

LauraWebdev commented Jan 17, 2024

Hey @philippjbauer, thank's for stopping by!

.net folder

On the SteamDeck, there are two folders with a seemingly generated ID under ~/.net/SpinShareClient (probably my two builds) that both have the libwebkit2gtk.so and all it's dependencies. (Side question: Are these generated for each new build? Wouldn't that polute the home folder with many many copies of the same libs?)

Build folder

The published build (dotnet publish --configuration Release --runtime linux-x64) has two files,

SpinShareClient (290mb)
SpinShareClient.pdb (39kb)

This is the folder I've zipped and pushed to the SteamDeck for testing. Just building does give me the .so libraries alongside the applications .dll files.

Setting the workdir

Changing the type from WinExe to Exe and setting the workdir did not open a terminal, opening the executable through the terminal gave me a different error claiming libPhotino.Native.so can't be found now (this time, in the .net/ID folder though).

I do have a Sentry.io entry for the crash.

Unable to load shared library 'Photino.Native' 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: 
libwebkit2gtk-4.1.so.0: cannot open shared object file: No such file or directory
/home/deck/Downloads/publish/Photino.Native.so: cannot open shared object file: No such file or directory
/home/deck/.net/SpinShareClient/TeFsfGnQCFNFldahwu4ZlXr7bmBEn8o=/libPhotino.Native.so: cannot open shared object file: No such file or directory
/home/deck/Downloads/publish/libPhotino.Native.so: cannot open shared object file: No such file or directory
/home/deck/.net/SpinShareClient/TeFsfGnQCFNFldahwu4ZlXr7bmBEn8o=/Photino.Native: cannot open shared object file: No such file or directory
/home/deck/Downloads/publish/Photino.Native: cannot open shared object file: No such file or directory
/home/deck/.net/SpinShareClient/TeFsfGnQCFNFldahwu4ZlXr7bmBEn8o=/libPhotino.Native: cannot open shared object file: No such file or directory
/home/deck/Downloads/publish/libPhotino.Native: cannot open shared object file: No such file or directory

LauraWebdev added a commit that referenced this issue Jan 17, 2024
@LauraWebdev
Copy link
Collaborator Author

This is working really well thanks to @philippjbauer publish script. Webkit2GTK doesn't seem to have proper Gamepad support yet, but that's a different issue and I've seen some movement about this in the Webkit Bugzilla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external External dependencies & install/uninstall experience help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants