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

Let the CLI mark a platform deprecated/not compatible if it will not work on my env, for example, arduino:[email protected] #2781

Open
3 tasks done
dankeboy36 opened this issue Dec 13, 2024 · 1 comment
Labels
type: enhancement Proposed improvement

Comments

@dankeboy36
Copy link
Contributor

dankeboy36 commented Dec 13, 2024

Describe the request

When I use an older version of the platform, the CLI lists and installs it without any issues. However, it fails with a "bad CPU type in executable" error when I try to compile a sketch.

If the CLI could identify this issue, it would be helpful to mark such versions as "deprecated" (or something similar: https://arduino.github.io/arduino-cli/1.1/rpc/commands/#platformmetadata). This would inform users that these versions are not compatible and prevent them from being installed, ultimately reducing support requests.

Describe the current behavior

There is no way to see if an older version of the AVR core won't work on my environment.

Steps:

cat test_workspace/nested/minimal/minimal.ino
void setup() {}
void loop() {}
./arduino-cli version
arduino-cli  Version: 1.1.1 Commit: fa6eafcb Date: 2024-11-22T09:31:36Z
./arduino-cli core list | grep "arduino:avr"
arduino:avr       1.6.3     1.8.6            Arduino AVR Boards
./arduino-cli core search "arduino:avr" --format json | jq '.platforms[].releases | to_entries[] | select(.key == "1.6.3").value' 
{
  "name": "Arduino AVR Boards",
  "version": "1.6.3",
  "types": [
    "Arduino"
  ],
  "installed": true,
  "boards": [
    {
      "name": "Arduino Nano",
      "fqbn": "arduino:avr:nano"
    },
    {
      "name": "Arduino Mega or Mega 2560",
      "fqbn": "arduino:avr:mega"
    },
    {
      "name": "Arduino Robot Control",
      "fqbn": "arduino:avr:robotControl"
    },
    {
      "name": "Arduino Robot Motor",
      "fqbn": "arduino:avr:robotMotor"
    },
    {
      "name": "Arduino Yún",
      "fqbn": "arduino:avr:yun"
    },
    {
      "name": "Arduino Uno",
      "fqbn": "arduino:avr:uno"
    },
    {
      "name": "Arduino Mega ADK",
      "fqbn": "arduino:avr:megaADK"
    },
    {
      "name": "LilyPad Arduino USB",
      "fqbn": "arduino:avr:LilyPadUSB"
    },
    {
      "name": "Arduino Pro or Pro Mini",
      "fqbn": "arduino:avr:pro"
    },
    {
      "name": "Arduino Leonardo",
      "fqbn": "arduino:avr:leonardo"
    },
    {
      "name": "Arduino Esplora",
      "fqbn": "arduino:avr:esplora"
    },
    {
      "name": "Arduino Mini",
      "fqbn": "arduino:avr:mini"
    },
    {
      "name": "Arduino Ethernet",
      "fqbn": "arduino:avr:ethernet"
    },
    {
      "name": "Arduino BT",
      "fqbn": "arduino:avr:bt"
    },
    {
      "name": "Arduino Duemilanove or Diecimila",
      "fqbn": "arduino:avr:diecimila"
    },
    {
      "name": "Arduino Micro",
      "fqbn": "arduino:avr:micro"
    },
    {
      "name": "Arduino Fio",
      "fqbn": "arduino:avr:fio"
    },
    {
      "name": "LilyPad Arduino",
      "fqbn": "arduino:avr:lilypad"
    },
    {
      "name": "Arduino NG or older",
      "fqbn": "arduino:avr:atmegang"
    }
  ],
  "help": {
    "online": "http://www.arduino.cc/en/Reference/HomePage"
  },
  "compatible": true
}

There is no way to infer from the JSON if this platform version does not work 👆

"compatible": true

Why is it compatible?

./arduino-cli compile -b "arduino:avr:uno" test_workspace/nested/minimal/minimal.ino
Used platform Version Path
arduino:avr   1.6.3   /Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/avr/1.6.3
Error during build: fork/exec /Users/akos.kitta/Library/Arduino15/packages/arduino/tools/avr-gcc/4.8.1-arduino3/bin/avr-g++: bad CPU type in executable

Arduino CLI version

1.1.1

Operating system

macOS

Operating system version

11.7.10

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@dankeboy36 dankeboy36 added the type: enhancement Proposed improvement label Dec 13, 2024
@dankeboy36 dankeboy36 changed the title Let the CLI mark a platform deprecated if it will not work on the env, for example, arduino:[email protected] Let the CLI mark a platform deprecated if it will not work on my env, for example, arduino:[email protected] Dec 13, 2024
@dankeboy36 dankeboy36 changed the title Let the CLI mark a platform deprecated if it will not work on my env, for example, arduino:[email protected] Let the CLI mark a platform deprecated/not compatible if it will not work on my env, for example, arduino:[email protected] Dec 13, 2024
@dankeboy36
Copy link
Contributor Author

dankeboy36 commented Dec 13, 2024

I have to add that the cause of my incorrect version installation is the oddly ordered keys in the core search platforms#releases object. The keys are ordered alphabetically, not semver-wise:

./arduino-cli  core search "arduino:avr" --format json | jq '.platforms[].releases | keys'                                        
[
  "1.6.10",
  "1.6.11",
  "1.6.12",
  "1.6.13",
  "1.6.14",
  "1.6.15",
  "1.6.16",
  "1.6.17",
  "1.6.18",
  "1.6.19",
  "1.6.2",
  "1.6.20",
  "1.6.21",
  "1.6.22",
  "1.6.23",
  "1.6.3",
  "1.6.4",
  "1.6.5",
  "1.6.6",
  "1.6.7",
  "1.6.8",
  "1.6.9",
  "1.8.1",
  "1.8.2",
  "1.8.3",
  "1.8.4",
  "1.8.5",
  "1.8.6"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

1 participant