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

Sample command to solve compile or upload issue is now shown to CLI users #1647

Merged
merged 4 commits into from
Feb 1, 2022

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Enhances certain error messages of compile and upload commands.

  • What is the current behavior?
$ arduino-cli core list


$ arduino-cli compile -b arduino:samd:nano_33_iot ~/Arduino/Blink

Error during build: Platform 'arduino:samd' not found: platform not installed

$ arduino-cli compile -b adafruit:samd:adafruit_feather_m4 ~/Arduino/Blink

Error during build: Platform 'adafruit:samd' not found: platform not installed

$ arduino-cli upload -b arduino:samd:nano_33_iot ~/Arduino/Blink -p /dev/ttyACM1
Error during Upload: Unknown FQBN: platform arduino:samd is not installed

$ arduino-cli upload -b adafruit:samd:adafruit_feather_m4 ~/Arduino/Blink -p /dev/ttyACM1
Error during Upload: Unknown FQBN: unknown package adafruit
  • What is the new behavior?
$ arduino-cli core list


$ arduino-cli compile -b arduino:samd:nano_33_iot ~/Arduino/Blink

Error during build: Platform 'arduino:samd' not found: platform not installed
Try running `arduino-cli core install arduino:samd`

$ arduino-cli compile -b adafruit:samd:adafruit_feather_m4 ~/Arduino/Blink

Error during build: Platform 'adafruit:samd' not found: platform not installed
Platform adafruit:samd is not found in any known index

$ arduino-cli upload -b arduino:samd:nano_33_iot ~/Arduino/Blink -p /dev/ttyACM1
Error during Upload: Platform 'arduino:samd' not found: platform arduino:samd is not installed
Try running `arduino-cli core install arduino:samd`

$ arduino-cli upload -b adafruit:samd:adafruit_feather_m4 ~/Arduino/Blink -p /dev/ttyACM1
Error during Upload: Platform 'adafruit:samd' not found: unknown package adafruit
Platform adafruit:samd is not found in any known index

Nope.

  • Other information:

Closes #1356.


See how to contribute

@silvanocerza silvanocerza added type: enhancement Proposed improvement topic: CLI Related to the command line interface labels Jan 31, 2022
@silvanocerza silvanocerza self-assigned this Jan 31, 2022
cli/upload/upload.go Outdated Show resolved Hide resolved
@@ -264,6 +269,28 @@ func runCompileCommand(cmd *cobra.Command, args []string) {
})
if compileError != nil && output.OutputFormat != "json" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the added logic happens if output.OutputFormat != "json", this means that no error is returned in case the output is json

cli/compile/compile.go Outdated Show resolved Hide resolved
cli/upload/upload.go Outdated Show resolved Hide resolved
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very helpful enhancement.
Thanks Silvano!

@silvanocerza
Copy link
Contributor Author

Link check workflows are failing again, it's a false positive as usual. Merging anyway.

Thanks @per1234. <3

@silvanocerza silvanocerza merged commit 47c634b into master Feb 1, 2022
@silvanocerza silvanocerza deleted the scerza/suggest-command branch February 1, 2022 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide sample command to install missing platform
4 participants