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

Fix path in error messages on sketch loading #1805

Merged
merged 5 commits into from
Jul 18, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jul 14, 2022

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?

What is the current behavior?

$ arduino-cli version
arduino-cli.exe  Version: git-snapshot Commit: 6ac5f7a3 Date: 2022-07-09T19:16:18Z

$ mkdir /tmp/Arduino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma
Error opening sketch: no valid sketch found in C:\Users\per\AppData\Local\Temp\Arduino: missing C:\Users\per\AppData\Local\Temp\Arduino\Arduino.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/alma.ino
Error opening sketch: reading files: open C:\Users\per\AppData\Local\Temp\Arduino\alma: The system cannot find the file specified.

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/nonexistent
Error opening sketch: reading files: open C:\Users\per\AppData\Local\Temp\Arduino\alma: The system cannot find the file specified.

What is the new behavior?

$ arduino-cli version
arduino-cli.exe  Version: git-snapshot Commit: 6ac5f7a3 Date: 2022-07-09T19:16:18Z

$ mkdir /tmp/Arduino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma
Error opening sketch: main file missing from sketch: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/alma.ino
Error opening sketch: main file missing from sketch: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/nonexistent
Error opening sketch: main file missing from sketch: /tmp/Arduino/alma/nonexistent/nonexistent.ino

Does this PR introduce a breaking change, and is
titled accordingly?

No

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jul 14, 2022
@cmaglie cmaglie self-assigned this Jul 14, 2022
@kittaakos
Copy link
Contributor

main file missing from sketch: /tmp/Arduino/alma/alma.ino

I am not sure about it. The problem is not the missing main file from the sketch, but the sketch does not exist.

@cmaglie
Copy link
Member Author

cmaglie commented Jul 15, 2022

Ok, it should be better now:

$ mkdir /tmp/Arduino
$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma
Error opening sketch: no such file or directory: /tmp/Arduino/alma

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/alma.ino
Error opening sketch: no such file or directory: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/nonexistent
Error opening sketch: no such file or directory: /tmp/Arduino/alma/nonexistent

$ mkdir /tmp/Arduino/alma

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma
Error opening sketch: main file missing from sketch: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/alma.ino
Error opening sketch: no such file or directory: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/nonexistent
Error opening sketch: no such file or directory: /tmp/Arduino/alma/nonexistent

$ touch /tmp/Arduino/alma/asd.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma
Error opening sketch: main file missing from sketch: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/asd.ino 
Error opening sketch: main file missing from sketch: /tmp/Arduino/alma/alma.ino

$ arduino-cli compile -b arduino:avr:uno /tmp/Arduino/alma/nonexistent
Error opening sketch: no such file or directory: /tmp/Arduino/alma/nonexistent

@cmaglie cmaglie merged commit f0b218a into arduino:master Jul 18, 2022
@cmaglie cmaglie deleted the fix_error_message branch July 18, 2022 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect error details when the LoadSketchRequest fails with NOT_FOUND error
4 participants