mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
Reconcile version-less provides() skips and quiet the drop warning for treeless backends
A version-less dependency the walk skips on the backend's promise is now recorded like the versioned path, and a bundled candidate the backend knowingly skips through the platform filter counts as satisfied, so the post-emit reconciliation covers both paths without raising on legitimate builds. The manifest-name warning deduplicates like its sibling, the final drop warning stays at debug for backends without provides() since they can never supply a bundled name, and a bundled library missing both manifests leaves a debug trace instead of silently building on defaults.
This commit is contained in:
@@ -264,6 +264,10 @@ def _bundled_library(framework_path: Path, name: str) -> ArduinoLibrary:
|
||||
data = parse_library_json(manifest_json)
|
||||
else:
|
||||
manifest = lib_dir / "library.properties"
|
||||
if not manifest.is_file():
|
||||
# Defaults still build core libraries correctly, but a missing
|
||||
# manifest can also mean a torn framework extraction
|
||||
_LOGGER.debug("Bundled library %s has no manifest; using defaults", name)
|
||||
data = parse_library_properties(manifest) if manifest.is_file() else {}
|
||||
if isinstance(data, dict):
|
||||
# Bundled manifest deps are never walked; make the skip visible
|
||||
@@ -384,6 +388,9 @@ def resolve_libraries(
|
||||
converted: list[ArduinoLibrary] = []
|
||||
bundled_names = {lib.name for lib in bundled}
|
||||
converted_manifest_names: set[str] = set()
|
||||
# Bundled candidates skipped on purpose (platform filter); the
|
||||
# provides() reconciliation must count them as satisfied
|
||||
knowingly_skipped: set[str] = set()
|
||||
# Ordered set of bundled dependency names to add once conversion is done
|
||||
pending_bundled: dict[str, None] = {}
|
||||
# Deps matching a separately-requested external are already in the build
|
||||
@@ -454,6 +461,9 @@ def resolve_libraries(
|
||||
# which fails if the walk stops evaluating these deps.
|
||||
check_library_data(dep, pio_platform, None)
|
||||
except InvalidLibrary as err:
|
||||
# A knowing skip (platform filter), not a broken promise;
|
||||
# the reconciliation must accept it as satisfied
|
||||
knowingly_skipped.add(name)
|
||||
_LOGGER.debug("Skip bundled candidate %s: %s", name, err)
|
||||
continue
|
||||
# Deferred: a later-emitted library's manifest name may satisfy
|
||||
@@ -513,7 +523,10 @@ def resolve_libraries(
|
||||
|
||||
_check_unfulfilled_provides(
|
||||
backend.provided_requests,
|
||||
bundled_names | converted_manifest_names | external_short_names,
|
||||
bundled_names
|
||||
| converted_manifest_names
|
||||
| external_short_names
|
||||
| knowingly_skipped,
|
||||
)
|
||||
|
||||
return bundled + converted
|
||||
|
||||
@@ -945,6 +945,7 @@ def _warn_unsatisfied_versionless(
|
||||
# Name-only evidence: any resolved component with this manifest
|
||||
# name counts, not just ones the requester can reach, so a
|
||||
# coincidental name collision must stay visible
|
||||
warned.add(dep_name)
|
||||
_LOGGER.warning(
|
||||
"Version-less dependency %s of %s assumed satisfied by a "
|
||||
"resolved library's manifest name only",
|
||||
@@ -959,10 +960,16 @@ def _warn_unsatisfied_versionless(
|
||||
):
|
||||
# provides() only satisfies owner-less names: the walk's
|
||||
# backend-provided skip has the same owner guard, so an
|
||||
# owner-qualified version-less dep was added by nobody
|
||||
# owner-qualified version-less dep was added by nobody.
|
||||
# Recorded so the backend's post-emit reconciliation covers
|
||||
# this path like the versioned one
|
||||
backend.provided_requests.append(dep_name)
|
||||
continue
|
||||
warned.add(dep_name)
|
||||
_LOGGER.warning(
|
||||
# A backend with no framework tree can never supply a bundled
|
||||
# name, so for it this is unactionable noise
|
||||
log = _LOGGER.warning if backend.provides is not None else _LOGGER.debug
|
||||
log(
|
||||
"Dependency %s of %s has no version to resolve and nothing "
|
||||
"provides it; skipping",
|
||||
dep_name,
|
||||
|
||||
Reference in New Issue
Block a user