Skip to content

Spurious failure of core install: "platform ... is not available for your OS", despite package index providing tool dependency for OS (Linux) #2778

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

Closed
3 tasks done
haydenth opened this issue Dec 7, 2024 · 3 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@haydenth
Copy link

haydenth commented Dec 7, 2024

Describe the problem

I've created a packages file visible below. Or you can find here:

https://raw.githubusercontent.com/atmosphericiq/aiq-board-defs/refs/heads/main/package_atmosphericiq_index.json
{
  "packages": [
    {
      "name": "atmosphericiq",
      "maintainer": "Atmospheric IQ",
      "websiteURL": "https://github.com/atmosphericiq/aiq-board-defs",
      "email": "thayden@engineeringdirector.com",
      "platforms": [
        {
          "name": "AtmosphericIQ CBOT Boards",  
          "architecture": "stm32", 
          "version": "1.0.0", 
          "category": "Contributed",
          "url": "https://github.com/atmosphericiq/aiq-board-defs/archive/refs/tags/v1.0.0.zip",
          "archiveFileName": "v1.0.0.zip", 
          "checksum": "SHA-256:328fcd7a9b3eca5893c3a385cac629ae942eb5afeef353dcd1acc7102e09a155",
          "size": "24638", 
          "boards": [
            {
              "name": "CBOT_V9"
            },
            {
              "name": "CBOT_V11"
            }
          ],
          "toolsDependencies": [
             {
              "packager": "STMicroelectronics",
              "name": "xpack-arm-none-eabi-gcc",
              "version": "13.2.1-1.1"
            }
          ]
        }
      ],
      "tools": [
                {
          "name": "xpack-arm-none-eabi-gcc",
          "version": "13.2.1-1.1",
          "systems":
          [
            {
              "host": "arm-linux-gnueabihf",
              "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-arm.tar.gz",
              "archiveFileName": "xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-arm.tar.gz",
              "checksum": "SHA-256:9a6db147c34f7ea668cc37a139d2667a58f8b2bbee2359f23e48ffd300f8fc2f",
              "size": "257683778"
            },
            {
              "host": "aarch64-linux-gnu",
              "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-arm64.tar.gz",
              "archiveFileName": "xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-arm64.tar.gz",
              "checksum": "SHA-256:ab7f75d95ead0b1efb7432e7f034f9575cc3d23dc1b03d41af1ec253486d19de",
              "size": "265190134"
            },
            {
              "host": "i686-mingw32",
              "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-win32-x64.zip",
              "archiveFileName": "xpack-arm-none-eabi-gcc-13.2.1-1.1-win32-x64.zip",
              "checksum": "SHA-256:56b18ccb0a50f536332ec5de57799342ff0cd005ca2c54288c74759b51929e4f",
              "size": "306340878"
            },
            {
              "host": "x86_64-apple-darwin",
              "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-darwin-x64.tar.gz",
              "archiveFileName": "xpack-arm-none-eabi-gcc-13.2.1-1.1-darwin-x64.tar.gz",
              "checksum": "SHA-256:1ecc0fd6c31020aff702204f51459b4b00ff0d12b9cd95e832399881d819aa57",
              "size": "262217286"
            },
            {
              "host": "x86_64-linux-gnu",
              "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-x64.tar.gz",
              "archiveFileName": "xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-x64.tar.gz",
              "checksum": "SHA-256:1252a8cafe9237de27a765376697230368eec21db44dc3f1edeb8d838dabd530",
              "size": "268158135"
            }
          ]
        }]
    }
  ]
}

I am on a linux system (Ubuntu)

$ uname -a
Linux stardust 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov  6 17:42:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Yet when I go to install this package, I get the following error

~/.arduino15/packages/STMicroelectronics $ arduino-cli core update-index
Downloading index: package_index.tar.bz2 downloaded
Downloading index: package_atmosphericiq_index.json downloaded

~/.arduino15/packages/STMicroelectronics $ arduino-cli core install atmosphericiq:stm32
Error during install: Platform 'atmosphericiq:stm32' not found: platform is not available for your OS

