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

Can't run appImage on Ubuntu 16.04.2 LTS without Try::Tiny module #140

Closed
burbilog opened this issue Feb 17, 2017 · 26 comments
Closed

Can't run appImage on Ubuntu 16.04.2 LTS without Try::Tiny module #140

burbilog opened this issue Feb 17, 2017 · 26 comments

Comments

@burbilog
Copy link

Version

Slic3r 1.33.5 Prusa

Operating system type + version

Ubuntu 16.04.2 LTS

Behavior

Download Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage and try to run

Expected result: running Slic3r

Actual result: Slic3r fails with following message:

Can't locate Try/Tiny.pm in @INC (you may need to install the Try::Tiny module) (@INC contains: /tmp/.mount_I7GhlJ/usr/bin/bin/lib /home/rm/perl5/lib/perl5 /tmp/.mount_I7GhlJ/usr/bin/lib/site_perl/5.22.0/x86_64-linux-thread-multi /tmp/.mount_I7GhlJ/usr/bin/lib/site_perl/5.22.0 /tmp/.mount_I7GhlJ/usr/bin/lib/5.22.0/x86_64-linux-thread-multi /tmp/.mount_I7GhlJ/usr/bin/lib/5.22.0 .) at /home/rm/perl5/lib/perl5/LWP/Protocol.pm line 11.
BEGIN failed--compilation aborted at /home/rm/perl5/lib/perl5/LWP/Protocol.pm line 11.
Compilation failed in require at /home/rm/perl5/lib/perl5/LWP/UserAgent.pm line 13.
BEGIN failed--compilation aborted at /home/rm/perl5/lib/perl5/LWP/UserAgent.pm line 13.
Compilation failed in require at /tmp/.mount_I7GhlJ/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI/Plater.pm line 11.
BEGIN failed--compilation aborted at /tmp/.mount_I7GhlJ/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI/Plater.pm line 11.
Compilation failed in require at /tmp/.mount_I7GhlJ/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI.pm line 20.
BEGIN failed--compilation aborted at /tmp/.mount_I7GhlJ/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI.pm line 20.
Compilation failed in require at (eval 90) line 1.

cpanm install Try::Tiny fixes the problem, but hey, it's appImage, eh?

STL/Config (.ZIP) where problem occurs

Config does not matter I suppose...

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

It looks like there is another problem going on: The appimage shall not pull the system perl modules. I think what you are seeing is, the system perl modules are pulled before the ones from the AppImage, and seemingly your Perl modules have different dependencies.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

Looking inside the AppRun script generated by the AppImage suite, it starts an application defined in Slic3r.desktop. It looks like the AppRun is flawed, as it first sets up the paths to point inside the AppImage, but then it starts the system installed Slic3r script.

I am not sure where shall I fix it. @probonopd any idea?

@probonopd
Copy link
Contributor

probonopd commented Feb 18, 2017

On Ubuntu 16.04 without a system-installed Slic3r, the AppImage launches with the following output on the console:

me@host:~$ /home/me/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage 
Use of uninitialized value in subroutine entry at /tmp/.mount_isAMZR/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI/Plater.pm line 170.

Which shows that at least in principle, AppRun does launch the correct (bundled) Slic3r.

So I suspect as soon as there is also a Slic3r installed in the system, it somehow picks up the system one/mixes up the two. More investigation needed.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@probonopd

Thanks. The issue is in how the AppRun pulls the name of the executable from the *.desktop file.
It simply gets the file name and it starts it, without prefixing it with the "local" path.

@probonopd
Copy link
Contributor

I do not get the "Use of uninitialized value in subroutine entry" with the AppImage I had generated earlier, https://bintray.com/probono/AppImages/download_file?file_path=Slic3r-1.31.6.prusa3d.glibc2.14-x86_64.AppImage. Can you confirm that the issue reported in this ticket is also present in that version?

@probonopd
Copy link
Contributor

probonopd commented Feb 18, 2017

