Don't fail installation on mismatch with size
fields of index
#2332
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
Describe the request
Do not error if the downloaded file size doesn't match the
size
value in the index.A mismatch should only generate a warning. This warning will serve two purposes:
If there is actually a problem with the downloaded file, the checksum validation will still fail.
🙂 Users will no longer suffer when package developers fail to correctly set a
size
value.Describe the current behavior
Arduino CLI performs two operations in order to validate downloaded files
If the file size doesn't match the
size
value in the index, installation fails:The installation will also fail if the file's checksum doesn't match the value of the
checksum
property in the package index. A SHA-256 checksum is entirely sufficient on its own to validate a file, so a size check is completely superfluous for the purpose of validating the file.The other use Arduino CLI makes of the
size
value is indicating the progress of the download. Although this is a nice convenience feature, an incorrectsize
field value will only result in a minor inaccuracy in the progress indicator, which is not sufficient grounds on its own to fail the installation.Package developers sometimes fumble the creation of package index entries. These include the
size
fields:packages[*].platforms[*].size
packages[*].tools[*].systems[*].size
Since an incorrect
size
field value doesn't cause any visible problems when using Arduino IDE 1.x, developers who have not migrated to Arduino CLI or Arduino IDE 2.x won't notice the problem while testing the index. This means the users who are often not able to do anything to fix the problem are the ones punished by Arduino CLI unnecessarily failing the platform installation under these conditions.Arduino CLI version
dde3064
Operating system
All
Operating system version
Any
Additional context
This proposal might appear similar to #1468. However, that proposal is to make it possible to skip all validation, while this proposal is only about removing a superfluous validation requirement, leaving the entirely sufficient validation via checksum intact.
Examples of users suffering from Arduino CLI unnecessarily failing the platform installation due to an incorrect
size
value:size
fields of index #2332 (comment)Issue checklist
The text was updated successfully, but these errors were encountered: