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

Function handle_skip_meson_setup

ci/meson/meson_setup_execute.py:262–338  ·  view source on GitHub ↗

Handle the skip-setup branch: thin archive cleanup + missing markers + ar patches.

(
    *,
    build_dir: Path,
    source_dir: Path,
    use_thin_archives: bool,
    markers: MarkerPaths,
    hashes: SourceHashes,
    debug: bool,
    check: bool,
    build_mode: str,
    enable_examples: bool,
    enable_unit_tests: bool,
    compiler: CompilerDetection,
)

Source from the content-addressed store, hash-verified

260
261
262def handle_skip_meson_setup(
263 *,
264 build_dir: Path,
265 source_dir: Path,
266 use_thin_archives: bool,
267 markers: MarkerPaths,
268 hashes: SourceHashes,
269 debug: bool,
270 check: bool,
271 build_mode: str,
272 enable_examples: bool,
273 enable_unit_tests: bool,
274 compiler: CompilerDetection,
275) -> None:
276 """Handle the skip-setup branch: thin archive cleanup + missing markers + ar patches."""
277 libfastled_a = build_dir / "libfastled.a"
278 if libfastled_a.exists():
279 try:
280 with open(libfastled_a, "rb") as f:
281 header = f.read(8)
282 is_thin_archive = header == b"!<thin>\n"
283
284 if is_thin_archive and not use_thin_archives:
285 _ts_print("[MESON] ⚠️ Detected thin archive from previous build")
286 _ts_print(
287 "[MESON] 🗑️ Deleting libfastled.a to force rebuild with regular archive"
288 )
289 libfastled_a.unlink()
290 elif not is_thin_archive and use_thin_archives:
291 _ts_print("[MESON] ℹ️ Detected regular archive from previous build")
292 _ts_print(
293 "[MESON] 🗑️ Deleting libfastled.a to force rebuild with thin archive"
294 )
295 libfastled_a.unlink()
296 except (OSError, IOError) as e:
297 _ts_print(f"[MESON] Warning: Could not check/delete libfastled.a: {e}")
298
299 _write_configuration_markers(
300 build_mode_marker=markers.build_mode,
301 build_mode=build_mode,
302 thin_archive_marker=markers.thin_archive,
303 use_thin_archives=use_thin_archives,
304 debug_marker=markers.debug,
305 debug=debug,
306 check_marker=markers.check,
307 check=check,
308 source_files_marker=markers.source_files,
309 current_source_hash=hashes.source_hash,
310 current_source_files=hashes.source_files,
311 src_files_marker=markers.src_files,
312 current_src_hash=hashes.src_hash,
313 test_files_marker=markers.test_files,
314 current_test_hash=hashes.test_hash,
315 compiler_version_marker=markers.compiler_version,
316 current_compiler_version=compiler.compiler_version,
317 zccache_version_marker=markers.zccache_version,
318 current_zccache_version=compiler.zccache_version or None,
319 enable_examples_marker=markers.enable_examples,

Callers 1

setup_meson_buildFunction · 0.90

Calls 7

inject_zccache_wrappingFunction · 0.90
unlinkMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected