fbuild 1.2.8__py3-none-any.whl → 1.2.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. fbuild/__init__.py +5 -1
  2. fbuild/build/configurable_compiler.py +49 -6
  3. fbuild/build/configurable_linker.py +14 -9
  4. fbuild/build/orchestrator_esp32.py +6 -3
  5. fbuild/build/orchestrator_rp2040.py +6 -2
  6. fbuild/cli.py +300 -5
  7. fbuild/config/ini_parser.py +13 -1
  8. fbuild/daemon/__init__.py +11 -0
  9. fbuild/daemon/async_client.py +5 -4
  10. fbuild/daemon/async_client_lib.py +1543 -0
  11. fbuild/daemon/async_protocol.py +825 -0
  12. fbuild/daemon/async_server.py +2100 -0
  13. fbuild/daemon/client.py +425 -13
  14. fbuild/daemon/configuration_lock.py +13 -13
  15. fbuild/daemon/connection.py +508 -0
  16. fbuild/daemon/connection_registry.py +579 -0
  17. fbuild/daemon/daemon.py +517 -164
  18. fbuild/daemon/daemon_context.py +72 -1
  19. fbuild/daemon/device_discovery.py +477 -0
  20. fbuild/daemon/device_manager.py +821 -0
  21. fbuild/daemon/error_collector.py +263 -263
  22. fbuild/daemon/file_cache.py +332 -332
  23. fbuild/daemon/firmware_ledger.py +46 -123
  24. fbuild/daemon/lock_manager.py +508 -508
  25. fbuild/daemon/messages.py +431 -0
  26. fbuild/daemon/operation_registry.py +288 -288
  27. fbuild/daemon/processors/build_processor.py +34 -1
  28. fbuild/daemon/processors/deploy_processor.py +1 -3
  29. fbuild/daemon/processors/locking_processor.py +7 -7
  30. fbuild/daemon/request_processor.py +457 -457
  31. fbuild/daemon/shared_serial.py +7 -7
  32. fbuild/daemon/status_manager.py +238 -238
  33. fbuild/daemon/subprocess_manager.py +316 -316
  34. fbuild/deploy/docker_utils.py +182 -2
  35. fbuild/deploy/monitor.py +1 -1
  36. fbuild/deploy/qemu_runner.py +71 -13
  37. fbuild/ledger/board_ledger.py +46 -122
  38. fbuild/output.py +238 -2
  39. fbuild/packages/library_compiler.py +15 -5
  40. fbuild/packages/library_manager.py +12 -6
  41. fbuild-1.2.15.dist-info/METADATA +569 -0
  42. {fbuild-1.2.8.dist-info → fbuild-1.2.15.dist-info}/RECORD +46 -39
  43. fbuild-1.2.8.dist-info/METADATA +0 -468
  44. {fbuild-1.2.8.dist-info → fbuild-1.2.15.dist-info}/WHEEL +0 -0
  45. {fbuild-1.2.8.dist-info → fbuild-1.2.15.dist-info}/entry_points.txt +0 -0
  46. {fbuild-1.2.8.dist-info → fbuild-1.2.15.dist-info}/licenses/LICENSE +0 -0
  47. {fbuild-1.2.8.dist-info → fbuild-1.2.15.dist-info}/top_level.txt +0 -0
fbuild/daemon/__init__.py CHANGED
@@ -14,6 +14,12 @@ from fbuild.daemon.client import (
14
14
  request_monitor,
15
15
  stop_daemon,
16
16
  )
17
+ from fbuild.daemon.connection import DaemonConnection, connect_daemon
18
+ from fbuild.daemon.connection_registry import (
19
+ ConnectionRegistry,
20
+ ConnectionState,
21
+ PlatformSlot,
22
+ )
17
23
  from fbuild.daemon.messages import (
18
24
  BuildRequest,
19
25
  DaemonState,
@@ -26,12 +32,17 @@ from fbuild.daemon.messages import (
26
32
 
27
33
  __all__ = [
28
34
  "BuildRequest",
35
+ "ConnectionRegistry",
36
+ "ConnectionState",
37
+ "DaemonConnection",
29
38
  "DaemonState",
30
39
  "DaemonStatus",
31
40
  "DeployRequest",
32
41
  "InstallDependenciesRequest",
33
42
  "MonitorRequest",
34
43
  "OperationType",
44
+ "PlatformSlot",
45
+ "connect_daemon",
35
46
  "ensure_daemon_running",
36
47
  "get_daemon_status",
37
48
  "request_build",
@@ -20,7 +20,8 @@ from dataclasses import asdict, dataclass, field
20
20
  from typing import Any, Callable
21
21
 
22
22
  # Default heartbeat timeout: clients not sending heartbeat in this time are considered dead
23
- DEFAULT_HEARTBEAT_TIMEOUT = 30.0
23
+ # Per TASK.md: "If daemon misses heartbeats for ~3–4s, daemon closes the connection"
24
+ DEFAULT_HEARTBEAT_TIMEOUT = 4.0
24
25
 
25
26
  # Cleanup interval for checking dead clients
26
27
  CLEANUP_INTERVAL = 10.0
@@ -275,7 +276,7 @@ class ClientConnectionManager:
275
276
 
276
277
  # Remove client from registry
277
278
  del self._clients[client_id]
278
- logging.info(f"Client unregistered: {client_id} " f"(had {resource_count} attached resources)")
279
+ logging.info(f"Client unregistered: {client_id} (had {resource_count} attached resources)")
279
280
  return True
280
281
 
281
282
  def heartbeat(self, client_id: str) -> bool:
@@ -359,7 +360,7 @@ class ClientConnectionManager:
359
360
  for client_id, client_info in list(self._clients.items()):
360
361
  if not client_info.is_alive(timeout_seconds):
361
362
  dead_clients.append(client_id)
362
- logging.warning(f"Client {client_id} is dead " f"(no heartbeat for {client_info.time_since_heartbeat():.1f}s)")
363
+ logging.warning(f"Client {client_id} is dead (no heartbeat for {client_info.time_since_heartbeat():.1f}s)")
363
364
 
364
365
  # Clean up dead clients
365
366
  for client_id in dead_clients:
@@ -448,7 +449,7 @@ class ClientConnectionManager:
448
449
  """
449
450
  with self._lock:
450
451
  self._cleanup_callbacks.append(callback)
451
- logging.debug(f"Cleanup callback registered " f"(total callbacks: {len(self._cleanup_callbacks)})")
452
+ logging.debug(f"Cleanup callback registered (total callbacks: {len(self._cleanup_callbacks)})")
452
453
 
453
454
  def _call_cleanup_callbacks_unlocked(self, client_id: str) -> None:
454
455
  """Call all cleanup callbacks for a client (must hold lock).