Thanks. The issue is in how the AppRun pulls the name of the executable from the *.desktop file.
It simply gets the file name and it starts it, without prefixing it with the "local" path.

AppRun exports $PATH to include usr/bin in the AppImage.

If you look at the AppImage, it has Exec=slic3r.wrapper --gui in the desktop file, which launches the shell script usr/bin/slic3r.wrapper inside the AppImage because it is on the $PATH.

@probonopd
Copy link
Contributor

@bubnikv is the script that you are using to produce the AppImage available on GitHub?

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@probonopd

AppRun exports $PATH to include usr/bin in the AppImage.
If you look at the AppImage, it has Exec=slic3r.wrapper --gui in the desktop file, which launches usr/bin/slic3r.wrapper inside the AppImage.

You are right.

What does the
HERE="$(dirname "$(readlink -f "${0}")")")
do?
Namely, why is readling -f necessary? What is special about ${0}, that readlink -f is needed?

slic3r is a bash script, containing the following three lines:
DIR=$(dirname $0)
export LD_LIBRARY_PATH="$DIR/bin"
exec "$DIR/bin/perl5.22.0" "$DIR/bin/slic3r.pl" "$@"

I think the problem lies in my slic3r script. I wonder, whether I shall modify the script to call readlink -f on $0 as well?

@burbilog @probonopd I think the AppImage generates some debug info if started with DEBUG=1. @burbilog would you please provide that log? Thanks.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@probonopd is the script that you are using to produce the AppImage available on GitHub?

It is part of our build suite to build and pack on all platforms. The build suite is currently private. But I am not doing anything special, I just slightly modified the scripts you have provided.

@probonopd
Copy link
Contributor

@probonopd
Copy link
Contributor

probonopd commented Feb 18, 2017

Ah, export LD_LIBRARY_PATH="$DIR/bin" in usr/bin/slic3r throws away the LD_LIBRARY_PATH that AppRun has set before. I guess it should be export LD_LIBRARY_PATH="$DIR/bin":$LD_LIBRARY_PATH?

@burbilog
Copy link
Author

DEBUG=1 && ./Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage

