Skip to content

Fix compile error message not printed to correct writer on error #1523

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

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requestsx
    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?

Fixes an issue with compile command and related gRPC function.

  • What is the current behavior?

If the user tries to compile a Sketch that includes a library that's not installed an error is printed to stderr.

The gRPC interface doesn't show the error at all.

$ arduino-cli compile -b arduino:avr:uno /home/alien/Arduino/Blink/Blink.ino --format json
/home/alien/Arduino/Blink/Blink.ino:1:10: fatal error: SD: No such file or directory
 #include <SD>
          ^~~~
compilation terminated.
{
  "compiler_out": "",
  "compiler_err": "",
  "builder_result": {
    "build_path": "/tmp/arduino-sketch-302F70E5AC1B118F7324375770CFA163"
  },
  "success": false
}
  • What is the new behavior?

Compilation of a Sketch that includes a library not installed now correctly prints the error to the expected error stream.
This also fixes the gRPC function.

$ arduino-cli compile -b arduino:avr:uno /home/alien/Arduino/Blink/Blink.ino --format json
{
  "compiler_out": "",
  "compiler_err": "/home/alien/Arduino/Blink/Blink.ino:1:10: fatal error: SD: No such file or directory\n #include \u003cSD\u003e\n          ^~~~\ncompilation terminated.\n",
  "builder_result": {
    "build_path": "/tmp/arduino-sketch-302F70E5AC1B118F7324375770CFA163"
  },
  "success": false
}

Nope.

  • Other information:

None.


See how to contribute

@silvanocerza silvanocerza added type: imperfection Perceived defect in any part of project topic: CLI Related to the command line interface topic: gRPC Related to the gRPC interface labels Oct 20, 2021
@silvanocerza silvanocerza requested a review from a team October 20, 2021 08:11
@silvanocerza silvanocerza self-assigned this Oct 20, 2021
@silvanocerza silvanocerza force-pushed the scerza/enhance-compile-error-message branch from 857d5f3 to 06d97b0 Compare October 20, 2021 08:14
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 topic: gRPC Related to the gRPC interface type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants