luxtorpeda-dev / luxtorpeda

Steam Play compatibility tool to run games using native Linux engines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Launcher fails to start (Cannot access non-root filesystem)

ThibaultLemaire opened this issue · comments

Linux Distribution

NixOS

Luxtorpeda Version

56

Bug description

The luxtorpeda launcher fails to start.

Steps To Reproduce

  1. Select a supported game (tested with Homeworld Remastered Collection), force luxtorpeda as the Steam Play compatibility tool.
  2. Click Play
  3. Game does not start

Expected Behavior

Launcher starts

Additional Context

No response

Relevant log output

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 17, kind: AlreadyExists, message: "File exists" }', src/package.rs:64:38

@ThibaultLemaire Thanks for the report.

That line (fs::create_dir_all(&folder_path).unwrap();) is a strange place to fail. It looks like there's a collision with something at ~/.config/luxtorpeda. Can you tell me if there is anything there and if it's a directory or a file?

Can you tell me if there is anything there and if it's a directory or a file?

There's nothing there.

I'll make a local build and fix the issue.

Also, I don't know if you're familiar with Nix & NixOS, but I'll probably have to write a small shell.nix file to have a build environment, would you like me to contribute it?

@ThibaultLemaire sure! If you can find a fix feel free to open a pr, and feel free to include the shell file you mentioned.

It's probably because my .cache folder is symlinked. I'm experiencing weird behaviour around that symlink. fs::create_dir_all() says AlreadyExists, but cache_home.exists() says false. I'm working on a proper fix

EDIT: Scratch the symlink. Symlinks work just fine. It's somehow an issue with my .cache folder itself. Even with the absolute path I'm getting a NotFound, when everything else confirms there is something there (file manager, CLI, and everything else that definitely writes to .cache and is still working fine). I've never seen that before

Sanity check: a rust executable compiled natively and run directly correctly accesses both the symlink, and the absolute path.

I've checked permissions (16877) but I don't see anything that could explain it there. Luxtorpeda can see other folders at the same location that have the same permissions... There must be something different in the execution environment provided by steam, but what?

EDIT: I made overlooked some details and jumped to conclusions, see other comments

The steam environment runs inside a container (their steam linux runtime soldier). It's possible that for some reason the mounting is not working as expected. For example, if your symlink is to a different partition/drive than the one that the user directory is on, then it may not mount it automatically. You could try without the symlink on ~/.config and ~/.cache and then try inside steam and see if it works. If so, I believe there's a way to mount additional partitions inside the container.

Ok, so the issue is pretty straightforward, in my case I had to change launch options to

STEAM_COMPAT_MOUNTS=/ssd %command%

From this reddit thread.

Explanation: I have a 1TB HDD and 250GB SSD. I use the HDD as my main partition and offload folders to the SSD via symlinks when these folders prove critical for load time (and/or when they contain non-critical data that I can delete anytime I want to make room). My ~/.cache folder is therefore symlinked to /ssd/home/<user>/.cache. The issue isn't the symlink, it's the fact that luxtorpeda is trying to access another filesystem.
I wrongly assumed that luxtorpeda was able to access other folders in that filesystem because it could see ~/.local which confused me. But in fact I only moved and symlinked ~/.local/share/Steam.


So it's cool now, luxtorpeda starts! Yeay! 🎉 (Nice looking interface btw, I'll have to dig into what libraries you used for the UI)
I'll add a detailed error message for the next idiot that wants to symlink into a different filesystem and submit a PR. (Ideally, it should pop a GUI window though... I'm not familiar with your GUI system and not sure if that's going to be easy to do. If you think that's doable and want to share some pointers, feel free though)

@ThibaultLemaire Great, and thanks about the interface, that was fun to build! I'm using the egui library to do it.

And that makes sense for the issue. For showing a UI error, there's a function inside the dialog file called show_error. You should be able to use that to show a proper error message to the user. If you search for its use in the project, you should be able to find some good examples. Let me know if you need anything further.