If I remove the toolsDependencies and set it to just:

 "toolsDependencies": []

I installs fine, but obviously I don't have the tool I need installed.

To reproduce

  1. On a linux system, use the packages file specified above
  2. Try to install arduino-cli core install atmosphericiq:stm32
  3. See error message

The verbose flag doesn't help very much:

INFO[0000] Loaded tool                                   tool="STMicroelectronics:CMSIS@5.7.0"
INFO[0000] Loaded tool                                   tool="STMicroelectronics:CMSIS@5.9.0"
INFO[0000] Loaded tool                                   tool="STMicroelectronics:STM32Tools@2.2.1"
INFO[0000] Loaded tool                                   tool="STMicroelectronics:xpack-arm-none-eabi-gcc@12.2.1-1.2"
INFO[0000] Loaded tool                                   tool="STMicroelectronics:xpack-openocd@0.12.0-1"
INFO[0000] Loading package arduino from: /home/tom/.arduino15/packages/arduino/hardware
INFO[0000] Missing signature file                        index=/home/tom/.arduino15/packages/arduino/hardware/avr/1.8.6/installed.json
INFO[0000] Adding monitor tool                           protocol=serial tool="builtin:serial-monitor"
INFO[0000] Loaded platform                               platform="arduino:avr@1.8.6"
INFO[0000] Checking existence of 'tools' path: /home/tom/.arduino15/packages/arduino/tools
INFO[0000] Loading tools from dir: /home/tom/.arduino15/packages/arduino/tools
INFO[0000] Loaded tool                                   tool="arduino:arduinoOTA@1.3.0"
INFO[0000] Loaded tool                                   tool="arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7"
INFO[0000] Loaded tool                                   tool="arduino:avrdude@6.3.0-arduino17"
INFO[0000] Loaded tool                                   tool="arduino:dfu-util@0.11.0-arduino5"
INFO[0000] Loading package atmosphericiq from: /home/tom/.arduino15/packages/atmosphericiq/hardware
INFO[0000] Loading package builtin from: /home/tom/.arduino15/packages/builtin
INFO[0000] Checking existence of 'tools' path: /home/tom/.arduino15/packages/builtin/tools
INFO[0000] Loading tools from dir: /home/tom/.arduino15/packages/builtin/tools
INFO[0000] Loaded tool                                   tool="builtin:ctags@5.8-arduino11"
INFO[0000] Loaded tool                                   tool="builtin:dfu-discovery@0.1.2"
INFO[0000] Loaded tool                                   tool="builtin:mdns-discovery@1.0.9"
INFO[0000] Loaded tool                                   tool="builtin:serial-discovery@1.4.0"
INFO[0000] Loaded tool                                   tool="builtin:serial-discovery@1.4.1"
INFO[0000] Loaded tool                                   tool="builtin:serial-monitor@0.13.0"
INFO[0000] Loaded tool                                   tool="builtin:serial-monitor@0.14.1"
INFO[0000] Loading package esp32 from: /home/tom/.arduino15/packages/esp32/hardware
INFO[0000] Missing signature file                        index=/home/tom/.arduino15/packages/esp32/hardware/esp32/3.0.7/installed.json
INFO[0000] Adding monitor tool                           protocol=serial tool="builtin:serial-monitor"
INFO[0000] Loaded platform                               platform="esp32:esp32@3.0.7"
INFO[0000] Checking existence of 'tools' path: /home/tom/.arduino15/packages/esp32/tools
INFO[0000] Loading tools from dir: /home/tom/.arduino15/packages/esp32/tools
INFO[0000] Loaded tool                                   tool="esp32:esp-rv32@2302"
INFO[0000] Loaded tool                                   tool="esp32:esp-x32@2302"
INFO[0000] Loaded tool                                   tool="esp32:esp-xs2@2302"
INFO[0000] Loaded tool                                   tool="esp32:esp-xs3@2302"
INFO[0000] Loaded tool                                   tool="esp32:esp32-arduino-libs@idf-release_v5.1-632e0c2a"
INFO[0000] Loaded tool                                   tool="esp32:esptool_py@4.6"
INFO[0000] Loaded tool                                   tool="esp32:mklittlefs@3.0.0-gnu12-dc7f933"
INFO[0000] Loaded tool                                   tool="esp32:mkspiffs@0.2.3"
INFO[0000] Loaded tool                                   tool="esp32:openocd-esp32@v0.12.0-esp32-20240821"
INFO[0000] Loaded tool                                   tool="esp32:riscv32-esp-elf-gdb@12.1_20231023"
INFO[0000] Loaded tool                                   tool="esp32:xtensa-esp-elf-gdb@12.1_20231023"
INFO[0000] Adding libraries dir                          dir=/home/tom/.arduino15/packages/arduino/hardware/avr/1.8.6/libraries isSingleLibrary=false location=platform
INFO[0000] Adding libraries dir                          dir=/home/tom/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.1/libraries isSingleLibrary=false location=platform
INFO[0000] Adding libraries dir                          dir=/home/tom/.arduino15/packages/esp32/hardware/esp32/3.0.7/libraries isSingleLibrary=false location=platform
INFO[0000] Loading libraries index file                  index=/home/tom/.arduino15/library_index.json
INFO[0000] Adding libraries dir                          dir=/home/tom/Arduino/libraries isSingleLibrary=false location=user
INFO[0000] Running from console, will run post-install by default
INFO[0000] Running from console, will run pre-uninstall by default
Error during install: Platform 'atmosphericiq:stm32' not found: platform is not available for your OS

Expected behavior

I would expect it to install both the xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-x64.tar.gz and the package itself.

Arduino CLI version

arduino-cli Version: nightly-20241207 Commit: 6dbff9f Date: 2024-12-07T01:34:43Z

Operating system

Linux

Operating system version

Linux stardust 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Additional context

No response

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
@haydenth haydenth added the type: imperfection Perceived defect in any part of project label Dec 7, 2024
@haydenth
Copy link
Author

haydenth commented Dec 7, 2024

cc @fronders

@per1234 per1234 self-assigned this Dec 8, 2024
@per1234
Copy link
Contributor

per1234 commented Dec 8, 2024

Hi @haydenth. The packages[*].platforms[*].toolsDependencies key in your package index specifies a dependency on version 13.2.1-1.1 of a tool with ID xpack-arm-none-eabi-gcc, which is provided by the package with ID STMicroelectronics (in shorthand, STMicroelectronics:xpack-arm-none-eabi-gcc@13.2.1-1.1).

You define a tool with that ID and version in the package with ID atmosphericiq (in shorthand, atmosphericiq:xpack-arm-none-eabi-gcc@13.2.1-1.1), but that is not the same as the specified STMicroelectronics:xpack-arm-none-eabi-gcc@13.2.1-1.1 dependency. So when Arduino CLI goes looking for the STMicroelectronics:xpack-arm-none-eabi-gcc@13.2.1-1.1 dependency, it can't find it, and thus the boards platform installation fails.

So you should be able to fix the bug with this patch:

--- a/package_atmosphericiq_index.json
+++ b/package_atmosphericiq_index.json
@@ -25,7 +25,7 @@
           ],
           "toolsDependencies": [
              {
-              "packager": "STMicroelectronics",
+              "packager": "atmosphericiq",
               "name": "xpack-arm-none-eabi-gcc",
               "version": "13.2.1-1.1"
             }

You can learn more about this subject from the Arduino Package Index Specification:

https://arduino.github.io/arduino-cli/latest/package_index_json-specification/

If you have any questions or problems, feel free to post over on Arduino Forum:

https://forum.arduino.cc/

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
@per1234 per1234 added conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself labels Dec 8, 2024
@per1234 per1234 changed the title Package Specification Yielding "platform is not available for your OS" Despite Package File Specifications OK for OS (Linux) Spurious failure of core install: "platform ... is not available for your OS", despite package index providing tool dependency for OS (Linux) Dec 8, 2024
@haydenth
Copy link
Author

haydenth commented Dec 8, 2024

Thank you SO MUCH for your kind reply here. This absolutely solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants