Skip to content

library-to-library dependencies #22

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
descampsa opened this issue Sep 29, 2015 · 5 comments
Closed

library-to-library dependencies #22

descampsa opened this issue Sep 29, 2015 · 5 comments
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Milestone

Comments

@descampsa
Copy link

See arduino/Arduino#3877 for previous discussion.
The problem is that a library is not recompiled when the include list of the main sketch (or of another library) has changed, despite the compilation option (include paths) are modified.

Note that when library-to-library dependencies will be completely supported (#12), i think it will be harder to find a reasonnable case where it is really noticeable. The only one i can think of is the one suggested by matthijskooijman, with the conflicting secondary header files.

I still think however that the proposed solution (each library generates its own dependency list) would make more sense and avoid bad surprises in some corner cases.

@ffissore
Copy link
Contributor

@descampsa can you provide an example sketch + libraries, even fake libraries?

@ffissore ffissore self-assigned this Sep 30, 2015
@descampsa
Copy link
Author

descampsa commented Sep 30, 2015

Sure, here you have a (very) minimal example:
https://app.box.com/s/jkk2bk01l2y3omfdcakdbyhnk8kfj72w

  1. compile with #include <SoftwareSerial.h> commented in the sketch -> fail to find SoftwareSerial.h in Foo.cpp
  2. uncomment #include <SoftwareSerial.h> -> compile fine
  3. comment again -> still compile fine, because the library is not recompiled

If you want a real lib where this happened to me, see https://github.com/descampsa/ardyno.
You will have to replace the hacky #include <../../libraries/SoftwareSerial/SoftwareSerial.h> in DynamixelInterface.cpp to reproduce the same issue.

@ffissore
Copy link
Contributor

ffissore commented Oct 1, 2015

Uhm I see. I'm looking for a clean solution. In the meanwhile, move #include <SoftwareSerial.h> to Foo.h as that will leverage current library to library dependency discovery

@ffissore
Copy link
Contributor

Note to self: while this issue is still valid, it's not reproducible anymore with the given sketch, because arduino-builder is now able to discover SoftwareSerial dependency specified in Foo.cpp

@ffissore ffissore modified the milestones: 1.0.3, 1.0.4, 1.0.6 Oct 30, 2015
@ffissore ffissore added this to the 1.3.3 milestone Dec 1, 2015
@ffissore
Copy link
Contributor

ffissore commented Dec 1, 2015

@descampsa while I couldn't replicate this any more thanks to the smarter dependency discovery algorithm, I've also added a step that DELETES previously compiled libraries files IF those libraries are no longer used. Fix will be available with next hourly build http://www.arduino.cc/en/Main/Software#hourly

@ffissore ffissore closed this as completed Dec 1, 2015
@per1234 per1234 added type: imperfection Perceived defect in any part of project conclusion: resolved Issue was resolved topic: code Related to content of the project itself labels Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants