From b957fb07121869f44826ea1f60fd7b3ba772eb78 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 25 Aug 2026 23:16:18 -0500 Subject: [PATCH] Keep the missing-manifest diagnostic at debug The legacy manifest-less layout is legal and the 3.1.2 core ships one such library (FSTools), so the warning would be unactionable noise; a test now pins the level. --- esphome/arduino/library.py | 7 ++++--- tests/unit_tests/test_arduino_library.py | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/esphome/arduino/library.py b/esphome/arduino/library.py index d62f005797..dd1b738ac6 100644 --- a/esphome/arduino/library.py +++ b/esphome/arduino/library.py @@ -267,9 +267,10 @@ def _bundled_library(framework_path: Path, name: str) -> ArduinoLibrary: elif (manifest := lib_dir / "library.properties").is_file(): data = parse_library_properties(manifest) else: - # Visible: core libraries all ship a manifest, so an absent one - # most likely means a torn framework extraction - _LOGGER.warning("Bundled library %s has no manifest; using defaults", name) + # Debug, not warning: the legacy manifest-less layout is legal and + # the 3.1.2 core ships one such library (FSTools), so a warning + # would be unactionable noise on every build using it + _LOGGER.debug("Bundled library %s has no manifest; using defaults", name) data = {} if isinstance(data, dict): # Bundled manifest deps are never walked; make the skip visible diff --git a/tests/unit_tests/test_arduino_library.py b/tests/unit_tests/test_arduino_library.py index dcadb47317..87de28cf32 100644 --- a/tests/unit_tests/test_arduino_library.py +++ b/tests/unit_tests/test_arduino_library.py @@ -4,6 +4,7 @@ from __future__ import annotations from contextlib import contextmanager import json +import logging from pathlib import Path from unittest.mock import patch @@ -900,6 +901,18 @@ def test_bundled_library_non_dict_manifest_skips_probes_and_raises( component._bundled_library(framework, "Wire") +def test_bundled_missing_manifest_is_debug_only( + tmp_path: Path, caplog: pytest.LogCaptureFixture +) -> None: + """The legacy manifest-less layout is legal (the core ships FSTools + without one), so the diagnostic must stay below warning level.""" + framework = _make_framework(tmp_path) + with caplog.at_level(logging.DEBUG): + component._bundled_library(framework, "Wire") + record = next(r for r in caplog.records if "has no manifest" in r.message) + assert record.levelno == logging.DEBUG + + def test_bundled_corrupt_library_json_fails_by_name(tmp_path: Path) -> None: """A truncated bundled library.json fails with the library name and the clean-all hint, not a raw JSONDecodeError."""