When a source build fails in test mode and the prebuilt fallback succeeds, the build failure is not recorded in failed_packages. This means the failure report silently omits packages that couldn't build from source.
Root cause:
In _handle_phase_error, when _handle_test_mode_failure returns a successful SourceBuildResult, the item advances to PROCESS_INSTALL_DEPS without calling _record_test_mode_failure:
fallback = self._handle_test_mode_failure(...)
if fallback is not None:
item.build_result = fallback
item.phase = BootstrapPhase.PROCESS_INSTALL_DEPS
return [item] # no failure recorded
The existing test test_build_phase_test_mode_fallback_success didn't catch this because it mocks _handle_test_mode_failure and never asserts on failed_packages.
Expected behavior: Build failures should always be recorded, even when a prebuilt fallback succeeds. Test mode exists to surface packages that can't build from source.
When a source build fails in test mode and the prebuilt fallback succeeds, the build failure is not recorded in
failed_packages. This means the failure report silently omits packages that couldn't build from source.Root cause:
In
_handle_phase_error, when_handle_test_mode_failurereturns a successfulSourceBuildResult, the item advances toPROCESS_INSTALL_DEPSwithout calling_record_test_mode_failure:The existing test
test_build_phase_test_mode_fallback_successdidn't catch this because it mocks_handle_test_mode_failureand never asserts onfailed_packages.Expected behavior: Build failures should always be recorded, even when a prebuilt fallback succeeds. Test mode exists to surface packages that can't build from source.