Build a specific example without lock management. Only call from build().
(
self, example: str, cancelled: threading.Event
)
| 927 | ) |
| 928 | |
| 929 | def _internal_build_no_lock( |
| 930 | self, example: str, cancelled: threading.Event |
| 931 | ) -> SketchResult: |
| 932 | """Build a specific example without lock management. Only call from build().""" |
| 933 | if cancelled.is_set(): |
| 934 | return SketchResult( |
| 935 | success=False, |
| 936 | output="Cancelled", |
| 937 | build_dir=self.build_dir, |
| 938 | example=example, |
| 939 | ) |
| 940 | try: |
| 941 | # ============================================================ |
| 942 | # PHASE 0: Initialize build directory and create platformio.ini |
| 943 | # ============================================================ |
| 944 | if not self.initialized: |
| 945 | init_result = self._internal_init_build_no_lock(example) |
| 946 | if not init_result.success: |
| 947 | # Print FAILED message immediately in worker thread |
| 948 | red_color = "\033[31m" |
| 949 | reset_color = "\033[0m" |
| 950 | print(f"{red_color}FAILED: {example}{reset_color}") |
| 951 | |
| 952 | return SketchResult( |
| 953 | success=False, |
| 954 | output=init_result.output, |
| 955 | build_dir=init_result.build_dir, |
| 956 | example=example, |
| 957 | ) |
| 958 | |
| 959 | if self.use_fbuild: |
| 960 | # fbuild handles packages and compilation — build the first example now |
| 961 | return self._build_with_fbuild(example) |
| 962 | |
| 963 | # ============================================================ |
| 964 | # PHASE 1: Ensure packages installed via daemon (ONCE per compiler instance) |
| 965 | # ============================================================ |
| 966 | # NOW platformio.ini exists at self.build_dir/platformio.ini |
| 967 | print("=" * 60) |
| 968 | print("ENSURING PLATFORMIO PACKAGES INSTALLED") |
| 969 | print("=" * 60) |
| 970 | |
| 971 | from ci.util.pio_package_client import ensure_packages_installed |
| 972 | |
| 973 | if not ensure_packages_installed( |
| 974 | self.build_dir, # Project directory with platformio.ini |
| 975 | self.board.board_name, # Environment name |
| 976 | timeout=1800, # 30 minute timeout |
| 977 | ): |
| 978 | print("\n❌ Package installation failed or timed out") |
| 979 | # Print FAILED message immediately in worker thread |
| 980 | red_color = "\033[31m" |
| 981 | reset_color = "\033[0m" |
| 982 | print(f"{red_color}FAILED: {example}{reset_color}") |
| 983 | |
| 984 | return SketchResult( |
| 985 | success=False, |
| 986 | output="Package installation failed or timed out", |
no test coverage detected