-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Describe the problem
Per the Arduino Package Index Specification, platform and tool release archives must contain a root folder:
https://arduino.github.io/arduino-cli/latest/package_index_json-specification/#archive-structure
The release script generates archive files that don't contain a root folder.
🐛 Installation of the platforms in modern versions of Arduino IDE and Arduino CLI fails:
Installing PulseRain_RISCV:Reindeer_upload@2.1.0
Failed to install platform: 'PulseRain_RISCV:Reindeer:1.4.2'.
Error: 13 INTERNAL: Cannot install tool PulseRain_RISCV:Reindeer_upload@2.1.0: searching package root dir: files in archive must be placed in a subdirectory
To reproduce
Follow the installation instructions while using Arduino IDE 2.x.
Expected behavior
The releases are specification-compliant and can be installed using modern development tools.
Additional context
The problem is caused by the tar commands in package_release.sh. For example:
Arduino_RISCV_IDE/package_release.sh
Line 116 in 67bbebc
| cd ./Reindeer_upload;tar zcf ../package/$Reindeer_upload_name .;cd .. |
This produces an archive with this structure:
Reindeer_upload_2.1.0.tar.gz
└── reindeer_config.exe
It would be fixed by passing the path to the folder containing the component as the argument to tar instead of cding to the folder and then using . as the argument:
--- a/package_release.sh
+++ b/package_release.sh
@@ -113,7 +113,7 @@ if [ -f "./package/$Reindeer_upload_name" ]
then
echo "=====================> $Reindeer_upload_name already exists!"
else
- cd ./Reindeer_upload;tar zcf ../package/$Reindeer_upload_name .;cd ..
+ tar zcf ./package/$Reindeer_upload_name ./Reindeer_upload
fi
sha256_Reindeer_upload=$(sha256sum ./package/$Reindeer_upload_name | awk '{print $1}')
size_Reindeer_upload=$(stat -c %s ./package/$Reindeer_upload_name)This produces an archive with the correct structure:
Reindeer_upload_2.1.0.tar.gz
└── Reindeer_upload/
└── reindeer_config.exe