-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Flatpak breaks post-processing scripts #13982
Comments
Have you not seen the pinned issue at the top of this repo ? #13820 There have been several/many duplicates of issues regarding the access problems with flatpack. Enough to warrant the stickied post at the top. |
@neophyl That pinned issue is of no help for this one at all. If you would read the whole text, you would see that I had already tried the ‘solutions’ proposed there, and why they don't work. |
Hello guys, there's an appimage version provided by Simon Peter #13653 https://github.com/probonopd/PrusaSlicer/releases/tag/continuous. I particularly think it's better than flatpak |
Hello, @DrLex0 , thank you for your report. We created internal issue(SPE-2657). Have a nice day |
Hello @DrLex0, I see the issue. In the meantime, can you try this incantation: Inside flatpak it copies out the file to somewhere (in this case This seems way more straight forward than Avenue 2. |
Description of the bug
TL;DR: all but trivial post-processing scripts are fundamentally broken when running PrusaSlicer from Flatpak, and there is no sane workaround that I know of. This is problematic because Linux users are now pretty much forced to use Flatpak.
When configuring a post-processing script in the Linux Flatpak build of PS, it will be executed within the limited Flatpak container environment. If the script requires anything that is not present in that environment, it cannot run, no matter what the user has installed in their host OS.
For instance if the script uses basic Python, it will work because by pure luck, there happens to be a Python runtime installed inside the Flatpak. However, if it requires a specific Python package that is not in the Flatpak, it will fail. If Prusa decides to strip Python from the Flatpak at some point, it will fail. Similarly, if the script requires Perl, or some other binary or library not in the Flatpak, it will fail.
This screenshot is confusing, it does not mean that the configured script does not exist. It means that
/usr/bin/perl
as set in the script's shebang, does not exist inside the Flatpak environment.I have already spent some hours on trying to work around this, and found 2 avenues to run things in or from the host environment, but both proved to be dead-ends.
Avenue 1:
and then invoke the post-processing script line in PrusaSlicer as:
This fails because even though the script runs fine, it is given a path in the
/tmp/
directory inside the Flatpak container as argument. Because the script runs in the host filesystem, it will not find any file at that location. I have found no way to detect this situation from within the script, or how to find the actual path of the file, if that is even possible at all.Avenue 2:
and possibly more custom environment variables into the Flatpak environment to work around the fact that the host filesystem will be mounted as
/run/host/
. For instance running pretty much any binary thing will require adding things toLD_LIBRARY_PATH
, running Perl will also require hackingPERL5LIB
…When setting up all this voodoo just right, it becomes possible to invoke the mounted binaries by prepending
/run/host/
to their absolute path.However, it is obvious that this is total hell, configuring all those hacks cannot be expected from any regular user. And, even if it works, the script is still limited to modifying the G-code file. If it produces any extra files, those will be lost.
At this point I have no idea how to solve this or whether it can be solved at all. Maybe if there would be an option to only run the post-processing after the final G-code file has been saved in the host filesystem, then the
flatpak-spawn --host
option would work.Project file & How to reproduce
Bogus-project-because-you-require-it.zip
How to reproduce:
Checklist of files included above
Version of PrusaSlicer
2.9.0-linux, or any other Flatpak build of a previous version
Operating system
Any Linux
Printer model
Any printer
The text was updated successfully, but these errors were encountered: