arduino-ide icon indicating copy to clipboard operation
arduino-ide copied to clipboard

As a user I want to run the Arduino IDE on both armhf and arm64 arches

Open kittaakos opened this issue 3 years ago • 37 comments

Describe the request

I want to run Arduino IDE on my Raspberry Pi with arm7vl and aarch64 (aka. arm64) arches.

Describe the current behavior

Official Arduino IDE 2.x Linux builds are only available for the x86 architecture.

Arduino IDE version

afb02da8063d7e130bd1a5fd03f16c12bdad0ec7

Operating system

Linux

Operating system version

All

Additional context

Additional requests

  • https://github.com/arduino/arduino-ide/issues/1824
  • https://github.com/arduino/arduino-ide/issues/707
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-656793555
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-817230054
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-997924030
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-1001045293
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-1250173716
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-1292443073
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-1304591099
  • https://github.com/arduino/arduino-ide/issues/107#issuecomment-1367755636
  • https://github.com/arduino/arduino-pro-ide/issues/28
  • https://github.com/flathub/cc.arduino.IDE2/issues/54
  • https://forum.arduino.cc/t/ide-on-raspberry-gives-compile-errors/1045041/7
  • https://forum.arduino.cc/t/best-way-to-get-ide-arm64-builds/1063918/1
  • https://forum.arduino.cc/t/best-way-to-get-ide-arm64-builds/1063918/3
  • https://forum.arduino.cc/t/best-way-to-get-ide-arm64-builds/1063918/4
  • https://forum.arduino.cc/t/ide-2-0-x-will-not-install/1050074
  • https://forum.arduino.cc/t/arduino-ide-2-0-not-installing-try-this-raspberrypi-4-arm/1035632
  • https://forum.arduino.cc/t/install-2-2-on-rasberry-pi-4-raspberry-pi-64bit-os/1034417
  • https://forum.arduino.cc/t/upload-error-to-nodemcu/921869/8
  • https://forum.arduino.cc/t/ide-2-0-amazing-arm-builds-anytime/701303
  • https://forum.arduino.cc/t/ide-2-0-working-perfect-on-mac-os-10-15-7-when-will-raspi-4-version-be-availabl/700049
  • https://forum.arduino.cc/t/ide-2-04-for-linux-not-installing/1108106
  • https://forum.arduino.cc/t/ide-2-2-1-for-linux-arm-64-bit/1174109
  • https://forum.arduino.cc/t/install-ide-2-on-rpi-4-buster-os/1197628
  • https://forum.arduino.cc/t/compile-needs-a-rebuild-to-load-ttgo-lora32esp/1204091
  • https://forum.arduino.cc/t/ide-2-2-1-for-linux-arm-64-bit/1174109/3
  • https://forum.arduino.cc/t/ide-compatibility-with-raspberry-pi-5/1212072
  • https://forum.arduino.cc/t/status-of-official-ide-2-x-builds-for-linux-arm64/1222354
  • https://forum.arduino.cc/t/arduino-ide-1-8-19-not-starting-on-raspberry-pi/1241988
  • https://forum.arduino.cc/t/nano-esp32-rgbled-flashing-sketch-not-working/1247194/9

Issue checklist

  • [X] I searched for previous requests in the issue tracker
  • [X] I verified the feature was still missing when using the latest nightly build
  • [X] My request contains all necessary details

kittaakos avatar Jul 08 '20 08:07 kittaakos

I second this, ARM computers are getting more popular these days. I want to be able to run the Pro IDE on my Nintendo Switch over Linux (not joking).

lordfriky avatar Jul 10 '20 17:07 lordfriky

Originally by @K4ktus123 from here:

Is there going to be a version for Linux on 32bit ARM? And if yes, when will it be released?

kittaakos avatar Sep 03 '20 12:09 kittaakos

Does anyone know when the Linux ARM IDE 2.0 is going to be released? Thank y'all!

g3holliday avatar Apr 11 '21 01:04 g3holliday

FYI: https://github.com/koendv/arduino-ide-raspberrypi

koendv avatar May 13 '21 05:05 koendv

thank you per1234 for pointing out an existing thread for my first paragraph. have you got any reply regarding what I asked? also, please consider the combined repo which could serve as a temporary substitute for the missing release

When will you release ide2 for arm linuxes? Are golang or node js tied to only x86/x64? Nope! LLVM or GCC? Nope! Typescript? Nope! So which could be the reason for not officialy releasing ide2 for linux/arm? If it has been released for linux/pc, which could be the everest class obstacle for not have been released for linux/arm in the same manner?

Also, if one tries to build the ide2 piece by piece, (s)he'll need lots of stuff as I'm beginning to see, both yours and external. Fellow devs, can you at least gather all these ingredients in one combined repo with a build script of some sort in front so that - someone could at least try to build your ide offline?

abusr avatar Dec 20 '21 13:12 abusr

So which could be the reason for not officialy releasing ide2 for linux/arm

clangd is not available on ARM if I am not mistaken: https://github.com/clangd/clangd/issues/514

build script

I used to run these scripts to verify the IDE when building from the sources on Linux and Raspberry pi 4:

  • https://github.com/arduino/arduino-ide/blob/main/docs/internal/Ubuntu.md
  • https://github.com/arduino/arduino-ide/blob/main/docs/internal/Arm.md

The versions (Node.js, yarn, etc) could be outdated 👆

kittaakos avatar Dec 20 '21 16:12 kittaakos

When will you release ide2 for arm linuxes?

If you want Arduino IDE 2 for 64-bit Raspberry Pi OS, you can download an AppImage from my git https://github.com/koendv/arduino-ide-raspberrypi/ Building for 32-bit is more complicated.

koen

koendv avatar Dec 20 '21 19:12 koendv

Thank you all for the replies!

kitaakos, since koendv has managed to build the ide and release an appimage, things might have got better since 2020. could you please check again? I remember checking out llvm from git and building it all inside my arm tvbox without other problems except the amount virtual memory I had to provide. I'm no expert in llvm but I see a clangd directory right under clang-tools-extra, I guess it has compiled as well. koendv, can you confirm compilation of clangd for kitaakos?

Whatever the case, even without clangd and the language server, the rest of the ide would still be pretty usable. I'd love to see it running inside the tiny tvbox. :p

And - apart from the arduinos - theia looks promising and for other uses in the future. I really liked this ide from the start dunno why!

abusr avatar Dec 21 '21 08:12 abusr

On Tue, 21 Dec 2021 00:21:14 -0800 Nat @.***> wrote:

Thank you all for the replies!

kitaakos, since koendv has managed to build the ide and release an appimage, things might have got better since 2020. could you please check again? I remember checking out llvm from git and building it all inside my arm tvbox without other problems except the amount virtual memory I had to provide. I'm no expert in llvm but I see a clangd directory right under clang-tools-extra, I guess it has compiled as well. koendv, can you confirm compilation of clangd for kitaakos?

Yes, clangd compiles. At the git I mentioned you will find pre-built binaries for clangd and arduino-language-server; and

https://github.com/koendv/arduino-ide-raspberrypi/blob/main/README-DEVELOPER.md

documents the build process. Everything is natively built on a 8gb raspberry 4b. I haven't automated the process because at one point I need to copy a file by hand:

https://github.com/arduino/arduino-ide/issues/686

but apart from that it's simple.

kitaakos,

if there's a question just open an issue at my git, and we'll build rc3 for 64-bit raspberry together, ok?

best,

koen

koendv avatar Dec 21 '21 12:12 koendv

I need to copy a file by hand: #686

It should not be required. I did this before, and it was not needed. The only bottleneck was clangd and an armhf/arm64 node to build on. I do not know if it is possible now, but there was no way to use a non-self-hosted node for the GitHub Actions to build for armhf/arm64.

we'll build rc3 for 64-bit raspberry together

I can help with the build steps. Feel free to name me in your repo. I try to build it locally on my Pi first.

kittaakos avatar Dec 22 '21 11:12 kittaakos

Uploaded appimage of 2.0.0-rc3.

koendv avatar Dec 22 '21 19:12 koendv

Is there a date of the lunch for arm32?

jack07Code avatar Dec 25 '21 17:12 jack07Code

On Sat, 25 Dec 2021 09:03:26 -0800 jack07Code @.***> wrote:

There is a date of the lunch for arm32?

Today, a 32-bit processor is the target, not the host.

koen

koendv avatar Dec 26 '21 18:12 koendv

So which could be the reason for not officialy releasing ide2 for linux/arm?

Firmware uploader?

arduino-ide-extension: $ node ./scripts/download-fwuploader.js
arduino-ide-extension: 📦  Identified released version of the Firmware Uploader. Downloading version 2.0.0 from 'https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.0.0_Linux_ARMv7.tar.gz'
arduino-ide-extension: >>> Downloading from 'https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.0.0_Linux_ARMv7.tar.gz'...
arduino-ide-extension: HTTPError: Response code 404 (Not Found)
arduino-ide-extension: error Command failed with exit code 1.
arduino-ide-extension: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
arduino-ide-extension: error Command failed with exit code 1.

Update:

There is a release on GH but the download link is fore sure 404 on my side. The release is here: https://github.com/arduino/arduino-fwuploader/releases/tag/2.0.0

I will check if it is a download URL building issue or the asset was not copied to the S3 bucket.


Update2: Yes, it is a bug. The link should be https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.0.0_Linux_ARMv7.tar.gz.


Update3: The tests fail on armhf:

