mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 10:56:43 +00:00
Fix build system to relink when source files change
- Make copy_file_if_changed() return bool indicating if file was copied - Track sources_changed in copy_src_tree() to detect when source files change - Only update build_info timestamp when sources/config/version change - Exclude generated files (build_info_data.h) from sources_changed tracking - Add build_info_data.h to ignore_targets to prevent copying from resources - Track changes to generated headers (defines.h, esphome.h, version.h) - Check for config_hash or version changes to trigger rebuild - Pretty-print build_info.json with indentation and trailing newline - Update mock_copy_file_if_changed to return True by default This fixes the issue where changing a source file would recompile the .o file but not relink the final program executable.
This commit is contained in:
@@ -58,6 +58,7 @@ def mock_write_file_if_changed() -> Generator[Mock, None, None]:
|
||||
def mock_copy_file_if_changed() -> Generator[Mock, None, None]:
|
||||
"""Mock copy_file_if_changed for core.config."""
|
||||
with patch("esphome.core.config.copy_file_if_changed") as mock:
|
||||
mock.return_value = True
|
||||
yield mock
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user