LC_PAPER=ru_RU.UTF-8
XDG_VTNR=7
MANPATH=/usr/share/man:/usr/openwin/share/man:/usr/local/man:/usr/local/lib/perl5/man:/usr/local/lib/perl5/5.00502/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man:/var/qmail/man:/usr/local/nessus/man:/usr/local/lib/perl5/5.8.7/perl/man/:/usr/local/lib/perl5/5.8.7/man/:/usr/share/openssl/man/:/usr/local/lib/perl5/5.8.8/man/:/usr/local/share/man/
NNTPSERVER=news.rt.ru
KDE_MULTIHEAD=false
LC_ADDRESS=ru_RU.UTF-8
XDG_SESSION_ID=2
SSH_AGENT_PID=4961
PAM_KWALLET5_LOGIN=/tmp/kwallet5_rm.socket
LC_MONETARY=ru_RU.UTF-8
GPG_AGENT_INFO=/home/rm/.gnupg/S.gpg-agent:0:1
SHELL=/usr/bin/zsh
TERM=xterm
SAVEHIST=500
HISTSIZE=500
histsize=500
KONSOLE_DBUS_SERVICE=:1.46
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/rm/.gtkrc-2.0:/home/rm/.config/gtkrc-2.0
DIRSTACKSIZE=20
dirstacksize=200
PERL5LIB=/home/rm/perl5/lib/perl5
perlbrew_command=perlbrew
KONSOLE_PROFILE_NAME=Profile #1
WATCH=notme
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
CVSROOT=/usr/local/src/cvsroot
LD_PRELOAD=/tmp/.mount_93wzoj/libunionpreload.so
LC_NUMERIC=ru_RU.UTF-8
WINDOWID=85983237
PERL_MB_OPT=--install_base "/home/rm/perl5"
SHELL_SESSION_ID=6b3787e173924000a853f1691aceee49
LC_ALL=ru_RU.KOI8-R
XDG_SESSION_CLASS=user
KDE_FULL_SESSION=true
USER=rm
QT_ACCESSIBILITY=1
LC_TELEPHONE=ru_RU.UTF-8
LD_LIBRARY_PATH=/tmp/.mount_93wzoj/usr/lib/:/tmp/.mount_93wzoj/usr/lib/i386-linux-gnu/:/tmp/.mount_93wzoj/usr/lib/x86_64-linux-gnu/:/tmp/.mount_93wzoj/usr/lib32/:/tmp/.mount_93wzoj/usr/lib64/:/tmp/.mount_93wzoj/lib/:/tmp/.mount_93wzoj/lib/i386-linux-gnu/:/tmp/.mount_93wzoj/lib/x86_64-linux-gnu/:/tmp/.mount_93wzoj/lib32/:/tmp/.mount_93wzoj/lib64/:
MAILCHECK=604800
PERLBREW_BASHRC_VERSION=0.74
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
PGLIB=/usr/local/pgsql/lib
RPROMPT=[%~ %T %w] 
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
LOGCHECK=300
SSH_AUTH_SOCK=/tmp/ssh-6n21PUSBKlwu/agent.4893
SESSION_MANAGER=local/moloch:@/tmp/.ICE-unix/5048,unix/moloch:/tmp/.ICE-unix/5048
DEFAULTS_PATH=/usr/share/gconf//usr/share/xsessions/plasma.default.path
PERLBREW_ROOT=/home/rm/perl5/perlbrew
XDG_CONFIG_DIRS=/etc/xdg/xdg-/usr/share/xsessions/plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
PATH=/tmp/.mount_93wzoj/usr/bin/:/tmp/.mount_93wzoj/usr/sbin/:/tmp/.mount_93wzoj/usr/games/:/tmp/.mount_93wzoj/bin/:/tmp/.mount_93wzoj/sbin/:/home/rm/perl5/bin:/home/rm/perl5/perlbrew/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/etc/rc.d:/var/qmail/bin:/home/rm/bin:/opt/vpopmail/bin:/usr/local/pgsql/bin:/usr/local/nessus/bin:/usr/local/nessus/sbin:/usr/local/vpopmail/bin:/home/rm/android-sdk-linux_x86/platform-tools:/usr/brlcad/bin
DESKTOP_SESSION=/usr/share/xsessions/plasma
GSETTINGS_SCHEMA_DIR=/tmp/.mount_93wzoj/usr/share/glib-2.0/schemas/:
QT_IM_MODULE=compose
UNION_PRELOAD=/tmp/.mount_93wzoj
LC_IDENTIFICATION=ru_RU.UTF-8
BLOCKSIZE=1k
PWD=/home/rm/Downloads
XDG_SESSION_TYPE=x11
KONSOLE_DBUS_WINDOW=/Windows/1
KDE_SESSION_UID=1000
LANG=ru_RU.KOI8-R
MANDATORY_PATH=/usr/share/gconf//usr/share/xsessions/plasma.mandatory.path
LC_MEASUREMENT=ru_RU.UTF-8
PERLBREW_HOME=/home/rm/.perlbrew
ZLE_LINE_ABORTED=
PERLLIB=/tmp/.mount_93wzoj/usr/share/perl5/:/tmp/.mount_93wzoj/usr/lib/perl5/:
KONSOLE_DBUS_SESSION=/Sessions/10
FIGNORE=.o:.pro:.old
COLORFGBG=15;0
HOME=/home/rm
SHLVL=2
XDG_SEAT=seat0
KDE_SESSION_VERSION=5
APPDIR=/tmp/.mount_93wzoj
LANGUAGE=ru_RU:ru:en_GB:en
XCURSOR_THEME=breeze_cursors
APPIMAGE=/home/rm/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage
PROMPT=%m %l%#
PERL_LOCAL_LIB_ROOT=/home/rm/perl5
PYTHONPATH=/tmp/.mount_93wzoj/usr/share/pyshared/:
XDG_SESSION_DESKTOP=KDE
LOGNAME=rm
VISUAL=/usr/bin/vi
XDG_DATA_DIRS=/tmp/.mount_93wzoj/usr/share/:/usr/share//usr/share/xsessions/plasma:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-PbwfnFvULv,guid=d2c3fa4a5a59afec4618dab8589f826e
PGDATA=/usr/local/pgsql/data
WITHOUT_X11=yes
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000
OWD=/home/rm/Downloads
WATCHFMT=%n %a %l from %m at %t.
PROFILEHOME=
QT_PLUGIN_PATH=/tmp/.mount_93wzoj/usr/lib/qt4/plugins/:/tmp/.mount_93wzoj/usr/lib/i386-linux-gnu/qt4/plugins/:/tmp/.mount_93wzoj/usr/lib/x86_64-linux-gnu/qt4/plugins/:/tmp/.mount_93wzoj/usr/lib32/qt4/plugins/:/tmp/.mount_93wzoj/usr/lib64/qt4/plugins/:/tmp/.mount_93wzoj/usr/lib/qt5/plugins/:/tmp/.mount_93wzoj/usr/lib/i386-linux-gnu/qt5/plugins/:/tmp/.mount_93wzoj/usr/lib/x86_64-linux-gnu/qt5/plugins/:/tmp/.mount_93wzoj/usr/lib32/qt5/plugins/:/tmp/.mount_93wzoj/usr/lib64/qt5/plugins/:
XDG_CURRENT_DESKTOP=KDE
PAM_KWALLET_LOGIN=/tmp/kwallet_rm.socket
DEBUG=1
LC_TIME=ru_RU.UTF-8
HISTFILE=/home/rm/.zshhist
PERL_MM_OPT=INSTALL_BASE=/home/rm/perl5
LC_NAME=ru_RU.UTF-8
XAUTHORITY=/tmp/xauth-1000-_0
_=/usr/bin/env
LD_PRELOAD=/tmp/.mount_93wzoj/libunionpreload.so
UNION_PRELOAD=/tmp/.mount_93wzoj
+ THIS=/tmp/.mount_93wzoj/usr/bin//slic3r.wrapper
+ args=("$@")
+ NUMBER_OF_ARGS=1
+ VENDORPREFIX=appimagekit
+ '[' -z /tmp/.mount_93wzoj ']'
++ readlink -f /tmp/.mount_93wzoj/usr/bin//slic3r.wrapper
+ FILENAME=/tmp/.mount_93wzoj/usr/bin/slic3r.wrapper
++ dirname /tmp/.mount_93wzoj/usr/bin/slic3r.wrapper
+ DIRNAME=/tmp/.mount_93wzoj/usr/bin
++ find /tmp/.mount_93wzoj -maxdepth 1 -name '*.desktop'
++ head -n 1
+ DESKTOPFILE=/tmp/.mount_93wzoj/slic3r.desktop
++ basename /tmp/.mount_93wzoj/slic3r.desktop
+ DESKTOPFILE_NAME=slic3r.desktop
++ sed -n -e 's/^Name=//p' /tmp/.mount_93wzoj/slic3r.desktop
++ head -n 1
+ APP_FULL=Slic3r
++ echo Slic3r
++ tr -c -d '[:alnum:]'
+ APP=Slic3r
+ '[' -z Slic3r ']'
+ '[' -z Slic3r ']'
+ RETURN=yes
+ [[ /tmp/.mount_93wzoj/usr/bin/slic3r.wrapper != *.wrapper ]]
++ echo /tmp/.mount_93wzoj/usr/bin/slic3r.wrapper
++ sed -e 's|.wrapper||g'
+ BIN=/tmp/.mount_93wzoj/usr/bin/slic3r
+ [[ ! -f /tmp/.mount_93wzoj/usr/bin/slic3r ]]
+ trap atexit EXIT
+ [[ 1000 -ne 0 ]]
+ DESTINATION_DIR_DESKTOP=/home/rm/.local/share/applications
+ STAMP_DIR=/home/rm/.local/share/appimagekit
+ SYSTEM_WIDE=
+ '[' x--gui = x--remove-appimage-desktop-integration ']'
+ check_prevent /home/rm/.local/share/appimagekit/no_desktopintegration
+ FILE=/home/rm/.local/share/appimagekit/no_desktopintegration
+ '[' -e /home/rm/.local/share/appimagekit/no_desktopintegration ']'
+ check_prevent /usr/share/appimagekit/no_desktopintegration
+ FILE=/usr/share/appimagekit/no_desktopintegration
+ '[' -e /usr/share/appimagekit/no_desktopintegration ']'
+ check_prevent /etc/appimagekit/no_desktopintegration
+ FILE=/etc/appimagekit/no_desktopintegration
+ '[' -e /etc/appimagekit/no_desktopintegration ']'
+ pidof appimaged
+ '[' '!' -z '' ']'
+ check_dep desktop-file-validate
+ DEP=desktop-file-validate
++ which desktop-file-validate
+ '[' -z /usr/bin/desktop-file-validate ']'
+ check_dep update-desktop-database
+ DEP=update-desktop-database
++ which update-desktop-database
+ '[' -z /usr/bin/update-desktop-database ']'
+ check_dep desktop-file-install
+ DEP=desktop-file-install
++ which desktop-file-install
+ '[' -z /usr/bin/desktop-file-install ']'
+ check_dep xdg-icon-resource
+ DEP=xdg-icon-resource
++ which xdg-icon-resource
+ '[' -z /usr/bin/xdg-icon-resource ']'
+ check_dep xdg-mime
+ DEP=xdg-mime
++ which xdg-mime
+ '[' -z /usr/bin/xdg-mime ']'
+ check_dep xdg-desktop-menu
+ DEP=xdg-desktop-menu
++ which xdg-desktop-menu
+ '[' -z /usr/bin/xdg-desktop-menu ']'
+ check_prevent /home/rm/.local/share/appimagekit/Slic3r_no_desktopintegration
+ FILE=/home/rm/.local/share/appimagekit/Slic3r_no_desktopintegration
+ '[' -e /home/rm/.local/share/appimagekit/Slic3r_no_desktopintegration ']'
+ check_prevent /usr/share/appimagekit/Slic3r_no_desktopintegration
+ FILE=/usr/share/appimagekit/Slic3r_no_desktopintegration
+ '[' -e /usr/share/appimagekit/Slic3r_no_desktopintegration ']'
+ check_prevent /etc/appimagekit/Slic3r_no_desktopintegration
+ FILE=/etc/appimagekit/Slic3r_no_desktopintegration
+ '[' -e /etc/appimagekit/Slic3r_no_desktopintegration ']'
+ '[' '!' -f /tmp/.mount_93wzoj/slic3r.desktop ']'
+ '[' -z /home/rm/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage ']'
+ ICONFILE=/tmp/.mount_93wzoj/.DirIcon
+ '[' -z /tmp/.mount_93wzoj/usr/share/:/usr/share//usr/share/xsessions/plasma:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop ']'
+ '[' -e /home/rm/.local/share/applications/appimagekit-slic3r.desktop ']'
+ '[' -z '' ']'
+ yesno Install 'Would you like to integrate /home/rm/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage with your system?\n\nThis will add it to your applications menu and install icons.\nIf you don'\''t do this you can still launch the application by double-clicking on the AppImage.'
+ TITLE=Install
+ TEXT='Would you like to integrate /home/rm/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage with your system?\n\nThis will add it to your applications menu and install icons.\nIf you don'\''t do this you can still launch the application by double-clicking on the AppImage.'
+ '[' -x /usr/bin/zenity ']'
+ LD_LIBRARY_PATH=
+ zenity --question --title=Install '--text=Would you like to integrate /home/rm/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702171509.AppImage with your system?\n\nThis will add it to your applications menu and install icons.\nIf you don'\''t do this you can still launch the application by double-clicking on the AppImage.'
+ RETURN=no
+ '[' no = no ']'
+ yesno 'Disable question?' 'Should this question be permanently disabled for Slic3r?\n\nTo re-enable this question you have to delete\n"/home/rm/.local/share/appimagekit/Slic3r_no_desktopintegration"'
+ TITLE='Disable question?'
+ TEXT='Should this question be permanently disabled for Slic3r?\n\nTo re-enable this question you have to delete\n"/home/rm/.local/share/appimagekit/Slic3r_no_desktopintegration"'
+ '[' -x /usr/bin/zenity ']'
+ LD_LIBRARY_PATH=
+ zenity --question '--title=Disable question?' '--text=Should this question be permanently disabled for Slic3r?\n\nTo re-enable this question you have to delete\n"/home/rm/.local/share/appimagekit/Slic3r_no_desktopintegration"'
+ RETURN=no
+ '[' no = yes ']'
+ exit 0
+ atexit
+ '[' -z '' ']'
+ '[' 1 -eq 0 ']'
+ exec /tmp/.mount_93wzoj/usr/bin/slic3r --gui
Can't locate Try/Tiny.pm in @INC (you may need to install the Try::Tiny module) (@INC contains: /tmp/.mount_93wzoj/usr/bin/bin/lib /home/rm/perl5/lib/perl5 /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/x86_64-linux-thread-multi /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0 /tmp/.mount_93wzoj/usr/bin/lib/5.22.0/x86_64-linux-thread-multi /tmp/.mount_93wzoj/usr/bin/lib/5.22.0 .) at /home/rm/perl5/lib/perl5/LWP/Protocol.pm line 11.
BEGIN failed--compilation aborted at /home/rm/perl5/lib/perl5/LWP/Protocol.pm line 11.
Compilation failed in require at /home/rm/perl5/lib/perl5/LWP/UserAgent.pm line 13.
BEGIN failed--compilation aborted at /home/rm/perl5/lib/perl5/LWP/UserAgent.pm line 13.
Compilation failed in require at /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI/Plater.pm line 11.
BEGIN failed--compilation aborted at /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI/Plater.pm line 11.
Compilation failed in require at /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI.pm line 20.
BEGIN failed--compilation aborted at /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI.pm line 20.
Compilation failed in require at (eval 90) line 1.

