binary included in @esbuild/netbsd-arm64 does not actually run on NetBSD-arm64
Closed this issue · 1 comments
Hi all.
I'm working on porting another project to NetBSD that indirectly includes esbuild as a dependency, and I'm working on an arm64 machine. I am aware of the disclaimer saying that Node isn't officially supported on NetBSD etc. etc., but I do not believe this to be a Node issue. The binary itself that's included in the @esbuild/netbsd-arm64 package doesn't run.
Current behavior:
Trying to run the binary included in @esbuild/netbsd-arm64 on a Raspberry Pi 3b+ running the NetBSD 10.0 GENERIC64 evbarm-aarch64 kernel throws the error:
-sh: Cannot execute ELF binary ./esbuild
Compiling esbuild natively on this machine produces a binary that works properly. Node packages that use esbuild work fine on NetBSD-arm64 if I replace the binary installed from npm with one that I compiled myself.
Expected behavior:
The binary in @esbuild/netbsd-arm64 should run on a NetBSD arm64 machine.
Steps to reproduce:
- npm install @esbuild/netbsd-arm64 on a NetBSD 10.0 aarch64 machine (in my case, a Raspberry Pi 3B+)
cd node_modules/\@esbuild/netbsd-arm64/bin
./esbuild --version
My work-around right now is to compile esbuild natively myself and manually replace the binary in node_modules with the one I compiled. This works fine, and the node packages that use esbuild all work fine as well. So, I'm able to get my setup working, but I wanted to report the issue with the binary in the npm package. I don't know how easy of a fix this is especially if it is an issue with the Go cross-compiler itself... But like I said, I wanted to bring it to your attention.
Thanks for the report. This indeed doesn't look correct:
$ file ./npm/@esbuild/netbsd-arm64/bin/esbuild
./npm/@esbuild/netbsd-arm64/bin/esbuild: ELF 64-bit LSB executable, x86-64, version 1 (NetBSD), statically linked, for NetBSD 7.0, Go BuildID=Rs0EJMRp28h1q4N6rGQD/A_y4jcIM37UYXLYQoq2s/2-qqU5OcY009P4e9Jywh/uSXi0Pck0-opSGOnplnI, stripped
That's for x86-64, not for ARM. Sorry that was my mistake (a copy+paste bug). I'll fix this in the next release.