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

Raspbian Buster on RaspberryPi 4: ./xonsh: cannot execute binary file: Exec format error #18

Open
jaraco opened this issue Oct 12, 2020 · 5 comments

Comments

@jaraco
Copy link

jaraco commented Oct 12, 2020

Local OS (where xxh is installed): macOS 10.15
Destination host OS: Raspbian Buster
xxh version: 0.8.6
xxh-plugins installed: None (unless homebrew installs them)

Steps to Reproduce

I'm brand new to xxh. Attempting to connect for the first time:

~ $ xxh katsushiro +s xonsh
Create sample config file in /Users/jaraco/.config/xxh/config.xxhc
katsushiro:/home/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh not found. Install xxh-shell-xonsh? [Y/n] 
Install xxh-shell-xonsh to katsushiro:/home/jaraco/.xxh
Install xxh-shell-xonsh to local /Users/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh
Git clone https://github.com/xxh/xxh-shell-xonsh
Build xxh-shell-xonsh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   645  100   645    0     0   2179      0 --:--:-- --:--:-- --:--:--  2171
100 24.9M  100 24.9M    0     0  2038k      0  0:00:12  0:00:12 --:--:-- 3106k
Installed /Users/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh
First time upload using rsync (this will be omitted on the next connections)
First run xxh-shell-xonsh on katsushiro
bash: ./xonsh: cannot execute binary file: Exec format error
mv: cannot stat 'squashfs-root': No such file or directory
ln: failed to create symbolic link 'xonsh': File exists
bash: /home/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh/build/xonsh: cannot execute binary file: Exec format error

I'd previously used xonsh on the target host using pipx and chsh, so there is a xonsh install at ~/.local/bin/xonsh. The user's shell is set to /bin/bash.

I'm on Raspbian Buster on RaspberryPi 4 (ARM).

Suggestions?

For community:
⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@anki-code anki-code transferred this issue from xxh/xxh Oct 13, 2020
@anki-code
Copy link
Member

anki-code commented Oct 13, 2020

Hello @jaraco! Thank you for reporting this!

By default xonsh packed in AppImage app. And the error (bash: ./xonsh: cannot execute binary file: Exec format error) looks like that AppImage extraction (./xonsh --appimage-extract) is not working on Raspbian Buster.

I suggest to try alternative way - standard tar packing:

xxh +R xxh-shell-xonsh +I https://github.com/anki-code/xxh-shell-xonsh-zip  # repack AppImage to `tar.bzip2`
xxh +L
# Returns: xxh-shell-xonsh-zip

# Try to connect with reinstalling packages:
xxh katsushiro +if +s xonsh-zip # option `+if` is needed once to reinstall xxh packages

# Next time connection:
xxh katsushiro +s xonsh-zip

If it works for you I'll patch the xxh-shell-xonsh and +s xonsh-zip will not needed.

@anki-code anki-code changed the title Exec format error (Raspbian) Raspbian Buster on RaspberryPi 4: ./xonsh: cannot execute binary file: Exec format error Oct 13, 2020
@jaraco
Copy link
Author

jaraco commented Nov 7, 2020

Hi anki-code. Sorry it took some time to get around to this, but I'm looping back on it. Unfortunately, xonsh-zip also seems to encounter a similar error:

~ $ xxh +R xxh-shell-xonsh +I https://github.com/anki-code/xxh-shell-xonsh-zip
Install https://github.com/anki-code/xxh-shell-xonsh-zip to local /Users/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh-zip
Git clone https://github.com/anki-code/xxh-shell-xonsh-zip
Build xxh-shell-xonsh-zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   146  100   146    0     0    646      0 --:--:-- --:--:-- --:--:--   643
100 22.3M  100 22.3M    0     0  4932k      0  0:00:04  0:00:04 --:--:-- 5933k
Installed /Users/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh-zip
Remove xxh-shell-xonsh
Removed /Users/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh
~ $ xxh +L
xxh-shell-xonsh-zip
~ $ xxh katsushiro +if +s xonsh-zip
Install xxh-shell-xonsh-zip to katsushiro:/home/jaraco/.xxh
Remove katsushiro:/home/jaraco/.xxh/.xxh
First time upload using rsync (this will be omitted on the next connections)
First run xxh-shell-xonsh-zip on katsushiro
/home/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh-zip/build/xonsh: 2: exec: /home/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh-zip/build/xonsh-squashfs/opt/python3.8/bin/../../../usr/bin/python3.8: Exec format error

I notice that python3.8 is indicated there, but Python 3.8 isn't installed. This host has 3.6, 3.7, and 3.9 installed. Are there prerequisite steps before attempting to xxh with xonsh?

@anki-code
Copy link
Member

anki-code commented Nov 7, 2020

Hi jaraco!

We're using xonsh AppImage that contain both python3.8 and package (xonsh and requirements). The xxh is not using python from host. What I was done to create xonsh-zip is I repacked AppImage to zip archive because I thought that the error about exec format refer to AppImage. But now we see that the error refer to python3.8 that packed in archive.

The AppImage was built with python-appimage on manylinux image. The libraries from this image cover many of Linux distributes. But in case with Raspbian Buster we see an error. This means that we should build AppImage and xxh-shell for this platform i.e. xxh-shell-xonsh-raspbian-buster.

Sorry but I have no manual how to do it but I believe it's achievable by diving into python-appimage. Also it may be easy if there is a way to replace manylinux to Debian Raspbian Buster docker container.

PS: you can put in this issue a bit more info if do ldd /home/jaraco/.xxh/.xxh/shells/xxh-shell-xonsh-zip/build/xonsh-squashfs/opt/python3.8/bin/../../../usr/bin/python3.8 on the remote host.

@jaraco
Copy link
Author

jaraco commented Nov 8, 2020

Aha. I see. The issue is probably then that Raspbian (by virtue of being on RaspberryPi) is compiled for ARM64, so doesn't yet have manylinux support. I don't recall who referred me to xxh as a way to work around issues with xonsh on Raspbian, but it looks like there's a whole suite of supporting services that will need to mature before xxh can support this platform. I suggest to flag this as won't fix. Sorry for the distraction. Still, I'm glad to know about xxh.

@jaraco jaraco closed this as completed Nov 8, 2020
@anki-code
Copy link
Member

anki-code commented Nov 8, 2020

Got it! I'm going to reopen issue because it's not solved. Thanks!

@anki-code anki-code reopened this Nov 8, 2020
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

2 participants