@probonopd
Copy link
Contributor

probonopd commented Feb 18, 2017

I think the key lies in

@inc contains: /tmp/.mount_93wzoj/usr/bin/bin/lib /home/rm/perl5/lib/perl5 /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/x86_64-linux-thread-multi /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0 /tmp/.mount_93wzoj/usr/bin/lib/5.22.0/x86_64-linux-thread-multi /tmp/.mount_93wzoj/usr/bin/lib/5.22.0

So why is it loading stuff from /home/rm/perl5/lib/perl5/ then? (I am not a Perl expert...)

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@burbilog I think the problem seems to become evident. Greping perl from your log shows:

PERL5LIB=/home/rm/perl5/lib/perl5
perlbrew_command=perlbrew
PERL_MB_OPT=--install_base "/home/rm/perl5"
PERLBREW_BASHRC_VERSION=0.74
PERLBREW_ROOT=/home/rm/perl5/perlbrew
PATH=/tmp/.mount_93wzoj/usr/bin/:/tmp/.mount_93wzoj/usr/sbin/:/tmp/.mount_93wzoj/usr/games/:/tmp/.mount_93wzoj/bin/:/tmp/.mount_93wzoj/sbin/:/home/rm/perl5/bin:/home/rm/perl5/perlbrew/bin:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/etc/rc.d:/var/qmail/bin:/home/rm/bin:/opt/vpopmail/bin:/usr/local/pgsql/bin:/usr/local/nessus/bin:/usr/local/nessus/sbin:/usr/local/vpopmail/bin:/home/rm/android-sdk-linux_x86/platform-tools:/usr/brlcad/bin
PERLBREW_HOME=/home/rm/.perlbrew
PERLLIB=/tmp/.mount_93wzoj/usr/share/perl5/:/tmp/.mount_93wzoj/usr/lib/perl5/:
PERL_LOCAL_LIB_ROOT=/home/rm/perl5
PERL_MM_OPT=INSTALL_BASE=/home/rm/perl5
Can't locate Try/Tiny.pm in @inc (you may need to install the Try::Tiny module) (@inc contains: /tmp/.mount_93wzoj/usr/bin/bin/lib /home/rm/perl5/lib/perl5 /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0/x86_64-linux-thread-multi /tmp/.mount_93wzoj/usr/bin/lib/site_perl/5.22.0 /tmp/.mount_93wzoj/usr/bin/lib/5.22.0/x86_64-linux-thread-multi /tmp/.mount_93wzoj/usr/bin/lib/5.22.0 .) at /home/rm/perl5/lib/perl5/LWP/Protocol.pm line 11.

