Closed Queuecumber closed 1 year ago
I've traced this and I know what line is failing but I have no idea why it's failing or who's fault it is.
In .xxh/shells/xxh-shell-xonsh/build/xonsh-squashfs
there's a xonsh
script which gets run by entrypoint.sh
This script starts off with a call to "exec" "$(dirname $(readlink -f ${0}))/../../../usr/bin/python3.10" "$0" "$@"
If we follow $(dirname $(readlink -f ${0}))/../../../usr/bin/python3.10
we see this is actually another script
this one calls ${APPDIR}/usr/bin/python3.10 -u "${APPDIR}/opt/python3.10/bin/xonsh" "$@"
${APPDIR}
is constructed from
self="$(readlink -f -- $0)"
here="${self%/*}"
APPDIR="${APPDIR:-${here}}"
which results in APPDIR being set to /home/mehrlich/.xxh/.xxh/shells/xxh-shell-xonsh/build/xonsh-squashfs/usr/bin
so ${APPDIR}/usr/bin/python3.10
becomes /home/mehrlich/.xxh/.xxh/shells/xxh-shell-xonsh/build/xonsh-squashfs/usr/bin/usr/bin/python3.10
with the double /usr/bin
Any ideas what is going on here?
Also a side quesiton: this seems like an incredibly complex process. Is all of this code xxh
or is it mostly dependent libraries. If it is really all xxh
could you speak a bit about what the process is and why it needs to be this complex?
I also encountered this issue and had a look. To me it looks like the file that couldn't be found should be: ./.xxh/shells/xxh-shell-xonsh/build/xonsh-squashfs/opt/python3.10/bin/python3.10
. Also ${APPDIR}/opt/python3.10/bin/xonsh
does not exist but does exist in /.xxh/shells/xxh-shell-xonsh/build/xonsh-squashfs/opt/python3.10/bin/
. So my conclusion is that the value of APPDIR
is indeed set wrong.
The following line from the script will set APPDIR
to here
if it is undefined. So APPDIR
is undefined in the beginning of the execution of this script. Now the question remains if this line is wrong or if APPDIR should be set somewhere before the execution of this script.
APPDIR="${APPDIR:-${here}}"
entrypoint.sh
is calling xonsh
at the last line with the xonshrc.xsh
rc file. This rc file contains logic to set APPDIR
command. But due to xonsh
here being a shell script it won't execute the xonshrc.xsh
immediately. In our case never and should be executed after the error.
This raises the question why the shellscript xonsh
does need to execute the next shell script and not directly the python interpreter itself. If I change the line
$(dirname $(readlink -f ${0}))/../../../usr/bin/python3.10
to
$(dirname $(readlink -f ${0}))/python3.10
Everything works as expected.
Now I still have the questions: where does this file come from? not this repo it seems. and why this difficult construction with multiple shell scripts which have misleading names. Why can't entrypoint.sh
directly call the python interpreter in ./.xxh/shells/xxh-shell-xonsh/build/xonsh-squashfs/opt/python3.10/bin/python3.10
Hi! Thank you for diving in this. Some parts of the process could change during the time so they should be updated. PR is welcome!
I describe the steps to complete understand the process:
(1) xonsh.AppImage was based on python-appimage. For example the entrypoint in AppImage is in data/apprun.sh.
(2) xonsh is using rever to make releases. What we should know:
(3) In case of new xonsh release the Rever runs appimage extension using xonsh rever config and xonsh appimage config and creates xonsh.AppImage and put it to Github release page.
(4) xxh uses build.sh with the xonsh.AppImage url to create xxh-shell-xonsh
(5) When you run xxh host +s xonsh
xxh copies the build directory and then uses entrypoint.sh to setup the environment on the host and run xonsh
(6) During execution the xxh-shell-xonsh uses xonshrc.xsh to complete the environment setup. By default it tend to use the Python from AppImage to run python and pip.
That's all. If you want to test xxh you can use xde - dockerized xxh development environment.
To simplify the process as possible I think you can use xonsh.AppImage without xxh and try to understand how it works in pure way - xonsh docs has the description of how to build xonsh.AppImage manually. Then dive into xxh-shell-xonsh and understand what should be changed.
Thank you for your help!
Thanks for this detailed explanation. The issue seems to be in the xonsh repository. It seems there is an issue with the appimage in the release assets. This file doesn't work. When extracted it exits with the same error.
When I create the apppimage manual and when created with rever on my system, I get different scripts. The difference that stand out and would fix the issue is shown in this image.
(left create by me, right downloaden from github)
I need to make myself more familiar with rever to check which dependencies are different when I create the appimage or when it is done for the xonsh release.
I try to dig a little deeper, and will create an issue in the xonsh repo.
I suppose python-appimage uses entrypoint from appimage/entrypoint.sh.
To make the process faster you can build your own xonsh appimage without rever - it's almost the same as in rever appimage extension (in the extension there is just the python version setting).
I downgraded the xxh-shell-xonsh version to 0.12.4. It looks working.
I upgraded the xxh-shell-xonsh to 0.13.3 because https://github.com/xonsh/xonsh/issues/5007#issuecomment-1337825164
You can check:
xxh +RI xxh-shell-xonsh
xxh host +if +s xonsh
Local OS (where xxh is installed): Arch Destination host OS: Some kind of newer Linux (not under my control) xxh version: 0.8.10 xxh-plugins installed: Unsure
Steps to Reproduce With a fresh xxh install using
pip install xxh-xxh
I get the following error trying to connect to a remote host:Somehow
xxh
is coming up with a weird path for python, note the repeated/usr/bin
:.../usr/bin/usr/bin/python3.10
I can confirm that the remote host has
/usr/bin/python3.10
under the.xxh
directory but of course not/usr/bin/usr
using zsh works so I think this is specific to the xonsh plugin
For community: ⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 comment