robgonnella / ardi

Ardi is a command-line tool that helps you manage arduino projects!
GNU General Public License v3.0
12 stars 1 forks source link

Additional board URLs not properly registered on "ardi install" #93

Closed egnor closed 1 year ago

egnor commented 3 years ago

When board URLs are added (via ardi add board-url), corresponding files are added to the package registry. Also, the board URL is added to ardi.json. This works great when first done.

However, when ardi install is done to bring a different workspace up to date with the same ardi.json, the board URL's files aren't downloaded, and setup fails.

% mkdir test
% cd test
% ardi project-init
% ardi add board-url https://www.adafruit.com/package_adafruit_index.json
ardi    Adding board url: https://www.adafruit.com/package_adafruit_index.json
% ardi add platform adafruit:nrf52
ardi    Adding platform: adafruit:nrf52              
Updating index: library_index.json.gz downloaded                                
Updating index: library_index.json.sig downloaded                               
Updating index: package_index.json downloaded                                   
Updating index: package_index.json.sig downloaded                               
Updating index: package_adafruit_index.json downloaded                          
Downloading missing tool builtin:ctags@5.8-arduino11...
builtin:ctags@5.8-arduino11 downloaded                                          
Installing builtin:ctags@5.8-arduino11...
builtin:ctags@5.8-arduino11 installed
Downloading missing tool builtin:serial-discovery@1.3.0-rc1...
builtin:serial-discovery@1.3.0-rc1 downloaded                                   
Installing builtin:serial-discovery@1.3.0-rc1...
builtin:serial-discovery@1.3.0-rc1 installed
ardi    Installed Platform: adafruit:nrf52 1.0.0     
ardi    Updated config

% rm -rf .ardi  # reset workspace to prepare for new "install"
% ardi install
ardi    board url already added: https://www.adafruit.com/package_adafruit_index.json 
Updating index: library_index.json.gz downloaded                                
Updating index: library_index.json.sig downloaded                               
Updating index: package_index.json downloaded                                   
Updating index: package_index.json.sig downloaded                               
Downloading missing tool builtin:ctags@5.8-arduino11...
builtin:ctags@5.8-arduino11 downloaded                                          
Installing builtin:ctags@5.8-arduino11...
builtin:ctags@5.8-arduino11 installed
Downloading missing tool builtin:serial-discovery@1.3.0-rc1...
builtin:serial-discovery@1.3.0-rc1 downloaded                                   
Installing builtin:serial-discovery@1.3.0-rc1...
builtin:serial-discovery@1.3.0-rc1 installed
Error: finding platform dependencies: package adafruit not found
Usage:
  ardi install [flags]

Flags:
  -h, --help   help for install

Global Flags:
  -q, --quiet     Silence all logs
  -v, --verbose   Print all logs

ardi   Command failed                                error="finding platform dependencies: package adafruit not found"

% ardi add board-url https://www.adafruit.com/package_adafruit_index.json
ardi add board-url https://www.adafruit.com/package_adafruit_index.json
% ardi install
... same error as above ...

% ardi remove board-url https://www.adafruit.com/package_adafruit_index.json
% ardi add board-url https://www.adafruit.com/package_adafruit_index.json   
ardi    Adding board url: https://www.adafruit.com/package_adafruit_index.json
% ardi install
ardi    board url already added: https://www.adafruit.com/package_adafruit_index.json 
Error initializing instance: Loading index file: loading json index file /home/egnor/test/.ardi/package_adafruit_index.json: open /home/egnor/test/.ardi/package_adafruit_index.json: no such file or directory
Error: finding platform dependencies: package adafruit not found
Usage:
  ardi install [flags]

Flags:
  -h, --help   help for install

Global Flags:
  -q, --quiet     Silence all logs
  -v, --verbose   Print all logs

ardi   Command failed                                error="finding platform dependencies: package adafruit not found"

% ardi remove board-url https://www.adafruit.com/package_adafruit_index.json
% ardi add board-url https://www.adafruit.com/package_adafruit_index.json
ardi    Adding board url: https://www.adafruit.com/package_adafruit_index.json
% ardi install
ardi    board url already added: https://www.adafruit.com/package_adafruit_index.json 

ardi    Installed Platform: adafruit:nrf52 1.0.0

Why did it work the second time and not the first after the remove/add cycle? I don't know. But something is surely not right here.

robgonnella commented 2 years ago

Fixed! Will be in upcoming release