It looks like we (either me or probably @probonopd) need to filter out the PERL environment variables before running a perl script packed into an AppImage. Maybe AppImage should initialize the shell environment from scratch? I am far from being a Linux expert, so I don't know how to do that as of now. I will look into what PERL environment variables are used to put together the @inc paths and what are their priorities.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@burbilog would you please try to undefine PERL5LIB before running the AppImage?

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

Reading
http://stackoverflow.com/questions/2526804/how-is-perls-inc-constructed-aka-what-are-all-the-ways-of-affecting-where-pe

I need to unset PERL5LIB and PERLLIB in the slic3r shell wraper. I will try to update the Linux and OSX builds as both may potentially affected. Also the Windows slic3r.exe wrapper shall filter out the two variables.

@burbilog
Copy link
Author

@bubnikv yes, removing PERL5LIB from environment fixes the problem.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@burbilog Great, I am running another build with
export PERL5LIB=
export PERLLIB=
at the start of the slic3r shell script. Hope this will fix it.

@probonopd
Copy link
Contributor

This is what I am currently doing in AppRun.c.

Its intention is to add the inside of the AppImage to the Perl search path, similar to what I do with $PATH.

Should I change it?

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@probonopd I think it depends. I suppose Slic3r is the first AppImage packing its own Perl interpreter. If the AppImage uses the system-wide perl interpreter, then your implementation is all right.

I think it would be sufficient to keep it as it is, but to document it well, so if someone is packing a Perl interpreter into the AppImage, he would know he needs to unset PERL5LIB and PERLLIB in his startup script.

@probonopd
Copy link
Contributor

I think bundling the Perl interpreter is the right thing to do.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@burbilog I have updated the Linux & OSX binary builds to unset PERLLIB & PERL5LIB. Please download the updated AppImage from
https://github.com/prusa3d/Slic3r/releases/tag/version_1.33.5
and give it a try, so we can close this issue :-)

@probonopd
Copy link
Contributor

Don't know if this is serious, but I am still getting

me@host:~/LibrePCB/build$ /home/me/Downloads/Slic3r-1.33.5-prusa3d-linux64-full-201702181304.AppImage 
Use of uninitialized value in subroutine entry at /tmp/.mount_BchhWk/usr/bin/lib/site_perl/5.22.0/Slic3r/GUI/Plater.pm line 170.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 18, 2017

@probonopd I don't know what is the Perl complaining about. The line initializes a menu, and with success.
$self->{htoolbar}->AddTool(TB_LAYER_EDITING, 'Layer Editing', Wx::Bitmap->new($Slic3r::var->("variable_layer_height.png"), wxBITMAP_TYPE_PNG), wxNullBitmap, 1, undef, 'Layer Editing');

It must be something inside the wxWidgets perl binding. Not nice, but seems to be harmless. Something for the next release I suppose.

@burbilog
Copy link
Author

@bubnikv Yes, it works now.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 19, 2017

Thanks to all involved, happily closing :-)

@bubnikv bubnikv closed this as completed Feb 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants