--library
flag not working with relative paths
#1665
Labels
conclusion: resolved
Issue was resolved
criticality: medium
Of moderate impact
topic: CLI
Related to the command line interface
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Bug Report
Sometimes you want to download a library which is not available through the Library Manager or is in development (not released/tagged).
The workflow would be to keep this version of the library in a different place than the Sketchbook's
libraries
folder, especially if you already have another version of this library installed either manually or through the Library Manager.When doing this, via
arduino-cli
you can specify--library
and pass in a full path to the library.One use case would be to
cd
into one of the examples and run a compile/upload targeting the path 2 folders up (../../
).This will result in an error or in the Library installed in the Sketchbook to be used if present.
Current behavior
I will be using ArduinoIoTCloud to explain what happens.
Install the library with
arduino-cli lib install ArduinoIoTCloud
. This will give us all the dependencies required.Uninstall the library, this will remove only ArduinoIoTCloud and not the installed dependencies:
arduino-cli uninstall ArduinoIoTCloud
~/Downloads
)cd
into its examples folder and ArduinoIoTCloud-Basic$> cd ~/Downloads/ArduinoIoTCloud/examples/ArduinoIoTCloud-Basic
arduino-cli compile -b arduino:samd:nano_33_iot --library ../../ -v
The path is valid, but compilation will end with the following error
Error during build: stat ../../../src/ArduinoIoTCloud.cpp: no such file or directory
If on the other hand I pass in the full path it will compile without issues
arduino-cli compile -b arduino:samd:nano_33_iot --library ~/Downloads/ArduinoIoTCloud-master
If the library is re-installed
arduino-cli lib install ArduinoIoTCloud
, when passing../../
as path to the Library there will be no error, but the library will be picked from the Sketchbook's libraries folderExpected behavior
When passing in a valid path to a Library, it should always be chosen above all other instances of it
Environment
arduino-cli version
): 0.21.0The text was updated successfully, but these errors were encountered: