Description
openedon Sep 28, 2023
Describe the problem
If the filename of a package index contains the character .
, Arduino CLI truncates the downloaded filename
To reproduce
$ arduino-cli version
arduino-cli.exe Version: git-snapshot Commit: 6aa1be03 Date: 2023-09-28T08:02:22Z
$ export ARDUINO_DIRECTORIES_DATA="/tmp/arduino-cli-directories/data" # Use a throwaway directories.data for the demo
$ arduino-cli --additional-urls http://drazzy.com/package_drazzy.com_index.json core update-index
[...]
Downloading index: package_drazzy.com_index.json downloaded
Error initializing instance: Loading index file: loading json index file C:\Users\per\AppData\Local\Temp\arduino-cli-directories\data\package_drazzy.com_index.json: open C:\Users\per\AppData\Local\Temp\arduino-cli-directories\data\package_drazzy.com_index.json: The system cannot find the file specified.
[...]
$ ls "$ARDUINO_DIRECTORIES_DATA"/package_drazzy*.*
/tmp/arduino-cli-directories/data/package_drazzy.json
$ arduino-cli --additional-urls http://drazzy.com/package_drazzy.com_index.json core install ATTinyCore:avr
Error initializing instance: Loading index file: loading json index file C:\Users\per\AppData\Local\Temp\arduino-cli-directories\data\package_drazzy.com_index.json: open C:\Users\per\AppData\Local\Temp\arduino-cli-directories\data\package_drazzy.com_index.json: The system cannot find the file specified.
Error initializing instance: Loading index file: loading json index file C:\Users\per\AppData\Local\Temp\arduino-cli-directories\data\package_drazzy.com_index.json: open C:\Users\per\AppData\Local\Temp\arduino-cli-directories\data\package_drazzy.com_index.json: The system cannot find the file specified.
Invalid argument passed: Platform 'ATTinyCore:avr' not found
🐛 The downloaded package index was named package_drazzy.json
instead of the correct name package_drazzy.com_index.json
🐛 The platforms from the package index can't be installed because the truncation caused the file to no longer have the required filename format (package_<differentiator>_index.json
).
Expected behavior
The filenames of package index files are not changed on download.
Arduino CLI version
Operating system
- Windows
- Linux
Operating system version
- Windows 11
- Ubuntu 22.04
Additional context
I bisected the regression to 82e6f5d (doesn't occur when using the build from the previous commit 1877431).
The use of a full domain name in the package index filename is explicitly recommended in the Arduino Package Index Specification:
We suggest using a domain name owned by the packager. For example:
package_arduino.cc_index.json
Originally reported at SpenceKonde/ATTinyCore#803 (comment)
Additional reports
- Arduino IDE 2.2.1 Board Manager Fails to Add SpenceKonde/megaTinyCore#1005
- 'ATTinyCore by Spence Konde' doesn't show in Board Manager list SpenceKonde/ATTinyCore#802
Related
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details
Activity