Skip to content

builtin discoveries active when custom discovery selected #1598

Closed
@ben-qnimble

Description

@ben-qnimble

Bug Report

All pluggable discoveries for all installed platforms are active regardless of active platform. Instead, only discoveries related to active platform should be active. I believe the intent is for each platform to specific its discoveries and only those to be active. Quoting from platform-specification:

For backward compatibility, if a platform does not declare any discovery (using the pluggable_discovery.* properties in platform.txt) it will automatically inherit builtin:serial-discovery and builtin:mdns-discovery (but not other builtin discoveries that may be possibly added in the future).

Currently, builtin:serial-discovery and builtin:mdns-discovery always installed and actively, regardless of if any pluggable_discovery.* properties are set.

Current behavior

configure platformA with

pluggable_discovery.required=discoveryA

and configure platformB with

pluggable_discovery.required=discoveryB

Then the following discoveries are active, regardless of whether platformA or platformB is active:

  • builtin:serial-discovery
  • builtin:mdns-discovery
  • platformA:discoveryA
  • platformB:discoveryB

Expected behavior

If platformA is active, only platformA:discoveryA should be active and vice versa.

Environment

Tested with d458040

Additional context

I think there needs to be a method to control the active discoveries separately from loading them. Currently, loadDiscovery (arduino/cores/packagemanager/loader.go) installs all the discovery, but it also actives them with pm.discoveryManager.Add(d) at the end of the code. I believe this should be removed and when setting up a new platform, only the discoveries in the platform should be added.

Metadata

Metadata

Assignees

Labels

conclusion: off topicOff topic for this repositorytopic: codeRelated to content of the project itself

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions