Skip to content

arduino-cli: not found. Sopine A64 on OpenWrt OS #1683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NamlaZz opened this issue Mar 3, 2022 · 10 comments · Fixed by #1751
Closed

arduino-cli: not found. Sopine A64 on OpenWrt OS #1683

NamlaZz opened this issue Mar 3, 2022 · 10 comments · Fixed by #1751
Assignees
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project

Comments

@NamlaZz
Copy link

NamlaZz commented Mar 3, 2022

I am unable to install any version of arduino-cli beyond 0.5.0-showports.

This is what I get when installing through curl the latest version of arduino-cli. Note that /root/bin/ is already appended to my $PATH.
root@s200:~# curl -fsSL https://github.com/raw/arduino/arduino-cli/master/install.sh | sh
Installing in /root/bin
ARCH=ARM64
OS=Linux
Using curl as download tool
Downloading https://downloads.arduino.cc/arduino-cli/arduino-cli_0.21.1_Linux_ARM64.tar.gz
sh: /root/bin/arduino-cli: not found
Failed to install arduino-cli

However when installing version 0.5.0-showports or older it works:
root@s200:~# curl -fsSL https://github.com/raw/arduino/arduino-cli/master/install.sh | sh -s 0.5.0-showports
Installing in /root/bin
ARCH=ARM64
OS=Linux
Using curl as download tool
Downloading https://downloads.arduino.cc/arduino-cli/arduino-cli_0.5.0-showports_Linux_ARM64.tar.gz
arduino-cli Version: 0.5.0-showports Commit: 3d7717e installed successfully in /root/bin

Version 0.5.0-showports does not contain all the functionalities that I need for the project, most importantly the serial monitor. Attached below are system information for my OS.

Linux version 5.10.96 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r18729-8c1d5129ee) 11.2.0, GNU ld (GNU Binutils) 2.37)

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 3, 2022
@per1234
Copy link
Contributor

per1234 commented Mar 3, 2022

Hi @NamlaZz. Thanks for your report.

What do you get if you run this command?:

ls /root/bin/arduino-cli

@NamlaZz
Copy link
Author

NamlaZz commented Mar 3, 2022

Running this command after failure to install is shown as below:

sh: /root/bin/arduino-cli: not found
Failed to install arduino-cli
root@s200:~# ls /root/bin/arduino-cli
/root/bin/arduino-cli

@per1234
Copy link
Contributor

per1234 commented Mar 3, 2022

I'm pretty sure the installation script is failing at this command:

APPLICATION_VERSION="$("$EFFECTIVE_BINDIR/$PROJECT_NAME" version)"

What do you get if you run this command?:

/root/bin/arduino-cli version

@NamlaZz
Copy link
Author

NamlaZz commented Mar 3, 2022

this is what I get when I run the command:
root@s200:~# /root/bin/arduino-cli version
-ash: /root/bin/arduino-cli: not found

@umbynos
Copy link
Contributor

umbynos commented Mar 4, 2022

What shell are you using? Do you have a /tmp folder on your system?

@facchinm
Copy link
Member

facchinm commented Mar 4, 2022

I think the problem is the missing glibc in your OS (since it's built on musl)
AFAIK the cli shouldn't have any CGO dependency on Linux so, if compiled with CGO_ENABLED=0 it should also run on your setup.

Would you mind testing the attached binary? It's the cli compiled with GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build
arduino-cli-cgo-disabled.zip

@facchinm
Copy link
Member

facchinm commented Mar 4, 2022

For reference, this is the output on file on both binaries

file ./arduino-cli-official                     
./arduino-cli: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, Go BuildID=v0P18lFJNQ4WeE4mt508/fNlonX00LtFjhF7tzJe9/SC8S6mPmPVKw-PyFgZrm/GTK9qrY1RiFtclTFe8Ot, not stripped
file /tmp/arduino-cli-cgo-disabled                  
/tmp/arduino-cli: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=Z9HDT5q9nZy8QNtP6vDG/RVYDkO_0ZmzWrUrdlDvG/RkARVf0-69-GYy4yltRQ/Jr4KPJrso4moT-71H9xI, not stripped

So the difference is indeed statically linked vs dynamically linked

@NamlaZz
Copy link
Author

NamlaZz commented Mar 4, 2022

What shell are you using? Do you have a /tmp folder on your system?

it's Almquist shell, I have /tmp folder

@NamlaZz
Copy link
Author

NamlaZz commented Mar 4, 2022

I think the problem is the missing glibc in your OS (since it's built on musl) AFAIK the cli shouldn't have any CGO dependency on Linux so, if compiled with CGO_ENABLED=0 it should also run on your setup.

Would you mind testing the attached binary? It's the cli compiled with GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build arduino-cli-cgo-disabled.zip

I SCPed the file into /root/bin and indeed it works, I tried running the below command to check the version.
root@s200:~# arduino-cli version
arduino-cli Version: 0.0.0-git Commit: Date:

A new release of Arduino CLI is available: 0.0.0-git → 0.21.1
https://arduino.github.io/arduino-cli/latest/installation/#latest-packages

although not indicated it appears that I have a working version of 0.20 or 0.21 of arduino-cli. What can I do to bypass this problem for future releases?

@per1234 per1234 added os: linux Specific to Linux operating system topic: infrastructure Related to project infrastructure labels Mar 4, 2022
@facchinm
Copy link
Member

facchinm commented Mar 7, 2022

My suggestion for the @arduino/team_tooling is to compile with CGO_ENABLED=0 for all the platform where it's possible (probably every platform except MacOS)

@umbynos umbynos linked a pull request Jun 8, 2022 that will close this issue
5 tasks
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jun 13, 2022
archlinux-github pushed a commit to archlinux/aur that referenced this issue Jul 30, 2022
archlinux-github pushed a commit to archlinux/aur that referenced this issue Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved os: linux Specific to Linux operating system topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants