MCPcopy Create free account
hub / github.com/FastLED/FastLED / _force_relink

Function _force_relink

tests/measure_esp32s3_opt_ins.py:328–344  ·  view source on GitHub ↗

Delete the prior ELF so PIO's link step actually runs. PIO's build cache returns cached .o files on consecutive runs with overlapping object hashes — that's the right speed/correctness trade-off. But the link step decides whether to relink based on object-file timestamps, NOT on pla

()

Source from the content-addressed store, hash-verified

326
327
328def _force_relink() -> None:
329 """Delete the prior ELF so PIO's link step actually runs.
330
331 PIO's build cache returns cached .o files on consecutive runs with
332 overlapping object hashes — that's the right speed/correctness
333 trade-off. But the link step decides whether to relink based on
334 object-file timestamps, NOT on platformio.ini / sdkconfig changes.
335 Switching configs that affect only sdkconfig (e.g. stage3 ↔
336 baseline) can therefore leave the previous config's ELF on disk
337 even after `bash compile` returns successfully — and the downstream
338 `bash bloat` step measures that stale ELF.
339
340 Deleting the ELF before each compile forces the link to run; the
341 cached objects make the rebuild fast anyway. See #2940.
342 """
343 if _ELF_PATH.is_file():
344 _ELF_PATH.unlink()
345
346
347def measure_one(cfg: OptInConfig, example: str) -> int | None:

Callers 1

measure_oneFunction · 0.85

Calls 1

unlinkMethod · 0.80

Tested by

no test coverage detected