-
Notifications
You must be signed in to change notification settings - Fork 34
ARM architecture support #4
Comments
+1, ARM support is the only thing stopping me from switching to caxa. |
Sure. It’s a matter of compiling the stub to ARM. I’ll get to it soon… |
Actually I've tried to add flags like GOARCH=arm and GOARM=7 to caxa package.json stubs section but executable is still x86. Looks like it is wrong place |
This works for me:
|
Caxa doesn't hide source code |
@maxb2: Thanks for finding the configurations that work. Do you know what we need to do from Node’s side to detect that we should use these stubs (that is, to detect that we’re in a Raspberry Pi)? @robertsLando: Yes, you’re right. I talked about this in the README briefly. If hiding the source code is a concern for you, then you may obfuscate the code as part of the preparation for packaging. It probably isn’t as good as the V8 snapshot approach used by pkg, but it may be good enough. And if you have suggestions on how to improve on this regard, I’m all ears. |
@leafac this pr includes code for detecting the arch: https://github.com/vercel/pkg-fetch/pull/106/files |
Is it possible, please, to update caxa source code for ARM support, since I changed the caxa`s package.json file with GOOS=linux GOARCH=arm GOARM=7 go build -o linux-armv7 stub.go, but i still get X86 executable? |
I'd use the
(We're working on the same project) |
Hi all, I’m checking in to let you know that I’m still working on this. I took a brief detour to introduce caxa into some of my other projects: https://github.com/leafac/kill-the-newsletter / https://github.com/courselore/courselore. The intent here was to confirm that everything was working and that caxa was production-ready. Everything went very smoothly 🙌 Now I’m back to working in caxa proper, and ARM support is at the top of my priority list. I’ll get back to you when this is ready for testing. I’ll also get a Raspberry Pi myself to test. |
@leafac I have find some time to read all the README. My compliments for all the research behind this project, I tried almost all the solution you listed and I get the same conclusions on all projects. I think that the best one out there ATM is pkg, the only problems are nodejs patches. I love your idea and I will keep an eye on this project, as I mentioned above the main problem in my case is to hide the soruce code, obfuscation could be a way for sure |
@robertsLando could sth like http://peterforgacs.github.io/2018/09/12/How-to-create-a-V8-snapshot-of-your-javascript-file/ work with caxa? |
That would be interesting 🤔 @leafac thoughts? |
I looked into the idea of using V8 snapshots and I think that the way to go would be leverage something like this when it lands. Everything else that I found was either tied to Electron or sounded like too much magic, so things could break too easily. The principle of least surprise is in the DNA of caxa: If it works in development then it should work after packaging. Am I missing something? Is there a simpler way of working with snapshots? |
Just found this wonderful app, the only thing preventing me from using it is armv7 support. Looking forward to when this is done! |
I've been using |
@fcastilloec: Thanks for the nice words. When I have something for you to test I’ll get back in touch. I’ll get to it this week… |
@reqresnext, I made that same change and it worked for me. Maybe you didn't run Before:
|
Here's the output of
Balenalib image list: https://www.balena.io/docs/reference/base-images/base-images-ref/ By the way @leafac, while at it, please add ARM v6 as well. These commands were successful for me:
I don't have a Pi Zero or Pi 1 on my desk to test the v6 stub, but I tested the v7 stub on a Pi 3. The reason why I ask is that the Pi Zero is fairly popular in a category of Pi projects: different form factor (photos), price point, power consumption. I am currently considering using |
I did some investigating with an old Pi 1 and the arm situation is weird.
It seems that cross-compilation produces the correct behavior I made the test the following way:
|
@maxb2, the error message ( This means that the stub was somewhat successfully executed (good news!), perhaps just the test went wrong. The error message goes on to report: I suspect that that directory would normally be created on these lines: But I gather that your test did not include invoking
How did that
|
I'm following the instructions from the readme for manually creating a self-extracting executable.
This was all run on a first generation RPi with an
It was a problem with the compilation command. I wasn't paying enough attention to the quotes 🤦 It should be:
The emulated |
Thank you all for the excellent investigative work. You’re making my life a lot easier 🙌 ARM support will be out this week. I’m excited to have belena use caxa. I’ve used balenaEtcher before and I think you’re doing great work. I’m live-streaming as I work on this, and I’ll be delighted to have you jump in and follow along: |
Why not use
|
However, it's pretty easy to set up an emulated
Where |
@maxb2 I'm was trying to avoid using docker. Docker will always work for any cross-packaging but for less advanced users, docker is a roadblock. |
Any native modules will be architecture specific as well. See this section of the readme. The reason why caxa is so simple is that it relies on the host system to build the project. caxa simply bundles the built app in such a way that it can be easily copied to and run on another compatible host. |
@maxb2 You are right! I'm currently not using any native modules, I totally forgot about them. I do have a couple of docker images set up for building on other platforms, I was hoping not to have to use them. |
Awesome. I was going to look for something like this before I adopted the Regarding specifying a different node executable to package: I’ll get to that later this week. It’ll be an advanced option for when you know that you don’t have native dependencies and you know what you’re doing. |
ARM support is ready for testing. Please grab [email protected] and give a try. The proper 2.0.0 will wait until I fix a couple more bugs; it’ll probably be out by the end of next week. Let me know how it goes. |
@leafac just tested the beta version on my Raspberry Pi 4 (armv7) and everything is working great! |
Thanks for testing! Yep, a fix to #12 will be in 2.0.0 as well… |
Hi all, I’m happy to announce that v2.0.0 is out of beta, including ARM support! (Also, #12 has been fixed.) Enjoy! |
I have Raspberry pi 3 b+ board and I am trying to use caxa on it. I've compiled examples and it shows an error:
bash: ./echo-command-line-parameters: cannot execute binary file: Exec format error
.file ./echo-command-line-parameters
gives an output:ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=ALTTohZDVVCYbbGb20Qi/X-X6HXeYwbH84AVQlSaQ/0RzAyRSxhi0ygj4oAFbv/ywg9-ioLknP7q7VwDKv0, not stripped
Is it possible to create execurable for ARM instead of x86-64?
The text was updated successfully, but these errors were encountered: