arduino / arduino-cli

Arduino command line tool
https://arduino.github.io/arduino-cli/latest/
GNU General Public License v3.0
4.23k stars 370 forks source link

--zip-path cannot be enabled #2634

Closed dcrookston closed 3 weeks ago

dcrookston commented 3 weeks ago

Describe the problem

$ arduino-cli lib install --zip-path ~/src/arduinolibs/libraries/crypto.zip
--git-url and --zip-path are disabled by default, for more information see: https://arduino.github.io/arduino-cli/0.35/configuration/#configuration-keys

I went to that URL and there is nothing about the setting to enable --zip-path. I searched and found this article:

https://forum.arduino.cc/t/arduino-cli-library-installing-error-enable-unsafe-install-is-false/867734

which says to set ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL. This was already set, but I tried it anyway:

$ set ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true
$ arduino-cli lib install --zip-path ~/src/arduinolibs/libraries/crypto.zip
--git-url and --zip-path are disabled by default, for more information see: https://arduino.github.io/arduino-cli/0.35/configuration/#configuration-keys

So either the error message, or the documentation, or the code, are wrong.

To reproduce

Install literally anything using the --zip-path flag.

Expected behavior

It should accept the path I gave it using --zip-path.

Arduino CLI version

0.35.3 Commit: 95cfd654 Date: 2024-02-19T13:24:25Z

Operating system

Linux

Operating system version

Linux raspberrypi 6.6.28+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64 GNU/Linux

Additional context

No response

Issue checklist

per1234 commented 3 weeks ago

Hi @dcrookston. The person being supported in that forum topic was a Windows user, so the information shared there was specific to Windows cmd. The set command is used to define environment variables in Windows cmd, but on Linux the command of that name has a completely different purpose so if you follow those instructions on a Linux machine the environment variable will not be defined.

On Linux, you must use this command:

export ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true

Reference:

https://www.man7.org/linux/man-pages/man1/export.1p.html

The methods for defining the configuration key environment variables is already documented in the Arduino CLI configuration documentation:

https://arduino.github.io/arduino-cli/dev/configuration/#environment-variables

So I don't think any action is needed to address this issue (we should add coverage for PowerShell since that has become the primary shell on Windows, but that is a different subject).