OpenBazaar / openbazaar-go

OpenBazaar 2.0 Server Daemon in Go
MIT License
993 stars 283 forks source link

openbazaar-go-linux-arm-5 cannot be executed on BananaPi (armv7l) #1588

Open IzzySoft opened 5 years ago

IzzySoft commented 5 years ago

I just downloaded the arm-5 binary to my BananaPi (armv7l, running Bananian/Debian Jessie). Trying to start it, all I get to see is an error:

$ ls -l
-rwxr--r-- 1 ob ob 59082612 May  2 19:07 openbazaar-go-linux-arm-5
$ ./openbazaar-go-linux-arm-5
bash: ./openbazaar-go-linux-arm-5: No such file or directory

Note that the binary is located in the directory I'm in (as the ls output confirms), and even auto-complete worked for the file name (so it obviously is there). The file is owned by the "current user" and got a chmod 0744 (so the user can execute it). Just to make sure: same happens if I give it 0777, so it's not a permission issue – and it doesn't matter if and what parameters I pass it, same results.

What am I missing here? Did I understand wrong that the binary is the only thing I'd need to download – and simply make it executable and run it? At least that's what this comment by @cpacia suggests.

(side-note: I'm using Gitea (which is also written in Go) on the very same Pi the very same way (i.e. just downloading the binary and running it), though that's an arm-7 binary. But AFAIK ARM is "backward compatible", isn't it?)

IzzySoft commented 5 years ago
$ file openbazaar-go-linux-arm-5
openbazaar-go-linux-arm-5: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0, BuildID[sha1]=3237db6e2e0b9d0009522947224a121ad4515bf8, not stripped

dynamically linked … for GNU/Linux 3.2.0 – could that be the culprit? uname -a gives me "Linux myhost 3.4.108-bananian" on that Pi. No idea how big a statically linked binary would get; gitea is about 30 M so it cannot be that much bigger. I'd give it a try if there were one. For about a week I'd have time for testing, then ends my "grass widower time"… So any chance?

$ ldd openbazaar-go-linux-arm-5
not a dynamic executable

Uh? Didn't it say "dynamically linked"? So against what?

placer14 commented 5 years ago

@IzzySoft Yes, I expect it would work the same as any other ARM-based architecture computer, but I haven't tried it personally. You could try to manually build on the bananapi and see if it executes. The dynamic linking does appear like it could be a problem, considering there are some CGO libraries included for encryption. I don't think there's anything different about the ARM build than the other builds as they are all produced using the same command with the same static build options. Do you have the appetite for trying a local build?

As for whether various ARM architectures are compatible, I would think they would be. But I can't say definitively.

I also don't have a banana pi handy to test with...would a raspi test be sufficient here? I'm unsure of the hardware and OS differences. This is also not an officially supported OS, so I would be patient with us in getting testing around this. I would like to ensure our arm builds work and I appreciate you reporting this problem, at least. Any additional testing you could offer would be helpful. 🍻

IzzySoft commented 5 years ago

@placer14 thanks for responding! I was about to give up…

I've got no build experience, nor any GO experience – so sorry, I cannot do that. Further I wanted to avoid installing the entire GO framework just for a single application.

Yes, I think trying it on a Raspi would be fine – as long as it corresponds to the kernel used on the BananaPi here or links statically instead of dynamically (I suspect Gitea does the latter – though they even provide separate binaries for ARMv5, 6, 7 and 8):

$ uname -a
Linux myhost 3.4.108-bananian #2 SMP PREEMPT Thu Aug 13 06:08:25 UTC 2015 armv7l GNU/Linux

(i.e. link statically or against kernel 3.4). Hardware differences are not that big (in this context); AFAIR I could even install Raspian on the BananaPi (but would lose performance, as Raspian is compiled for ARMv6 while Bananian is optimized for ARMv7).

And yes, give-and-take. It's less about my patience: I can only invest "blocks of time" when I'm "grass widowed", else I lack concentration. But sure I'd give it a try. Currently, I only have the following weekend (and reading between the lines that would be too early for you), so when the new binary is available I might not be able to do a good test immediately – but dropping it in and see if it starts doesn't take too much time. Tears because it delays my getting started with OpenBazaar – I had hoped having it ready a week ago…

IzzySoft commented 5 years ago

Are there any news on this, @placer14? One thing I can confirm meanwhile is that at least armv6 binaries should do fine on the BPi (Gitea had issues with their armv7 builds, so I had to switch to armv6 with that and it worked fine).

Had my BPi updated to Armbian (Debian Buster) meanwhile. So if the dynamic linking is still used here, versions are now even further apart. uname -a on the BPi currently gives

Linux myhost 4.19.62-sunxi #5.92 SMP Wed Jul 31 22:07:23 CEST 2019 armv7l GNU/Linux

running file against the v0.13.5 armv5 binary still says dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0 – so no chance. I probably have a few days again in about a week or two, so I'm asking in advance whether there's a chance now…

placer14 commented 5 years ago

I'm sorry to say that I have not been able to invest time on this. I don't know whether I will be able to in the near future as our work schedule is rather tight. If I find some personal time, I will share my findings.

IzzySoft commented 5 years ago

Thanks a lot!

Btw, in case it helps: other than Bananian (which was tailored for the BananaPis), Armbian should also be available for the RasPi and several other ARM based devices. Which would make such a build available to more than just BananaPi users (and thus might slightly increase the prio :wink:).

IzzySoft commented 3 years ago

Guess I'll have to give up then. Just tried for a last time with the latest release, issue remains the same (though I'm meanwhile on Armbian, based on Debian 10.5) – and no updates for more than a year now. Well, looks like I'm sitting in a niche noone else shares or is interested in.