arduino-ide-extension: $ mocha "./lib/test/**/*.test.js"
arduino-ide-extension: 
arduino-ide-extension:   Monitor Utils
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:     when converting messages
arduino-ide-extension:       ✓ should give the right result
arduino-ide-extension:   boards-service
arduino-ide-extension:     AttachedBoardsChangeEvent
arduino-ide-extension:       ✓ should detect one attached port
arduino-ide-extension:   installable
arduino-ide-extension:     compare
arduino-ide-extension:       ✓ '1.8.1' should be equal to '1.8.1'
arduino-ide-extension:       ✓ '1.8.1' should be greater than '1.6.1'
arduino-ide-extension:       ✓ '1.6.1' should be less than '1.8.1'
arduino-ide-extension:       ✓ '1.6.1' should be less than '1.6.3'
arduino-ide-extension:       ✓ '5.1.1' should be greater than '5.1.0'
arduino-ide-extension:       ✓ '5.1.0' should be greater than '5.1.0-beta.1'
arduino-ide-extension:       ✓ '5.1.0-beta.1' should be less than '5.1.0'
arduino-ide-extension:       ✓ '5.1.0-beta.2' should be greater than '5.1.0-beta.1'
arduino-ide-extension:       ✓ '5.1.0-beta.1' should be less than '5.1.0-beta.2'
arduino-ide-extension:       ✓ '5.1.0-beta.1' should be less than '5.1.1'
arduino-ide-extension:       ✓ '1.1.0' should be greater than '1.1.0-a'
arduino-ide-extension:       ✓ '1.1.0-a' should be less than '1.1.0'
arduino-ide-extension:       ✓ 'COM1' should be less than 'COM2'
arduino-ide-extension:       ✓ 'COM1' should be less than 'COM10'
arduino-ide-extension:       ✓ 'COM10' should be greater than 'COM1'
arduino-ide-extension:       ✓ 'COM10' should be greater than 'COM2'
arduino-ide-extension:       ✓ 'COM2' should be less than 'COM10'
arduino-ide-extension:       ✓ 'COM10' should be equal to 'COM10'
arduino-ide-extension:   arduino-daemon-impl
arduino-ide-extension:     1) should parse the port address when the log format is json
arduino-ide-extension:     2) should parse the port address when the log format is text
arduino-ide-extension:   cli-config
arduino-ide-extension:     ✓ {"board_manager":{"additional_urls":[]},"daemon":{"port":5000},"directories":{"data":"data","downloads":"downloads","user":"user"}} should be the same as {"board_manager":{"additional_urls":[]},"daemon":{"port":5000},"directories":{"data":"data","downloads":"downloads","user":"user"}}
arduino-ide-extension:     ✓ {"daemon":{"port":5000},"directories":{"data":"data","downloads":"downloads","user":"user"}} should be the same as {"board_manager":{"additional_urls":[]},"daemon":{"port":5000},"directories":{"data":"data","downloads":"downloads","user":"user"}}
arduino-ide-extension:     ✓ {"board_manager":{"additional_urls":[]},"daemon":{"port":"5000"},"directories":{"data":"data","downloads":"downloads","user":"user"}} should be the same as {"board_manager":{"additional_urls":[]},"daemon":{"port":5000},"directories":{"data":"data","downloads":"downloads","user":"user"}}
arduino-ide-extension:   getExecPath
arduino-ide-extension:     ✓ should resolve arduino-cli (1778ms)
arduino-ide-extension:     ✓ should resolve arduino-language-server
arduino-ide-extension: Error: Error executing "/home/pi/dev/git/arduino-ide/electron/working-copy/arduino-ide-extension/build/bin/clangd" --version: /bin/sh: 1: /home/pi/dev/git/arduino-ide/electron/working-copy/arduino-ide-extension/build/bin/clangd: Exec format error
arduino-ide-extension:     at ChildProcess.<anonymous> (/home/pi/dev/git/arduino-ide/electron/working-copy/arduino-ide-extension/lib/node/exec-util.js:53:31)
arduino-ide-extension:     at ChildProcess.emit (events.js:314:20)
arduino-ide-extension:     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
arduino-ide-extension:     3) should resolve clangd
arduino-ide-extension:   SerialServiceImpl
arduino-ide-extension:     when a serial connection is requested
arduino-ide-extension:       and an upload is in progress
arduino-ide-extension:         ✓ should not change the connection status
arduino-ide-extension:       and there is no upload in progress
arduino-ide-extension:         and there are 0 attached ws clients
arduino-ide-extension:           ✓ should disconnect
arduino-ide-extension:         and there are > 0 attached ws clients
arduino-ide-extension:           ✓ should not call the disconenct
arduino-ide-extension:     when a disconnection is requested
arduino-ide-extension:       and a serialConnection is not set
arduino-ide-extension:         ✓ should return a NOT_CONNECTED status
arduino-ide-extension:       and a serialConnection is set
arduino-ide-extension:         ✓ should dispose the serialConnection
arduino-ide-extension:         ✓ should call updateWsConfigParam with disconnected status
arduino-ide-extension:     when a new config is passed in
arduino-ide-extension:       ✓ should disconnect from previous connection
arduino-ide-extension:       ✓ should create the serialConnection
arduino-ide-extension:   39 passing (3s)
arduino-ide-extension:   3 failing
arduino-ide-extension:   1) arduino-daemon-impl
arduino-ide-extension:        should parse the port address when the log format is json:
arduino-ide-extension:      Error: panic: unaligned 64-bit atomic operation
arduino-ide-extension: goroutine 1 [running]:
arduino-ide-extension:       at Socket.<anonymous> (lib/node/arduino-daemon-impl.js:185:42)
arduino-ide-extension:       at addChunk (_stream_readable.js:297:12)
arduino-ide-extension:       at readableAddChunk (_stream_readable.js:272:9)
arduino-ide-extension:       at Socket.Readable.push (_stream_readable.js:213:10)
arduino-ide-extension:       at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
arduino-ide-extension: 
arduino-ide-extension:   2) arduino-daemon-impl
arduino-ide-extension:        should parse the port address when the log format is text:
arduino-ide-extension:      Error: panic: unaligned 64-bit atomic operation
arduino-ide-extension: goroutine 1 [running]:
arduino-ide-extension:       at Socket.<anonymous> (lib/node/arduino-daemon-impl.js:185:42)
arduino-ide-extension:       at addChunk (_stream_readable.js:297:12)
arduino-ide-extension:       at readableAddChunk (_stream_readable.js:272:9)
arduino-ide-extension:       at Socket.Readable.push (_stream_readable.js:213:10)
arduino-ide-extension:       at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
arduino-ide-extension: 
arduino-ide-extension:   3) getExecPath
arduino-ide-extension:        should resolve clangd:
arduino-ide-extension:      Error: Error executing "/home/pi/dev/git/arduino-ide/electron/working-copy/arduino-ide-extension/build/bin/clangd" --version: /bin/sh: 1: /home/pi/dev/git/arduino-ide/electron/working-copy/arduino-ide-extension/build/bin/clangd: Exec format error
arduino-ide-extension:       at ChildProcess.<anonymous> (lib/node/exec-util.js:53:31)
arduino-ide-extension:       at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
arduino-ide-extension: 
arduino-ide-extension: error Command failed with exit code 3.

kittaakos avatar Dec 27 '21 13:12 kittaakos

I could build it from the sources after fixing the packager here and there, but the CLI daemon does not start. Maybe that is causing the test failures :point_up_2:

electron-build part:

  • electron-builder  version=22.7.0 os=4.19.118-v7l+
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=@theia/[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
                                    platform=linux
                                    arch=armv7l
  • install prebuilt binary  name=keytar version=7.2.0 platform=linux arch=armv7l
  • install prebuilt binary  name=drivelist version=9.2.4 platform=linux arch=armv7l
  • build native dependency from sources  name=keytar
                                          version=7.2.0
                                          platform=linux
                                          arch=armv7l
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 6.1.1
    prebuild-install WARN install prebuilt binaries enforced with --force!
    prebuild-install WARN install prebuilt binaries may be out of date!
    prebuild-install info looking for local prebuild @ prebuilds/keytar-v7.2.0-electron-v80-linux-armv7l.tar.gz
    prebuild-install info looking for cached prebuild @ /home/pi/.npm/_prebuilds/4d2fa7-keytar-v7.2.0-electron-v80-linux-armv7l.tar.gz
    prebuild-install http request GET https://github.com/atom/node-keytar/releases/download/v7.2.0/keytar-v7.2.0-electron-v80-linux-armv7l.tar.gz
    prebuild-install http 404 https://github.com/atom/node-keytar/releases/download/v7.2.0/keytar-v7.2.0-electron-v80-linux-armv7l.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=9.4.4 runtime=electron arch=armv7l libc= platform=linux)
    
  • build native dependency from sources  name=drivelist
                                          version=9.2.4
                                          platform=linux
                                          arch=armv7l
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 6.1.1
    prebuild-install WARN install prebuilt binaries enforced with --force!
    prebuild-install WARN install prebuilt binaries may be out of date!
    prebuild-install info looking for local prebuild @ prebuilds/drivelist-v9.2.4-electron-v80-linux-armv7l.tar.gz
    prebuild-install info looking for cached prebuild @ /home/pi/.npm/_prebuilds/46cc15-drivelist-v9.2.4-electron-v80-linux-armv7l.tar.gz
    prebuild-install http request GET https://github.com/balena-io-modules/drivelist/releases/download/v9.2.4/drivelist-v9.2.4-electron-v80-linux-armv7l.tar.gz
    prebuild-install http 404 https://github.com/balena-io-modules/drivelist/releases/download/v9.2.4/drivelist-v9.2.4-electron-v80-linux-armv7l.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=9.4.4 runtime=electron arch=armv7l libc= platform=linux)
    
  • rebuilding native dependency  name=drivelist version=9.2.4
  • rebuilding native dependency  name=@theia/node-pty version=0.9.0-theia.6
  • rebuilding native dependency  name=find-git-repositories version=0.1.3
  • rebuilding native dependency  name=grpc version=1.24.11
  • rebuilding native dependency  name=keytar version=7.2.0
  • rebuilding native dependency  name=native-keymap version=2.2.1
  • rebuilding native dependency  name=nsfw version=2.1.2
  • rebuilding native dependency  name=oniguruma version=7.2.1
  • packaging       platform=linux arch=armv7l electron=9.4.4 appOutDir=dist/linux-armv7l-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-linux-armv7l.zip size=63 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v9.4.4/electron-v9.4.4-linux-armv7l.zip duration=36.353s
  • asar usage is disabled — this is strongly not recommended  solution=enable asar and use asarUnpack to unpack files that must be externally available
Skipping notarization: not on CI.
  • building        target=zip arch=armv7l file=dist/arduino-ide_2.0.0-rc3-snapshot.51da3c0_Linux_ARMv7.zip

One can see, drivelist is rebuilt, so no need to manually copy anything.

The arduino-cli daemon start error from the packaged IDE:

daemon INFO Executing `arduino-cli daemon`
daemon INFO Setting up Prometheus metrics on :9090/metrics
daemon INFO panic: unaligned 64-bit atomic operation
daemon INFO goroutine 1 [running]:
daemon INFO runtime/internal/atomic.panicUnaligned()
daemon INFO     /usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
daemon INFO runtime/internal/atomic.Xadd64(0x103ed9c, 0x1, 0x0, 0x6, 0x9a91e9)
daemon INFO     /usr/local/go/src/runtime/internal/atomic/asm_arm.s:233 +0x14
daemon INFO github.com/segmentio/stats/v4/prometheus.(*Handler).HandleMeasures(0x103ed88, 0xc4863a2, 0xc06a9328, 0x292a945, 0x0, 0x103edc0, 0x1e1fe20, 0x1, 0x1)
daemon INFO     /go/pkg/mod/github.com/segmentio/stats/[email protected]/prometheus/handler.go:96 +0x1c8
daemon INFO github.com/segmentio/stats/v4.(*Engine).measure(0x1e1fd80, 0xc4863a2, 0xc06a9328, 0x292a945, 0x0, 0x103edc0, 0x0, 0x0, 0x8a6908, 0xa61d0c, ...)
daemon INFO     /go/pkg/mod/github.com/segmentio/stats/[email protected]/engine.go:155 +0x2cc
daemon INFO github.com/segmentio/stats/v4.(*Engine).Add(0x1e1fd80, 0x9a91e9, 0x6, 0x8a6908, 0xa61d0c, 0x1d97e6c, 0x1, 0x1)
daemon INFO     /go/pkg/mod/github.com/segmentio/stats/[email protected]/engine.go:94 +0x78
daemon INFO github.com/segmentio/stats/v4.(*Engine).Incr(...)
daemon INFO     /go/pkg/mod/github.com/segmentio/stats/[email protected]/engine.go:84
daemon INFO github.com/segmentio/stats/v4.Incr(...)
daemon INFO     /go/pkg/mod/github.com/segmentio/stats/[email protected]/engine.go:251
daemon INFO github.com/arduino/arduino-cli/cli/daemon.runDaemonCommand(0x1e34000, 0x1e39220, 0x0, 0x9)
daemon INFO     /home/build/cli/daemon/daemon.go:75 +0xc80
daemon INFO github.com/spf13/cobra.(*Command).execute(0x1e34000, 0x1e39180, 0x9, 0xa, 0x1e34000, 0x1e39180)
daemon INFO     /go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x1f4
daemon INFO github.com/spf13/cobra.(*Command).ExecuteC(0x1cc1b80, 0x1, 0x1, 0x0)
daemon INFO     /go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x280
daemon INFO github.com/spf13/cobra.(*Command).Execute(...)
daemon INFO     /go/pkg/mod/github.com/spf13/[email protected]/command.go:902
daemon INFO main.main()
daemon INFO     /home/build/main.go:31 +0xc0
daemon INFO Failed to start the daemon.
daemon ERROR Error: panic: unaligned 64-bit atomic operation

The bundled CLI arch seems OK, I can get the version:

~/dev/git/arduino-ide $ ./electron/build/dist/linux-armv7l-unpacked/resources/app/node_modules/arduino-ide-extension/build/arduino-cli version
arduino-cli  Version: 0.20.2 Commit: 13783819 Date: 2021-12-09T13:32:05Z

Required code changes to package the IDE on my pi:

diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json
index f1e56c4..089158e 100644
--- a/arduino-ide-extension/package.json
+++ b/arduino-ide-extension/package.json
@@ -15,7 +15,7 @@
     "lint": "eslint",
     "build": "tsc && ncp ./src/node/cli-protocol/ ./lib/node/cli-protocol/ && yarn lint",
     "watch": "tsc -w",
-    "test": "mocha \"./lib/test/**/*.test.js\"",
+    "test": "echo TESTS",
     "test:watch": "mocha --watch --watch-files lib \"./lib/test/**/*.test.js\""
   },
   "dependencies": {
diff --git a/arduino-ide-extension/scripts/download-fwuploader.js b/arduino-ide-extension/scripts/download-fwuploader.js
index 4c13b62..d177e0e 100755
--- a/arduino-ide-extension/scripts/download-fwuploader.js
+++ b/arduino-ide-extension/scripts/download-fwuploader.js
@@ -52,7 +52,7 @@
         case 'linux': {
           switch (arch) {
             case 'arm':
-              return 'Linux_ARMv7.tar.gz';
+              return 'Linux_ARM.tar.gz';
             case 'arm64':
               return 'Linux_ARM64.tar.gz';
             case 'x64':
diff --git a/electron/packager/index.js b/electron/packager/index.js
index 32a5295..e9ff2aa 100644
--- a/electron/packager/index.js
+++ b/electron/packager/index.js
@@ -8,7 +8,7 @@
     const glob = require('glob');
     const isCI = require('is-ci');
     shell.env.THEIA_ELECTRON_SKIP_REPLACE_FFMPEG = '1'; // Do not run the ffmpeg validation for the packager.
-    shell.env.NODE_OPTIONS = '--max_old_space_size=4096'; // Increase heap size for the CI
+    shell.env.NODE_OPTIONS = '--max_old_space_size=2084'; // Increase heap size for the CI
     shell.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = 'true'; // Skip download and avoid `ERROR: Failed to download Chromium`.
     const template = require('./config').generateTemplate(new Date().toISOString());
     const utils = require('./utils');
@@ -103,12 +103,12 @@
     //-------------------------------------------------------------------------------------------------+
     // Rebuild the extension with the copied `yarn.lock`. It is a must to use the same Theia versions. |
     //-------------------------------------------------------------------------------------------------+
-    exec(`yarn --network-timeout 1000000 --cwd ${path('..', workingCopy)}`, `Building the ${productName} application`);
+    exec(`yarn --no-optional --network-timeout 1000000 --cwd ${path('..', workingCopy)}`, `Building the ${productName} application`);
 
     //-------------------------------------------------------------------------------------------------------------------------+
     // Test the application. With this approach, we cannot publish test results to GH Actions but save 6-10 minutes per builds |
     //-------------------------------------------------------------------------------------------------------------------------+
-    exec(`yarn --network-timeout 1000000 --cwd ${path('..', workingCopy)} test`, `Testing the ${productName} application`);
+    exec(`yarn --no-optional --network-timeout 1000000 --cwd ${path('..', workingCopy)} test`, `Testing the ${productName} application`);
 
     // Collect all unused dependencies by the backend. We have to remove them from the electron app.
     // The `bundle.js` already contains everything we need for the frontend.
@@ -193,7 +193,8 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
     //-----------------------------------+
     // Package the electron application. |
     //-----------------------------------+
-    exec(`yarn --network-timeout 1000000 --cwd ${path('..', 'build')} package`, `Packaging your ${productName} application`);
+    const arch = process.platform === 'linux' && process.arch === 'arm' ? ' --armv7l' : '';
+    exec(`yarn --network-timeout 1000000 --cwd ${path('..', 'build')} package${arch}`, `Packaging your ${productName} application`);
 
     //-----------------------------------------------------------------------------------------------------+
     // Copy to another folder. Azure does not support wildcard for `[email protected]` |

  • decreased the heap size (https://github.com/shelljs/shelljs/issues/1024)
  • use specific electron target on arm (https://github.com/electron/electron/issues/6055)
  • make grpc-node optional (https://github.com/grpc/grpc-node/issues/1497)
  • fixed the firmware updater download link
  • "disabled" the tests (probably a cli problem)

kittaakos avatar Dec 27 '21 15:12 kittaakos

The arduino-cli daemon start error from the packaged IDE:

I found it. Related: https://github.com/arduino/arduino-cli/issues/820

kittaakos avatar Dec 27 '21 15:12 kittaakos

It should be running happily and from the start at least where the old ide was already running. No other comments.

abusr avatar Mar 04 '22 07:03 abusr

To compile 2.0.0-rc4 on aarch64 I have had to add this small patch arduino-ide-patch.txt

arduino-language-server and clangd compile on raspberry 'as is', just like on any other debian. As a small step forward, I suggest adding Linux_ARM64 builds for arduino-language-server and clangd to downloads.arduino.cc.

koendv avatar Mar 04 '22 08:03 koendv

arduino-ide binaries for raspberry are now built using github actions, the same build process as for X86.

koendv avatar Jun 09 '22 13:06 koendv

Hi @koendv would you mind opening a PR to this repo? Having aarch64 build for raspberry Pi would be amazing.

umbynos avatar Jul 08 '22 10:07 umbynos

fixed the firmware updater download link

@kittaakos when you have some time, could you please add some context to this? I'm not sure if I understand the problem

umbynos avatar Sep 05 '22 09:09 umbynos

I'm not sure if I understand the problem

From here:

  • fixed the firmware updater download link

The IDE2 is trying to download an artifact for ARM 32-bit with the following name:

https://github.com/arduino/arduino-ide/blob/4907ef2a478034d0b9f9436e15988a1833768c3d/arduino-ide-extension/scripts/download-fwuploader.js#L54-L55

But there is no such artifact, it should be 'Linux_ARM.tar.gz'.

https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_Linux_ARMv7.tar.gz is an HTTP 404:

Screen Shot 2022-09-05 at 11 55 23

The correct link is https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_Linux_ARM.tar.gz.

I hope this helps.

kittaakos avatar Sep 05 '22 09:09 kittaakos

Ok, so it's a matter of changing the download link from https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_Linux_ARM.tar.gz to https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.0_Linux_ARMv7.tar.gz right? If so I already this the work and the arduino-fwuploader only needs a release :sparkles:

umbynos avatar Sep 05 '22 10:09 umbynos

Looking forward to the arm build!

jtheck avatar Sep 18 '22 02:09 jtheck

Not sure if anyone was aware but it is now working. I have had problems with it for the last month. The GITHUB for RPI4 worked for me but you needed the _zip.zip located in the releases page. After extracting arduino-ide-2.0_ARM64 and again for the folders itself reboot before attempting to run the ./arduino-ide command. File: Here Semi detailed instructions on how I got it to work on Kali 64 and Raspbian Bullseye 64 without trouble: Here

HellToFire avatar Sep 25 '22 21:09 HellToFire

On Fri, 08 Jul 2022 03:07:42 -0700 Umberto Baldi @.***> wrote:

Hi @koendv would you mind opening a PR to this repo? Having aarch64 build for raspberry Pi would be amazing.

OK. I'll do that.

regards,

koen

koendv avatar Oct 11 '22 09:10 koendv

@kittaakos this has been fixed in the latest release of the Arduino Fwuploader. Now downloading from https://downloads.arduino.cc/arduino-fwuploader/arduino-fwuploader_2.2.1_Linux_ARMv7.tar.gz should work

umbynos avatar Oct 11 '22 10:10 umbynos

Hi all,

Really looking forward to being able to run 2.0 on my Pi400.

Any idea when an official release might happen?

Thanks!

elgerg avatar Oct 26 '22 18:10 elgerg

I am hoping armv8 arm64 linux is also coming. Looks like a commit was made for armv7 32bit linux

posting for notifications.

theofficialgman avatar Nov 05 '22 17:11 theofficialgman

There's an arm64 build; what's missing is integrating the arm64 build with the others.

koendv avatar Nov 05 '22 18:11 koendv