Skip to content

Advise of duplicate libraries after compiling #2850

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

Merged
merged 1 commit into from
Apr 1, 2015
Merged

Advise of duplicate libraries after compiling #2850

merged 1 commit into from
Apr 1, 2015

Conversation

PaulStoffregen
Copy link
Contributor

When 2 or more libraries match to the same #include in the sketch, this prints a helpful message after compiling. As discussed on issue #2847 and the mail list...

Internally, this change extends LibrariesIndexer to keep another list of libraries which includes duplicates. In BaseNoGui, importToLibraryTable is extended to map header names to LibraryList objects, instead of only a single UserLibrary object. The building of importToLibraryTable is improved to also add the duplicates found by LibrariesIndexer. Compiler is extended to use the new importToLibraryTable, and take note of any LibraryList is uses with more than 1 library. After compiling, those are used to print the helpful message.

@PaulStoffregen
Copy link
Contributor Author

Here's an example of the message, when a copy of SPI is placed in the user's sketchbook libraries folder:

duplicate_lib_message

@PaulStoffregen
Copy link
Contributor Author

Here's another example, when the copy of SPI in the sketchbook libraries is an old copy from Arduino 1.0.6. For users who long-ago made copies of libraries that later conflict or need to be updated, this pull request adds a nice message where they would have only seen difficult compile errors from deep within the libraries.

duplicate_lib_message2

@PaulStoffregen
Copy link
Contributor Author

Please consider merging this before the 1.6.3 release. It's very low risk. The only practical effect is printing a message, so in a worst case scenario, it prints a confusing message. No actual build behavior is changed.

I'd like to move forward on redoing the library dependency detection (1.6.2 broke that pull request). I want to build more pull requests for more features on top of this work, so I'm really hoping you can find a few moments to review this low risk change and merge it.

ffissore added a commit that referenced this pull request Apr 1, 2015
Advise of duplicate libraries after compiling
@ffissore ffissore merged commit f76d1d5 into arduino:master Apr 1, 2015
@ffissore
Copy link
Contributor

ffissore commented Apr 1, 2015

Thanks @PaulStoffregen

@PaulStoffregen
Copy link
Contributor Author

thanks :)

@PaulStoffregen
Copy link
Contributor Author

Just want to say thanks again for adding this. I know it was tight timing to squeeze it in between 1.6.2 and 1.6.3 and I really appreciate your effort.

This patch is really helping with end user support on forums! Here's a perfect example:
https://forums.adafruit.com/viewtopic.php?f=47&t=79059&p=405524#p405503

@ffissore
Copy link
Contributor

🎱

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 this pull request may close these issues.

3 participants