@@ -222,22 +222,19 @@ def _add_board_extra_flags(self, flags: Dict[str, List[str]]) -> None:
222222 if flag .startswith ("-D" ):
223223 flags ["common" ].append (flag )
224224
225- def _warn_debug_flags_in_quick_profile (self ) -> None :
226- """Warn if user has debug flags (-g*) in global build_flags during quick profile.
227-
228- In quick profile, fbuild defaults to -g0 (no debug info) for fast builds.
229- If the user puts -g/-g1/-g2/-g3 in build_flags, it overrides -g0 and applies
230- to ALL compilation (sketch, core, and libraries), massively inflating .o files
231- and slowing linking. The user likely intended debug info for their sketch only.
225+ def _warn_debug_build_flags (self ) -> None :
226+ """Warn if user has debug flags (-g*) in global build_flags.
227+
228+ Flags like -g, -g1, -g2, -g3 in build_flags apply to ALL compilation
229+ (sketch, core, and libraries), not just the user's own code. Compiling
230+ the framework with debug info massively inflates object files and slows
231+ linking — it is highly unlikely the user intended to debug the framework
232+ itself. Suggest moving the flag to build_src_flags so it only affects
233+ sketch files, or replacing it with -g0 to disable debug info entirely.
232234 """
233235 if self ._debug_flag_warning_shown :
234236 return
235237
236- from fbuild .build .build_profiles import BuildProfile
237-
238- if self .context .profile != BuildProfile .QUICK :
239- return
240-
241238 debug_flags = [f for f in self .user_build_flags if f == "-g" or (f .startswith ("-g" ) and f [2 :3 ] in ("0" , "1" , "2" , "3" , "g" , "d" ) and not f .startswith ("-gnone" ) and f != "-g0" )]
242239 if not debug_flags :
243240 return
@@ -249,8 +246,9 @@ def _warn_debug_flags_in_quick_profile(self) -> None:
249246 flag_str = " " .join (debug_flags )
250247 log_warning (
251248 f"build_flags contains '{ flag_str } ' which applies to ALL files (sketch, core, libraries).\n "
252- f" In quick profile this overrides the default -g0, inflating object files ~30x and slowing linking.\n "
253- f" Recommendation: move '{ flag_str } ' from build_flags to build_src_flags so it only applies to your sketch code."
249+ f" Compiling the framework with debug info inflates object files ~30x and massively slows linking.\n "
250+ f" Recommendation: move '{ flag_str } ' from build_flags to build_src_flags so it only applies to your sketch code,\n "
251+ f" or replace it with '-g0' in build_flags to disable debug info for all files."
254252 )
255253
256254 def _add_user_flags (self , flags : Dict [str , List [str ]]) -> None :
@@ -265,7 +263,7 @@ def _add_user_flags(self, flags: Dict[str, List[str]]) -> None:
265263 Args:
266264 flags: Flags dictionary to update
267265 """
268- self ._warn_debug_flags_in_quick_profile ()
266+ self ._warn_debug_build_flags ()
269267
270268 i = 0
271269 user_flags = self .user_build_flags
0 commit comments