Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package index filename is truncated if it contains . #2345

Closed
3 tasks done
per1234 opened this issue Sep 28, 2023 · 0 comments · Fixed by #2346
Closed
3 tasks done

Package index filename is truncated if it contains . #2345

per1234 opened this issue Sep 28, 2023 · 0 comments · Fixed by #2346
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented 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

6aa1be0

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:

https://arduino.github.io/arduino-cli/dev/package_index_json-specification/#naming-of-the-json-index-file

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

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 28, 2023
@alessio-perugini alessio-perugini self-assigned this Sep 28, 2023
@alessio-perugini alessio-perugini linked a pull request Sep 28, 2023 that will close this issue
6 tasks
@per1234 per1234 added the conclusion: resolved Issue was resolved label Oct 2, 2023
ladyada added a commit to adafruit/ci-arduino that referenced this issue Oct 29, 2023
platisd added a commit to platisd/nokia-5110-lcd-library that referenced this issue Nov 22, 2023
A number of factors contributed to the build being broken:
- ATtinyCore tool dependency on micronucleus-cli-2.5-azd1-x86_64-linux-gnu.tar.bz2
  is hosted on a website with an expired certificate
  - Using an older version of the platform which uses the older tool version, hosted
  on a different website that still works
- The latest arduino-cli release contains a bug (arduino/arduino-cli#2345)
  which fails to download the ATtinyCore additional board packages
platisd added a commit to platisd/nokia-5110-lcd-library that referenced this issue Nov 22, 2023
A number of factors contributed to the build being broken:
- ATTinyCore tool dependency on micronucleus-cli-2.5-azd1-x86_64-linux-gnu.tar.bz2
  is hosted on a website with an expired certificate
  - Using an older version of the platform which uses the older tool version, hosted
  on a different website that still works
- The latest arduino-cli release contains a bug (arduino/arduino-cli#2345)
  which fails to download the ATTinyCore additional board packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants