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

data directory configuration option does not work with relative path

Open aarobc opened this issue 2 years ago • 1 comments
trafficstars

Describe the problem

When setting the directories.data option in the arduino-cli.yaml with a relative path, The dependency is downloaded correctly, but an error "no such file or directory" is given upon build.

To reproduce

create a new project with a dependency, and an arduino-cli.yaml in the root with the following contents:

 directories:                                                                                  
   data: ./data                                                                                
   downloads: ./staging 

An example repo is available here: https://github.com/aarobc/arduino-cli-error-example clone down the repo and run:

arduino-cli compile --profile uno

The build fails, and following error will be given:

Error during build: stat data/internal/Encoder_1.4.2_496972fffc26d938/Encoder/data/internal/Encoder_1.4.2_496972fffc26d938/Encoder/Encoder.cpp: no such file or directory

Expected behavior

No error to be given, and build to be successful.

Arduino CLI version

nightly-20221229 Commit: 357d465 Date: 2022-12-29T01:33:09Z

Operating system

Linux

Operating system version

Arch rolling (6.1.1-arch1-1)

Additional context

No response

Issue checklist

  • [X] I searched for previous reports in the issue tracker
  • [X] I verified the problem still occurs when using the nightly build
  • [X] My report contains all necessary details

aarobc avatar Dec 29 '22 21:12 aarobc

@aarobc We removed the support for arduino-cli.yaml configuration in the current working directory, because of supposed security risks #2085

In any case, why are you writing the arduino-cli.yaml in the sketch? Shouldn't the sketch.yaml be already sufficient? The CLI is able to install the missing pieces automatically (without interfering with the globally installed tools).

cmaglie avatar Jun 09 '23 08:06 cmaglie