Skip to content

Improved lib detection: check for matching name in library.properties #1276

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 4 commits into from
May 4, 2021

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented May 4, 2021

A library may be stored in a directory that doesn't match the library name, for example we had a case in the wild where the directories:

libraries/onewire_2_3_4/...
libraries/onewireng_1_2_3/...

were used instead of:

libraries/OneWire/...
libraries/OneWireNg/...

this lead to an incorrect selection of onewireng_1_2_3 when using OneWire.h (because OneWireNg had an architecture=avr that had priority over the architecture=* of onewire_2_3_4).

This commit will restore priority straight.

cmaglie added 3 commits May 4, 2021 12:41
The library may be stored in a directory that doesn't match the library
name, for example we had a case in the wild where the directories:

   libraries/onewire_2_3_4/...
   libraries/onewireng_1_2_3/...

were used instead of:

   libraries/OneWire/...
   libraries/OneWireNg/...

this lead to incorrect selection of onewireng_1_2_3 when using OneWire.h
(because the OneWireNg had an architecture=avr that had priority over
the architecture=* of onewire_2_3_4).

This commit will restore priority straight.
@cmaglie cmaglie requested a review from silvanocerza May 4, 2021 13:04
@cmaglie cmaglie merged commit 15e81ed into arduino:master May 4, 2021
@cmaglie cmaglie deleted the lib_prio_fix branch May 4, 2021 14:42
silvanocerza added a commit that referenced this pull request May 10, 2021
…#1276)

* Improved lib detection: check for matching name in library.properties

The library may be stored in a directory that doesn't match the library
name, for example we had a case in the wild where the directories:

   libraries/onewire_2_3_4/...
   libraries/onewireng_1_2_3/...

were used instead of:

   libraries/OneWire/...
   libraries/OneWireNg/...

this lead to incorrect selection of onewireng_1_2_3 when using OneWire.h
(because the OneWireNg had an architecture=avr that had priority over
the architecture=* of onewire_2_3_4).

This commit will restore priority straight.

* Added test for lib resolve improvement

* Lib discovery: always prefer libraries with the correct directory name

* [skip changelog] Add integration test

Co-authored-by: Silvano Cerza <[email protected]>
silvanocerza added a commit that referenced this pull request May 14, 2021
silvanocerza added a commit that referenced this pull request May 14, 2021
silvanocerza added a commit that referenced this pull request May 14, 2021
silvanocerza added a commit that referenced this pull request May 25, 2021
…#1276)

* Improved lib detection: check for matching name in library.properties

The library may be stored in a directory that doesn't match the library
name, for example we had a case in the wild where the directories:

   libraries/onewire_2_3_4/...
   libraries/onewireng_1_2_3/...

were used instead of:

   libraries/OneWire/...
   libraries/OneWireNg/...

this lead to incorrect selection of onewireng_1_2_3 when using OneWire.h
(because the OneWireNg had an architecture=avr that had priority over
the architecture=* of onewire_2_3_4).

This commit will restore priority straight.

* Added test for lib resolve improvement

* Lib discovery: always prefer libraries with the correct directory name

* [skip changelog] Add integration test

Co-authored-by: Silvano Cerza <[email protected]>
silvanocerza added a commit that referenced this pull request May 25, 2021
…#1276)

* Improved lib detection: check for matching name in library.properties

The library may be stored in a directory that doesn't match the library
name, for example we had a case in the wild where the directories:

   libraries/onewire_2_3_4/...
   libraries/onewireng_1_2_3/...

were used instead of:

   libraries/OneWire/...
   libraries/OneWireNg/...

this lead to incorrect selection of onewireng_1_2_3 when using OneWire.h
(because the OneWireNg had an architecture=avr that had priority over
the architecture=* of onewire_2_3_4).

This commit will restore priority straight.

* Added test for lib resolve improvement

* Lib discovery: always prefer libraries with the correct directory name

* [skip changelog] Add integration test

Co-authored-by: Silvano Cerza <[email protected]>
silvanocerza added a commit that referenced this pull request May 26, 2021
…#1276) (#1300)

* Improved lib detection: check for matching name in library.properties

The library may be stored in a directory that doesn't match the library
name, for example we had a case in the wild where the directories:

   libraries/onewire_2_3_4/...
   libraries/onewireng_1_2_3/...

were used instead of:

   libraries/OneWire/...
   libraries/OneWireNg/...

this lead to incorrect selection of onewireng_1_2_3 when using OneWire.h
(because the OneWireNg had an architecture=avr that had priority over
the architecture=* of onewire_2_3_4).

This commit will restore priority straight.

* Added test for lib resolve improvement

* Lib discovery: always prefer libraries with the correct directory name

* [skip changelog] Add integration test

Co-authored-by: Silvano Cerza <[email protected]>

Co-authored-by: Cristian Maglie <[email protected]>
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants