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

Function _get_emcc_version_signature

ci/wasm_build.py:256–282  ·  view source on GitHub ↗

Return a short cached signature of the active emcc version.

()

Source from the content-addressed store, hash-verified

254
255
256def _get_emcc_version_signature() -> str:
257 """Return a short cached signature of the active emcc version."""
258 from ci.wasm_tools import get_emcc
259
260 global \
261 _cached_emcc_version_key, \
262 _cached_emcc_version_value, \
263 _cached_emcc_version_time
264 emcc = get_emcc()
265 now = time.monotonic()
266 if (
267 _cached_emcc_version_key == emcc
268 and _cached_emcc_version_value is not None
269 and (now - _cached_emcc_version_time) < 0.5
270 ):
271 return _cached_emcc_version_value
272
273 try:
274 result = subprocess.run([emcc, "--version"], capture_output=True, text=True)
275 version_text = ((result.stdout or "") + (result.stderr or "")).strip()
276 except OSError:
277 version_text = "ERROR"
278
279 _cached_emcc_version_key = emcc
280 _cached_emcc_version_value = version_text
281 _cached_emcc_version_time = now
282 return version_text
283
284
285def _compute_link_environment_fingerprint(mode: str) -> str:

Callers 1

Calls 2

get_emccFunction · 0.90
runMethod · 0.45

Tested by

no test coverage detected