Process the task queue for the given board.
(
board: Board,
examples: list[Path],
build_dir: Optional[str],
verbose_on_failure: bool,
libs: Optional[list[str]],
)
| 227 | |
| 228 | # Function to process task queues for each board |
| 229 | def compile_examples( |
| 230 | board: Board, |
| 231 | examples: list[Path], |
| 232 | build_dir: Optional[str], |
| 233 | verbose_on_failure: bool, |
| 234 | libs: Optional[list[str]], |
| 235 | ) -> tuple[bool, str]: |
| 236 | """Process the task queue for the given board.""" |
| 237 | global ERROR_HAPPENED # pylint: disable=global-statement |
| 238 | board_name = board.board_name |
| 239 | is_first = True |
| 240 | for example in examples: |
| 241 | example = example.relative_to(Path(".").resolve()) |
| 242 | if ERROR_HAPPENED: |
| 243 | return True, "" |
| 244 | locked_print(f"\n*** Building {example} for board {board_name} ***") |
| 245 | if is_first: |
| 246 | locked_print( |
| 247 | f"*** Building for first example {example} board {board_name} ***" |
| 248 | ) |
| 249 | if is_first and USE_FIRST_BUILD_LOCK: |
| 250 | with FIRST_BUILD_LOCK: |
| 251 | # Github runners are memory limited and the first job is the most |
| 252 | # memory intensive since all the artifacts are being generated in parallel. |
| 253 | success, message = compile_for_board_and_example( |
| 254 | board=board, |
| 255 | example=example, |
| 256 | build_dir=build_dir, |
| 257 | verbose_on_failure=verbose_on_failure, |
| 258 | libs=libs, |
| 259 | ) |
| 260 | else: |
| 261 | success, message = compile_for_board_and_example( |
| 262 | board=board, |
| 263 | example=example, |
| 264 | build_dir=build_dir, |
| 265 | verbose_on_failure=verbose_on_failure, |
| 266 | libs=libs, |
| 267 | ) |
| 268 | is_first = False |
| 269 | if not success: |
| 270 | ERROR_HAPPENED = True |
| 271 | return ( |
| 272 | False, |
| 273 | f"Error building {example} for board {board_name}. stdout:\n{message}", |
| 274 | ) |
| 275 | return True, "" |
nothing calls this directly
no test coverage detected