Skip to content

Error in Arduino-ci run because of typo in library.properties produces cryptic error #237

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
RobTillaart opened this issue Dec 7, 2020 · 3 comments · Fixed by #256
Closed
Labels
ci scripts The test runner scripts enhancement New feature or request
Milestone

Comments

@RobTillaart
Copy link

RobTillaart commented Dec 7, 2020

Issue Summary

Problem occurred during this run - https://github.com/RobTillaart/RunningAverage/runs/1506309632?check_suite_focus=true

The root cause was that in the library.properties file I had a typo in the line includes=RunningAverager.h instead of RunningAverage.h This caused an error in the unit test code stating that the #include file could not be found. It took some time to find the cause as the dependency was not obvious for me. Fixing the typo solved the problem.

The error message in the log file did not give any clue (see below).

Unit Test log , Illustrating the Problem

Snippet from the log file

Compiling ra_test.ino for arduino:avr:uno... 

Last command:  $  /usr/local/bin/arduino-cli --format json compile --fqbn arduino:avr:uno --warnings all --dry-run 
/github/home/Arduino/libraries/RunningAverage/examples/ra_test/ra_test.ino
/github/home/Arduino/libraries/RunningAverage/examples/ra_test/ra_test.ino:10:10: fatal error: RunningAverage.h: No such file or directory
 #include "RunningAverage.h" 

          ^~~~~~~~~~~~~~~~~~

Request

It would be good if

  • the dependency is documented
  • the test environment checks the dependencies somehow,
  • e.g. it checks the consistency of library.properties file and the library.json file

Thanks,
Rob

@ianfixes ianfixes added ci scripts The test runner scripts enhancement New feature or request rubygem Ruby code is affected and removed rubygem Ruby code is affected labels Dec 7, 2020
@ianfixes ianfixes changed the title Error in Arduino-ci run because of dependency on library.properties Error in Arduino-ci run because of typo in library.properties produces cryptic error Dec 14, 2020
@RobTillaart
Copy link
Author

#250 is indeed another example + some thoughts about solution in user terms.

@ianfixes
Copy link
Collaborator

via #250 -- check case sensitivity as well

Today I had a typo (case mismatch) in the field: includes=DHT.h which should be includes=dht.h
It took a while to find the root cause as the error message just said "#include <dht.h> not found.
The very same sketch compiled perfect in the IDE for years so that made me wonder.

Solutions

  1. a better error message why the #include is not found, e.g. what is expected.
  2. a script that verifies the fields of the library.properties file.
    All mandatory fields are available and correct?
  3. document this problem in an FAQ for known error messages
  4. ...

@ianfixes ianfixes added this to the 2020 Wrapup milestone Dec 23, 2020
@ianfixes
Copy link
Collaborator

ianfixes commented Jan 2, 2021

I've added scans for both the library dependencies (depends=) existence and includes (includes=) existence. Please try to outsmart my checks and let me know if I missed anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci scripts The test runner scripts enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants