@@ -97,7 +97,7 @@ def _size_row_from_artifact(build_dir: Path) -> Optional[tuple[int, int, int]]:
9797 try :
9898 res = subprocess .run (
9999 [cross_size , "--format=berkeley" , str (elf_file )],
100- capture_output = True , text = True , check = True
100+ capture_output = True , text = True , check = True , timeout = 3
101101 )
102102 except Exception :
103103 return None
@@ -127,7 +127,7 @@ def _artifact_region_usage_from_objdump(build_dir: Path) -> Optional[dict[str, i
127127 try :
128128 res = subprocess .run (
129129 [cross_objdump , "-h" , str (elf_file )],
130- capture_output = True , text = True , check = True
130+ capture_output = True , text = True , check = True , timeout = 3
131131 )
132132 except Exception :
133133 return None
@@ -303,6 +303,10 @@ def _generator_configure_args() -> list[str]:
303303 return args
304304
305305
306+ def _ninja_build_files_ready (build_dir : Path ) -> bool :
307+ return (build_dir / "CMakeCache.txt" ).is_file () and (build_dir / "build.ninja" ).is_file ()
308+
309+
306310def cmake_configure_args (cmake : Path , keyboard : str , profile : str , build_dir : Path ) -> list [str ]:
307311 build_type = {"release" : "MinSizeRel" , "debug" : "Debug" }[profile ]
308312 return [
@@ -423,7 +427,7 @@ def build(keyboard: str, profile: str) -> Path:
423427 cached_keyboard = _parse_cmake_cache_var (cache_file , "KEYBOARD" )
424428 cached_model = _parse_cmake_cache_var (cache_file , "KBD_MODEL" )
425429 if (
426- not cache_file . is_file ( )
430+ not _ninja_build_files_ready ( build_dir )
427431 or (cached_keyboard and _normalize_keyboard (cached_keyboard ) != keyboard )
428432 or (cached_model and _normalize_keyboard (cached_model ) != keyboard )
429433 ):
@@ -573,7 +577,7 @@ def bootloader_build() -> Path:
573577
574578 build_dir = IAP_BUILD_DIR
575579 cache_file = build_dir / "CMakeCache.txt"
576- if not cache_file . is_file ( ):
580+ if not _ninja_build_files_ready ( build_dir ):
577581 bootloader_configure ()
578582
579583 sep ()
@@ -632,7 +636,7 @@ def jumpiap_build() -> Path:
632636
633637 build_dir = JUMPIAP_BUILD_DIR
634638 cache_file = build_dir / "CMakeCache.txt"
635- if not cache_file . is_file ( ):
639+ if not _ninja_build_files_ready ( build_dir ):
636640 jumpiap_configure ()
637641
638642 sep ()
0 commit comments