-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add support to launching renpy from inside flatpak #20
Comments
Sounds harmless enough. Feel free to submit a PR! |
The needs are actually not a small footprint in your code and I no longer think it will do good. Go to directory where renpy.py is.
Edit renpy.py.
Add after:
This works nicely enough and it won't require doing any change to the code because of flatpak. |
@brunoais Does https://github.com/furudean/vscode-renpy-warp/releases/tag/v1.14.0 help work around this issue? |
I will try it soon. At current pace, I'll probably try it, at most, by wednesday. I'm in the middle of a broken build and experimenting with other things which makes inserting this in between not trivial. |
No matter if Renpy is already running or not, it always tries to start a new process. However, the errors renpy was showing ate typical of trying to run renpy inside the sandbox. Seems like you are overriding all environment variables and replacing them with only your own. Is that what this does? It's the only possible explanation I can think of. |
I mean launching Ren'Py outside Visual Studio Code and then having the process connect, if that part works. I think we can probably do more to support launching from flatpack but I'm curious if that's a decent workaround at least |
Are you expecting some other environment variables to be passed there? This is currently not supported but maybe something that can be added if it fits a specific purpose |
It doesn't work. It always tries to create a new renpy process, even when one already exists.
Yes. When running inside flatpak, it's expecting to receive the env var |
This works pretty well for Mac, Linux and Windows, which are the environments I've chosen to support. Flatpacks definitely werent a part of my design and flips things a bit on its head. I would say that redesigning this mechanism isn't a super important thing for me since flatpack users are in the minority. But I want to see if I can make some adjustments to accommodate this. I don't have a good way to test these features though, unfortunately. Side channeling discovery in line with a pidfile or similar is not a bad idea, and I forgot why I didn't go for it initially. I will review your PoC again and see if I can figure out if it fits in or not |
In my design there's no pid in the file but it's easy to add one if it helps. The whole design is that you read the port number from the file and then you connect to it. It's designed such that the VN is the server and the editor is the client (which is what makes most sense to the way I organize these kinds of things hierarchically). |
Had a think about it. I want to maintain support of multiple Ren'Py instances in the same game, which would require a more bespoke method of tracking all of all the running ports (and cleaning up when they close, sometimes unexpectedly). From that perspective, it makes more sense to have one server per Visual Studio Code workspace, as it is currently. Thoughts not fully formed yet, but I'm not sure how to solve that |
If you prefer like that, then I'd keep the same kind of design I did but inverted. |
Currently, in linux, the code only considers situations where the program is run outside any sandbox or that it to spawning a new process outside the sandbox is the same as from inside the sandbox. This is true for
snap
andAppImage
but not so much for flatpak.However, flatpak provides an API (behind a permission) to work with that. It also includes a command inside the sandbox
flatpak-spawn --host
.To easily identify it's running inside flatpak, it also has the environment variable
container
set toflatpak
Using the env var for test, it should only be editing https://github.com/furudean/vscode-renpy-warp/blob/main/src/lib/sh.ts#L144-L146 to use
flatpak-spawn --host
if it's set.If you are ok with having this feature that, I'll try making this myself and submit a pull request.
The text was updated successfully, but these errors were encountered: