Skip to content

core list command gives no output when no platforms are installed #2220

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
aliphys opened this issue Jun 20, 2023 · 3 comments · Fixed by #2238
Closed
3 tasks done

core list command gives no output when no platforms are installed #2220

aliphys opened this issue Jun 20, 2023 · 3 comments · Fixed by #2238
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@aliphys
Copy link

aliphys commented Jun 20, 2023

Describe the problem

I want to see the list of currently installed cores on my system. But cannot.
image

To reproduce

  1. Type arduino-cli core list in the terminal.
  2. Hit Enter
  3. Nothing happens

Expected behavior

I get a list of available cores on the system

Arduino CLI version

Version: 0.33.0 Commit: ca60d4b Date: 2023-05-30T12:14:01Z

Operating system

Windows

Operating system version

Windows 11

Additional context

I can see a list of installable/installed cores by appending the --all argument.

PS C:\Users\Ali Jahangiri\Documents\GitHub\nicla-sense-me-fw> arduino-cli core list --all
ID                      Installed Latest    Name                                                                                 
arduino:avr                       1.8.6     Arduino AVR Boards                                                                   
arduino:mbed_edge                 4.0.2     Arduino Mbed OS Edge Boards                                                          
arduino:mbed_giga                 4.0.2     Arduino Mbed OS Giga Boards                                                       

arduino:mbed_nano                 4.0.2     Arduino Mbed OS Nano Boards                                                       

arduino:mbed_nicla                4.0.2     Arduino Mbed OS Nicla Boards                                                      

arduino:mbed_opta                 4.0.2     Arduino Mbed OS Opta Boards                                                       

arduino:mbed_portenta             4.0.2     Arduino Mbed OS Portenta Boards                                                   

arduino:mbed_rp2040               4.0.2     Arduino Mbed OS RP2040 Boards                                                     

arduino:megaavr                   1.8.8     Arduino megaAVR Boards                                                            

arduino:nrf52                     1.0.2     Arduino nRF52 Boards                                                              

arduino:sam                       1.6.12    Arduino SAM Boards (32-bits ARM Cortex-M3)                                        

arduino:samd                      1.8.13    Arduino SAMD Boards (32-bits ARM Cortex-M0+)                                      

Arrow:samd                        2.1.0     Arrow Boards                                                                      

atmel-avr-xminis:avr              0.6.0     Atmel AVR Xplained-minis                                                          

emoro:avr                         3.2.2     EMORO 2560                                                                        

industruino:samd                  1.0.1     Industruino SAMD Boards (32-bits ARM Cortex-M0+)                                  

Intel:arc32                       2.0.6     Intel Curie Boards                                                                

Intel:i586                        1.6.7+1.0 Intel i586 Boards                                                                 

Intel:i686                        1.6.7+1.0 Intel i686 Boards                                                                 

littleBits:avr                    1.0.0     littleBits Arduino AVR Modules                                                    

renesas:rl78g22_fpb               2.0.0     RL78/G22 Fast Prototyping Board                                                   

renesas:rl78g23_fpb_p64           2.0.0     RL78/G23-64p Fast Prototyping Board                                               

Microsoft:win10                   1.1.2     Windows 10 Iot Core                                                               

arduino:mbed                      3.3.0     [DEPRECATED] [DEPRECATED - Please install standalone packages] Arduino Mbed OS Boards

The arduino-cli board list correctly identities the connected board name, FQBN and the core (arduino:mbed_nicla).

PS C:\Users\Ali Jahangiri\Documents\GitHub\nicla-sense-me-fw> arduino-cli board list
Port Protocol Type              Board Name           FQBN                            Core
COM3 serial   Serial Port       Unknown
COM4 serial   Serial Port       Unknown
COM7 serial   Serial Port (USB) Arduino Nicla Vision arduino:mbed_nicla:nicla_vision arduino:mbed_nicla

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
@aliphys aliphys added the type: imperfection Perceived defect in any part of project label Jun 20, 2023
@aliphys
Copy link
Author

aliphys commented Jun 20, 2023

This is a newly setup laptop, so there were no cores installed previously. I have not installed the Arduino 2.x IDE either. I installed the core for the Nicla Vision, which triggered the install of USB drivers as well.

PS C:\Users\Ali Jahangiri\Documents\GitHub\nicla-sense-me-fw> arduino-cli core install arduino:mbed_nicla
Downloading packages...
arduino:[email protected] downloaded
arduino:arm-none-eabi-gcc@7-2017q4 downloaded
arduino:[email protected] downloaded
arduino:[email protected] downloaded
arduino:[email protected] downloaded
arduino:[email protected] downloaded
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing arduino:arm-none-eabi-gcc@7-2017q4...
Configuring tool....
arduino:arm-none-eabi-gcc@7-2017q4 installed
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing arduino:[email protected]...
Configuring tool....
arduino:[email protected] installed
Installing platform arduino:[email protected]...
Configuring platform....
Platform arduino:[email protected] installed

When the arduino-cli core list command after the core is installed is run, the newly installed core is displayed.

PS C:\Users\Ali Jahangiri\Documents\GitHub\nicla-sense-me-fw> arduino-cli core list      
ID                 Installed Latest Name
arduino:mbed_nicla 4.0.2     4.0.2  Arduino Mbed OS Nicla Boards

@aliphys
Copy link
Author

aliphys commented Jun 20, 2023

Possible solution: replace this line

return &rpc.PlatformListResponse{InstalledPlatforms: res}, nil

With this

// Inform user if there are no installed platforms, 
if len(res) == 0 {
    return nil, fmt.Errorf("No platforms installed.")
}
return &rpc.PlatformListResponse{InstalledPlatforms: res}, nil

@aliphys aliphys changed the title [AE-111] core list command gives no output [AE-111] core list command gives no output when no platforsm are installed Jun 20, 2023
@aliphys aliphys changed the title [AE-111] core list command gives no output when no platforsm are installed [AE-111] core list command gives no output when no platforms are installed Jun 20, 2023
@alessio-perugini
Copy link
Contributor

alessio-perugini commented Jun 23, 2023

@aliphys 👋 Thanks for reporting this. I agree with you. When we have no installed cores it's not clear what's going on.
Currently, when no cores are installed, we print only if we pass the --format json flag. (The result is an empty array []).

I wouldn't return any error on the API level, as this kind of thing should be inferred by the length of the data we receive. But your suggestion is still valid it just needs to be implemented in a different place 🤓

We have two options:

  1. Print a self-explanatory message like your suggestion:
$ arduino-cli core list
No platforms installed.
  1. Print only the table headers:
$ arduino-cli core list
ID Installed Latest Name

@alessio-perugini alessio-perugini self-assigned this Jul 3, 2023
@per1234 per1234 added conclusion: resolved Issue was resolved topic: code Related to content of the project itself labels Jul 6, 2023
@per1234 per1234 changed the title [AE-111] core list command gives no output when no platforms are installed core list command gives no output when no platforms are installed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
3 participants