Skip to content

Commit b02661a

Browse files
committed
Merge branch 'bugfix/fix_sdkconfig_json_stale' into 'main'
fix(esp_board_manager): Delete stale build/config/sdkconfig.json after updating sdkconfig See merge request adf/multimedia/esp-gmf!227
2 parents d1792f3 + 9dc91ec commit b02661a

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

packages/esp_board_manager/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.4.4
4+
5+
### Bug Fixes
6+
7+
- Delete build/config/sdkconfig.json after updating sdkconfig to ensure component manager uses the latest configuration
8+
39
## v0.4.3
410

511
### Bug Fixes

packages/esp_board_manager/generators/sdkconfig_manager.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def update_sdkconfig_from_board_types(self, device_types: Set[str], peripheral_t
173173
self.logger.info(f" Successfully updated sdkconfig with {len(result['enabled'])} changes")
174174
else:
175175
self.logger.info(f' Successfully created/updated sdkconfig file')
176+
177+
# Delete build/config/sdkconfig.json after updating sdkconfig
178+
self._delete_sdkconfig_json(sdkconfig_path)
176179
except Exception as e:
177180
self.logger.error(f'Error writing sdkconfig: {e}')
178181
return result
@@ -542,3 +545,25 @@ def _apply_target_updates(self, sdkconfig_content: str, chip_name: str) -> Tuple
542545

543546
return sdkconfig_content, changes
544547

548+
def _delete_sdkconfig_json(self, sdkconfig_path: str) -> None:
549+
"""
550+
Delete build/config/sdkconfig.json file after updating sdkconfig.
551+
552+
Args:
553+
sdkconfig_path: Path to sdkconfig file
554+
"""
555+
try:
556+
# Get project root directory from sdkconfig path
557+
sdkconfig_file = Path(sdkconfig_path)
558+
project_root = sdkconfig_file.parent
559+
# Build path to build/config/sdkconfig.json
560+
sdkconfig_json_path = project_root / 'build' / 'config' / 'sdkconfig.json'
561+
# Delete the file if it exists
562+
if sdkconfig_json_path.exists():
563+
sdkconfig_json_path.unlink()
564+
self.logger.debug(f' Deleted {sdkconfig_json_path}')
565+
else:
566+
self.logger.debug(f' {sdkconfig_json_path} does not exist, skipping deletion')
567+
except Exception as e:
568+
# Log warning but don't fail the operation
569+
self.logger.warning(f'⚠️ Failed to delete build/config/sdkconfig.json: {e}')

packages/esp_board_manager/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.4.3
1+
version: 0.4.4
22
description: Board manager for ESP-GMF
33
url: https://github.com/espressif/esp-gmf/tree/main/packages/esp_board_manager
44
documentation: https://github.com/espressif/esp-gmf/blob/main/packages/esp_board_manager/README.md

0 commit comments

Comments
 (0)