WIP: Fixed: Missing symlink python3 -> python3.8 in AppImages
Fixes #1306 (closed)
Reason for the error is that no python3 -> python3.8 symlink is in the AppImage package. Since Inkscape is searching for python3 and - as a fallback - for python, it selects python3 from system (/usr/local/bin/python3). This clashes with the AppImage environment. For details see explanation below.
See also #1050 (closed), inbox#2422 (closed), inbox#2656 (closed), partially inbox#1770 (moved)
@nathanal This is only half of the story: While Python extensions come up now, some lxml Python dependencies are not loaded, so in fact they fail now due incorrect inclusion of libs in generate.sh. I will fix this tomorrow, have no further time today. Hence, I mark this MR as WIP.
Detailed explanation
-
Python interpreters Inkscape is looking for (script.cpp)
const std::map<std::string, Script::interpreter_t> Script::interpreterTab = { #ifdef _WIN32 { "perl", {"perl-interpreter", {"wperl" }}}, { "python", {"python-interpreter", {"pythonw" }}}, #elif defined __APPLE__ { "perl", {"perl-interpreter", {"perl" }}}, { "python", {"python-interpreter", {"python3" }}}, #else { "perl", {"perl-interpreter", {"perl" }}}, { "python", {"python-interpreter", {"python3", "python" }}}, #endif { "python2", {"python2-interpreter", {"python2", "python" }}}, { "ruby", {"ruby-interpreter", {"ruby" }}}, { "shell", {"shell-interpreter", {"sh" }}}, }; -
Search for python3, python is done in script.cpp ->
Glib::find_program_in_path(interpreter_path);. It also searches in the system path (see next comment)// 2. Search for things in the path if they're there or an absolute for (const auto& binname : searchList) { auto interpreter_path = Glib::filename_from_utf8(binname); if (!Glib::path_is_absolute(interpreter_path)) { auto found_path = Glib::find_program_in_path(interpreter_path); if (!found_path.empty()) { return found_path; } } else { return interpreter_path; } -
PATH environment set in
AppRun, also includes system path at the end!export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"while
PYTHON_HOMEis set asexport PYTHONHOME="$HERE/usr/"hence, in #1306 (closed) Inkscape uses
/usr/bin/python3from system with PYTHONHOME in$HERE/usr/and not$HERE/usr/bin/python3.8packed in the AppImage!