-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Problem in build process when library include another library #3877
Comments
Hmm, after trying it again, it seems that my last sentence is not true : if library A is modified and recompiled, the compilation fails, as expected. I agree that it is a rather rare case and that the solution (recompilation everytime include list is changed) is maybe not better than the problem. Up to you to decide |
This is a known limitation of the IDE. There is no library to library dependency resolution. Some work has been done with upcoming 1.6.6 and its new |
@ffisore, I actually think the behaviour that this issue described is not that dependencies between libraries are not supported, but it's that if the sketch is modified to include different libraries, which changes the environment (include path) for all libraries, those libraries are not recompiled, potentially causing unexpected results. In practice, this is a corner case that will mostly change behaviour in cases that are already broken I think, but it might be nice to fix it anyway. A quick fix is to add the list of libraries, or the include path, to the build properties JSON that used to decide wether to recompile all. A better fix (now that library-to-library dependencies are supported) would be to give each library its own include path (based on detecting the dependencies of just that library), instead of building one big include path based on the joint dependencies of all libraries. This could even prevent conflicts in some cases (consider two libraries each depending on one of two other libraries that provide the same (secondary) header file, which will now certainly cause a conflict). |
@matthijskooijman , your interpretation is correct. Thanks |
So what does " library-to-library dependencies are supported" really mean? |
The new arduino-builder in git master / hourly builds does exactly this (though it isn't perfect yet, should be perfected soon). |
Well, since library-to-library dependencies haven't been supported in any official release yet, changing this behaviour now won't cause any compatibility issues (which is an extra reason to tackle this right away, instead of waiting). @descampsa, could you perhaps try the hourly build to confirm this issue is also present there, and if so open an issue in the arduino-builder repository (which is where this should really be fixed)? |
@bperrybap - Are you running the latest hourly build? (or any of them from the last several days) Much has changed recently with the new builder program. |
Paul, |
Yeah, i meant it could break some code that use unsuported features, but you're right, it shoud'nt break any officially supported feature.
Ok, i will do that. |
Also asking here: can you provide an example sketch + libraries, even fake libraries? |
Closing as tracked at arduino/arduino-builder#22 |
I think i've found a quirk in the build process, described below:
If you compile a library A that include header of another library B, without including library B in the skecth, compilation fails, which is normal (according to your build process works, at least).
But, if you include library B in the skecth, compile, and then remove the include of library B, it will still compile fine (link will fail if you actually use library B, but that's not the point). This is true even if library A is modified and recompiled.
Tested with version 1.6.5
The text was updated successfully, but these errors were encountered: