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
BUG: Unset PYTHONPATH, LD_LIBRARY_PATH, PERLLIB, etc before post processing #1831
Comments
is this connected to why my script doesen't work?
|
I'd think it's rather my other issue #1832 that's the culprit -- you'll need to open for read the file that Slic3r gives you (in $1), then loop on all of it, then open $1 for write and stuff all output in there. Something like
or use |
@probonopd Please heeeelp! For Slic3r 1.42.0-alphas, we are setting the LD_LIBRARY_PATH to point to the bundled libpng, that's all the path modifications we do in the slic3r starter batch script. All the rest is done by the Appimage magic. What should we do to support starting of the Python or Perl post processing scripts from Slic3r packed into AppImage, so that the scripts are processed by the Python or Perl interpreter installed in the system? |
Three thoughts:
|
1 is not an option, as we do not want to make the installation package huge for a fraction of Slic3r users. 2 is not a good solution as the user may have set those variables himself on the system. 3 is a good solution, but changing AppRun is out of our reach, at least in short term. I suppose AppRun is part of the AppImage magic. Why should AppImage rewrite the Perl & Python environment by default? |
|
Thanks. No more computer today.
…On Fri, Mar 1, 2019 at 10:39 PM probonopd ***@***.***> wrote:
AppRun in the Slic3r PE AppImage is a bash script actually... check it
out. (It seems to be missing from this repo though?)
***@***.***:~$ /home/me/Downloads/Slic3rPE-1.42.0-alpha6+238-vk-octoprint-linux64-full-g8fd300c-201903011514.AppImage --appimage-extract AppRun
squashfs-root/AppRun
***@***.***:~$ cat squashfs-root/AppRun
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export UNION_PRELOAD="${HERE}"
export LD_PRELOAD="${HERE}/libunionpreload.so"
export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}"
export PYTHONHOME="${HERE}"/usr/
export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}"
export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}"
export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}"
EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g')
exec ${EXEC} "$@"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1831 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFj5I32Ds96araalECB5abUz4On6sXebks5vSZ38gaJpZM4a_CCK>
.
|
This should be fixed now, a custom |
If |
Cool. |
Version
Slic3r 1.42.0-alpha5 (App Image)
Operating system type + version
Linux 16.04
Behavior
Work-around
In Python, use
-E
in shebang line as inAnalysis
Inside the script, the line
reveals that the following environment variables are added or changed when the user's program is invoked from within the app image
('PYTHONHOME', '/tmp/.mount_Slic3rin96j0/usr/')
('XDG_DATA_DIRS', '/tmp/.mount_Slic3rin96j0/usr/share/:/usr/share/cinnamon:/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/var/lib/snapd/desktop:/usr/share/mdm/')
('LD_LIBRARY_PATH', '/tmp/.mount_Slic3rin96j0/usr/bin/bin')
('PYTHONPATH', '/tmp/.mount_Slic3rin96j0/usr/share/pyshared/:')
('PERLLIB', '/tmp/.mount_Slic3rin96j0/usr/share/perl5/:/tmp/.mount_Slic3rin96j0/usr/lib/perl5/:')
All such variables should be unchanged from the values given when Slic3r is invoked. In particular, most of them should remain unset!!!
The text was updated successfully, but these errors were encountered: