From 0aa6daf04d90a864b5cffd39f777125ac579d296 Mon Sep 17 00:00:00 2001 From: Peter Dragun Date: Mon, 1 Dec 2025 16:11:58 +0100 Subject: [PATCH 1/2] fix(tools/idf.py): Add implicit dependencies to flash targets --- tools/idf_py_actions/serial_ext.py | 18 ++++++++++++------ tools/test_idf_py/test_idf_py.py | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tools/idf_py_actions/serial_ext.py b/tools/idf_py_actions/serial_ext.py index d1b5f47fb9..cc2b871c27 100644 --- a/tools/idf_py_actions/serial_ext.py +++ b/tools/idf_py_actions/serial_ext.py @@ -641,7 +641,8 @@ def action_extensions(base_actions: dict, project_path: str) -> dict: 'callback': flash, 'help': 'Flash the project.', 'options': global_options + flash_options, - 'order_dependencies': ['all', 'erase-flash'], + 'order_dependencies': ['erase-flash'], + 'dependencies': ['all'], }, 'erase-flash': { 'callback': erase_flash, @@ -1178,31 +1179,36 @@ def action_extensions(base_actions: dict, project_path: str) -> dict: 'callback': flash, 'help': 'Flash partition table only.', 'options': flash_options, - 'order_dependencies': ['partition-table', 'erase-flash'], + 'order_dependencies': ['erase-flash'], + 'dependencies': ['partition-table'], }, 'bootloader-flash': { 'callback': flash, 'help': 'Flash bootloader only.', 'options': flash_options, - 'order_dependencies': ['bootloader', 'erase-flash'], + 'order_dependencies': ['erase-flash'], + 'dependencies': ['bootloader'], }, 'app-flash': { 'callback': flash, 'help': 'Flash the app only.', 'options': flash_options, - 'order_dependencies': ['app', 'erase-flash'], + 'order_dependencies': ['erase-flash'], + 'dependencies': ['app'], }, 'encrypted-app-flash': { 'callback': flash, 'help': 'Flash the encrypted app only.', 'options': flash_options, - 'order_dependencies': ['app', 'erase-flash'], + 'order_dependencies': ['erase-flash'], + 'dependencies': ['app'], }, 'encrypted-flash': { 'callback': flash, 'help': 'Flash the encrypted project.', 'options': flash_options, - 'order_dependencies': ['all', 'erase-flash'], + 'order_dependencies': ['erase-flash'], + 'dependencies': ['all'], }, 'erase-otadata': { 'callback': ota_targets, diff --git a/tools/test_idf_py/test_idf_py.py b/tools/test_idf_py/test_idf_py.py index 18b1dfa16b..f00f253eed 100755 --- a/tools/test_idf_py/test_idf_py.py +++ b/tools/test_idf_py/test_idf_py.py @@ -99,7 +99,7 @@ class TestDependencyManagement(TestWithoutExtensions): args=['--dry-run', 'flash'], standalone_mode=False, ) - self.assertEqual(['flash'], list(result.keys())) + self.assertEqual(['all', 'flash'], list(result.keys())) def test_order_only_dependencies(self): result = idf.init_cli()( @@ -120,7 +120,7 @@ class TestDependencyManagement(TestWithoutExtensions): args=['--dry-run', 'clean', 'monitor', 'clean', 'fullclean', 'flash'], standalone_mode=False, ) - self.assertEqual(['fullclean', 'clean', 'flash', 'monitor'], list(result.keys())) + self.assertEqual(['fullclean', 'clean', 'all', 'flash', 'monitor'], list(result.keys())) def test_dupplicated_commands_warning(self): capturedOutput = StringIO() From 1fbf10c3cf4db2469ab3e18e0a2723d5fa3e6bb3 Mon Sep 17 00:00:00 2001 From: Peter Dragun Date: Mon, 1 Dec 2025 16:14:09 +0100 Subject: [PATCH 2/2] fix: Add partition_table as a dependency to the partition-table-flash target --- components/partition_table/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 53154d612f..da57cbea2b 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -175,6 +175,8 @@ if(CONFIG_APP_BUILD_GENERATE_BINARIES AND CONFIG_APP_BUILD_TYPE_APP_2NDBOOT) esptool_py_flash_target_image(flash partition-table "${PARTITION_TABLE_OFFSET}" "${build_dir}/partition_table/${final_partition_bin}") + # Add partition table as a dependency to the partition-table-flash target + add_dependencies(partition-table-flash partition-table) # Add partition table as a dependency to the flash target add_dependencies(flash partition_table_bin)