FrameOS / frameos

Operating system for single function smart frames
https://frameos.net/
Apache License 2.0
322 stars 8 forks source link

No such file: nimassets.nim (Error: unknown CPU: 'x86_64') #7

Closed sowbug closed 6 months ago

sowbug commented 6 months ago

I'm following the setup instructions. I ran into the issue that the controller's generated RSA keys don't work, but I manually worked around it. When I tried to deploy to my RPi 3 Model B with a Waveshare 7.5 display, I got this in the logs:

2024-01-03 20:30:54
Connected via SSH to miket@waveshare75
2024-01-03 20:30:55
- Getting target architecture
2024-01-03 20:30:55
> uname -m
2024-01-03 20:30:55
armv7l
2024-01-03 20:30:56
- Copying build folders
2024-01-03 20:30:56
- Applying local modifications
2024-01-03 20:30:56
- Generating scene: default
2024-01-03 20:30:56
- Generating app: a6e58819-3524-46cf-a0f6-e394a81854cb (unsplash)
2024-01-03 20:30:56
- Creating build archive
2024-01-03 20:30:57
- No cross compilation. Generating source code for compilation on frame.
2024-01-03 20:30:57
$ cd /tmp/tmpsy0pgjpp/frameos && nimble assets -y && nim compile --os:linux --cpu:x86_64 --compileOnly --genScript --nimcache:/tmp/tmpsy0pgjpp/build_wmlmllvponcg src/frameos.nim 2>&1

[...]

2024-01-03 20:32:18
Installing nimassets@0.2.4
2024-01-03 20:32:18
Building nimassets/nimassets using c backend
2024-01-03 20:33:30
Success: nimassets installed successfully.
2024-01-03 20:33:31
Executing task assets in /tmp/tmpsy0pgjpp/frameos/frameos.nimble
2024-01-03 20:33:33
assets/web/index.html ... ok
2024-01-03 20:33:33
assets/fonts/Ubuntu-Regular_1.ttf ... ok
2024-01-03 20:33:34
command line(1, 2) Error: unknown CPU: 'x86_64'. Available options are: i386, m68k, alpha, powerpc, powerpc64, powerpc64el, sparc, vm, hppa, ia64, amd64, mips, mipsel, arm, arm64, js, nimvm, avr, msp430, sparc64, mips64, mips64el, riscv32, riscv64, esp, wasm32, e2k, loongarch64
2024-01-03 20:33:34
/tmp/nimble_56/githubcom_xmonadernimassets_0.2.4/src/nimassets.nim(3, 8) Warning: use the nimble packages `malebolgia`, `taskpools` or `weave` instead; threadpool is deprecated [Deprecated]
2024-01-03 20:33:35
The command exited with status 1
2024-01-03 20:33:35
[Errno 2] No such file or directory: '/tmp/tmpsy0pgjpp/frameos/\x1b[1m/tmp/nimble_56/githubcom_xmonadernimassets_0.2.4/src/nimassets.nim'

As you can see, things go off the rails at Error: unknown CPU: 'x86_64', or maybe earlier when it sends the nim compile --os:linux --cpu:x86_64 command, which doesn't seem to make sense if it's compiling on the rpi for the rpi.

Is this because I am using a Raspberry Pi 3 Model B?

alexrudd2 commented 6 months ago

What do you get when you run uname -a on the Raspberry Pi 3B? I think it will be armv71. You already posted; it is armv7l

Here's a suggested change to the architecture detection code in frameos/backend/apps/tasks/deploy_frame.py

-- if arch == "aarch64":
++ if arch == "aarch64" or arch == "armv7l":
    cpu = "arm64"
elif arch == "armv6l":
    cpu = "arm"
elif arch == "i386":
    cpu = "i386"
else:
    cpu = "x86_64"
sowbug commented 6 months ago

I reimaged with the 64-bit lite OS choice (which I now see the instructions suggested), and uname -m now reports aarch64. I'm still waiting for the setup to complete, but I bet this was the problem.

Unless there's a reason why the other architectures can't work, it would be really nice to be more flexible about them (as I see @alexrudd2 has already done!).

sowbug commented 6 months ago

Aw, heck, and now I just did this:

PXL_20240103_215437215 MP

mariusandra commented 6 months ago

Ouch, that hurts :(.