Description
Describe the problem
Although board platforms are not host architecture-specific, their tool dependencies must be built for each target host architecture.
The available archives for a given tool release are listed in packages[*].tools[*].systems[]
field of the packager's package index file, with the target host architecture specified by the archive object's host
field.
This information is used by the arduino-cli core
commands to install tool dependencies along with a board platform. In the event a tool dependency is not available for the host architecture, the platform installation fails with an error message in the form:
Error during install: Error downloading tool <tool name>@<tool version>: no versions available for the current OS
🐛 Platform releases which are incompatible with the user's host architecture are offered for installation and update even though the process will inevitably fail. Previous releases which are compatible are not directly offered.
To reproduce
Set up
I have prepared a package index file which contains two platform releases:
foo_vendor:avr@1.0.0
- has a dependency on thefoo_vendor:some_tool@1.0.0
tool, which is available for your host architecturefoo_vendor:avr@1.0.1
- has a dependency on thefoo_vendor:some_tool@2.0.0
tool, which is not available for your host architecture
- Download this demonstration package index file:
package_1888_index.json.txt - Rename the downloaded file
package_1888_index.json
- Add the path to the downloaded file to the
board_manager.additional_urls
configuration:(whereexport ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS="file://<download path>/package_1888_index.json"
<download path>
is the path of thepackage_1888_index.json
file you downloaded in the first step)
Steps
- Run the following command:
🐛 The "Latest" column shows a version of the platform that is not compatible with your host architecture:
arduino-cli core list --all
ID Installed Latest Name [...] foo_vendor:avr 1.0.1 Foo Boards
- Run the following command:
🐛 The command failed because Arduino CLI selected the incompatible version of the platform:
arduino-cli core install foo_vendor:avr
Error during install: Error downloading tool foo_vendor:some_tool@2.0.0: no versions available for the current OS
- Run the following command:
arduino-cli core install foo_vendor:avr@1.0.0
- Run the following command:
🐛 The "Latest" column shows a version of the platform that is not compatible with your host architecture:
arduino-cli core list
ID Installed Latest Name [...] foo_vendor:avr 1.0.0 1.0.1 Foo Boards
- Run the following command:
🐛 The platform is listed as updatable even though the newer version is not compatible with your host architecture:
arduino-cli core list --updatable
ID Installed Latest Name foo_vendor:avr 1.0.0 1.0.1 Foo Boards
- Run the following command:
🐛 The platform is listed as updatable even though the newer version is not compatible with your host architecture:
arduino-cli core search --all
ID Installed Latest Name foo_vendor:avr 1.0.0 1.0.1 Foo Boards
- Run the following command:
🐛 There is no indication that
arduino-cli core search --all --format json foo
foo_vendor:avr@1.0.1
is not compatible with your host architecture:[ { "id": "foo_vendor:avr", "latest": "1.0.0", "name": "Foo Boards", "maintainer": "Foo Developer", "website": "http://example.com", "email": "foo@example.com", "boards": [ { "name": "ATtiny", "fqbn": "foo_vendor:avr:attiny" } ], "type": [ "Contributed" ] }, { "id": "foo_vendor:avr", "latest": "1.0.1", "name": "Foo Boards", "maintainer": "Foo Developer", "website": "http://example.com", "email": "foo@example.com", "type": [ "Contributed" ] } ]
- Run the following command:
🐛 The command failed because Arduino CLI attempted to upgrade to an incompatible version of the platform:
arduino-cli core upgrade foo_vendor:avr
Error during install: Error downloading tool foo_vendor:some_tool@2.0.0: no versions available for the current OS
Expected behavior
- Incompatible platform versions are not automatically offered or selected for update or installation when a compatible version is available
- Incompatible platform versions are identified as such in listings
The current behavior of failing the platform installation with an error is reasonable in the following cases:
- No compatible version is available
- The user has explicitly specified the incompatible version via the command. For example:
arduino-cli core install foo_vendor:avr@1.0.1
Arduino CLI version
Operating system
Windows
Operating system version
10
Additional context
Originally reported by @PaulStoffregen at https://forum.pjrc.com/threads/53548-Arduino-CLI-And-IDE-now-Released-Teensy-Supported!?p=313206#post313206
This subject was previously discussed at #1626, but that discussion centered around the error message more clearly communicating about the problem to the user, while this issue is about Arduino CLI avoiding the error altogether when that is possible.
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