Skip to content

Builder is unable to find generic libraries for 3rd party boards #97

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
dberenguer opened this issue Jan 18, 2016 · 3 comments · Fixed by #152
Closed

Builder is unable to find generic libraries for 3rd party boards #97

dberenguer opened this issue Jan 18, 2016 · 3 comments · Fixed by #152
Milestone

Comments

@dberenguer
Copy link

Issue #83 is not totally fixed. Using platform-generic libraries (under SKETCHES/libraries/) from 3rd-party boards does not work. Libraries cannot be found by the builder.

I tested the SWAP library:
https://github.com/panStamp/swap

with this example:
https://github.com/panStamp/swap/tree/master/examples/binouts

for panStamp NRG2 board:
http://panstamp.org/arduino/package_panstamp_index.json

@dberenguer
Copy link
Author

Any on-going work regarding this issue? 1.6.8 is still showing the problem.

We're using IDE 1.6.5 in the meantime.

@matthijskooijman
Copy link
Collaborator

Turns out the fix that was applied only worked for includes directly from the main .ino file. When scanning the compiler error output for missing includes, it only looked at the first line. However, when the .ino file includes a .h file in the sketch, which again includes a .h file from a library, the output looks like:

In file included from /tmp/arduino_modified_sketch_815412/binouts.ino:52:0:
/tmp/arduino_build_static/sketch/regtable.h:31:22: fatal error: register.h: No such file or directory

So the error in the first line is not found. The fix is of course simple: Scan all lines instead of just the first. I'll prepare a PR in a minute.

matthijskooijman added a commit to matthijskooijman/arduino-builder that referenced this issue May 18, 2016
The primary way to detect includes is to scan the compiler error output
for "#include" lines. However, older gcc versions did not print the
error line itself, only a message about the error, which would not be
detected. In bd5d3ec (Fix include resolution for older compilers), a
fallback was added to scan for "fatal error" followed by the missing
include filename, but that fallback only looked at the first line of the
error output.

When the missing #include line is not in the source file being compiled,
but in an included file, the error message would something like this:

	In file included from binouts.ino:52:0:
	regtable.h:31:22: fatal error: register.h: No such file or directory

So the filename that should be found is in the second line (or further).
This commit changes the fallback process to keep scanning lines of
compiler output, until one is found, instead of only looking at the
first line.

This fixes arduino#97.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
@dberenguer
Copy link
Author

Thanks @matthijskooijman!

Looking forward to testing the fix on the next release.

@cmaglie cmaglie added this to the 1.3.19 milestone May 23, 2016
facchinm added a commit that referenced this issue May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants