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

Platform versions incompatible with host architecture are offered unnecessarily #1889

Closed
3 tasks done
per1234 opened this issue Sep 23, 2022 · 0 comments · Fixed by #2285
Closed
3 tasks done

Platform versions incompatible with host architecture are offered unnecessarily #1889

per1234 opened this issue Sep 23, 2022 · 0 comments · Fixed by #2285
Assignees
Labels
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 23, 2022

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:

  1. Download this demonstration package index file:
    package_1888_index.json.txt
  2. Rename the downloaded file package_1888_index.json
  3. Add the path to the downloaded file to the board_manager.additional_urls configuration:
    export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS="file://<download path>/package_1888_index.json"
    
    (where <download path> is the path of the package_1888_index.json file you downloaded in the first step)

Steps

  1. Run the following command:
    arduino-cli core list --all
    
    🐛 The "Latest" column shows a version of the platform that is not compatible with your host architecture:
    ID                    Installed Latest    Name
    [...]
    foo_vendor:avr                  1.0.1     Foo Boards
    
  2. Run the following command:
    arduino-cli core install foo_vendor:avr
    
    🐛 The command failed because Arduino CLI selected the incompatible version of the platform:
    Error during install: Error downloading tool foo_vendor:[email protected]: no versions available for the current OS
    
  3. Run the following command:
    arduino-cli core install foo_vendor:[email protected]
    
  4. Run the following command:
    arduino-cli core list
    
    🐛 The "Latest" column shows a version of the platform that is not compatible with your host architecture:
    ID             Installed Latest Name      
    [...]
    foo_vendor:avr 1.0.0     1.0.1  Foo Boards
    
  5. Run the following command:
    arduino-cli core list --updatable
    
    🐛 The platform is listed as updatable even though the newer version is not compatible with your host architecture:
    ID             Installed Latest Name      
    foo_vendor:avr 1.0.0     1.0.1  Foo Boards
    
  6. Run the following command:
    arduino-cli core search --all
    
    🐛 The platform is listed as updatable even though the newer version is not compatible with your host architecture:
    ID             Installed Latest Name      
    foo_vendor:avr 1.0.0     1.0.1  Foo Boards
    
  7. Run the following command:
    arduino-cli core search --all --format json foo
    
    🐛 There is no indication that foo_vendor:[email protected] 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": "[email protected]",
        "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": "[email protected]",
        "type": [
          "Contributed"
        ]
      }
    ]
  8. Run the following command:
    arduino-cli core upgrade foo_vendor:avr
    
    🐛 The command failed because Arduino CLI attempted to upgrade to an incompatible version of the platform:
    Error during install: Error downloading tool foo_vendor:[email protected]: 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:[email protected]
    

Arduino CLI version

5730e2e

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 23, 2022
@cmaglie cmaglie self-assigned this Apr 28, 2023
@cmaglie cmaglie added this to the Arduino CLI 1.0 milestone Apr 28, 2023
@alessio-perugini alessio-perugini linked a pull request Aug 28, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants