-
-
Notifications
You must be signed in to change notification settings - Fork 6
Update check on debug config generation fail #30
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When sketch debugging is initiated, the extension runs Arduino CLI to get the debugger configuration information. This information is required to generate the `launch.json` configuration file. As part of this information is the path to the compiled sketch binary, Arduino CLI checks for the existence of that file, and errors if it is not present (which is usually caused by the user having neglected to compile the sketch): ``` Error getting Debug info: Compiled sketch not found in ... ``` The extension has special handling for this specific common error cause, which is based on a fragile string comparison on the human readable error message. As is the nature of this approach, a seemingly innocuous capitalization change to the message in the Arduino CLI code base broke the check. The quick fix provided here is making the check case insensitive.
@per1234
per1234
added
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
labels
Feb 4, 2022
@per1234
per1234
requested review from
davegarthsimpson,
francescospissu and
kittaakos
and removed request for
silvanocerza
July 31, 2022 21:12
kittaakos
kittaakos
approved these changes
Aug 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking care of this 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When sketch debugging is initiated, the extension runs Arduino CLI to get the debugger configuration information. This information is required to generate the
launch.json
configuration file.As part of this information is the path to the compiled sketch binary, Arduino CLI checks for the existence of that file, and errors if it is not present (which is usually caused by the user having neglected to compile the sketch):
The extension has special handling for this specific common error cause, which is based on a fragile string comparison on the human readable error message. As is the nature of such an approach, a seemingly innocuous capitalization change to the message in the Arduino CLI code base (arduino/arduino-cli@75b9760) broke the check.
The quick fix provided here is making the check case insensitive.
NOTE: this is not a true fix. The human readable error message string may change at any time, and is guaranteed to change if non-English localization is enabled.
However, it is less broken after this simple change, and the check is not critical, so I think it is still worthwhile.