Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536"""The compiled applications a test loads into its own `erl`, never stale.
Inside the gate, `ALBEDO_TEST_DAEMON` names the daemon snapshot the gate builtfrom this checkout, and `gleam test` may be rebuilding `build/dev` meanwhile,so tests read the snapshot. Outside it, the checkout is built first through`apps/albedo/priv/bin/albedo-build`, once per process: `build/dev` can holdbeams older than the source, and a test that loads them checks old code."""
import functoolsimport osfrom pathlib import Pathimport subprocess
ROOT = Path(__file__).resolve().parents[1]BUILD = ROOT / "apps/albedo/build/dev/erlang"
@functools.cachedef applications() -> Path: """The directory holding one directory per compiled application.""" snapshot = os.environ.get("ALBEDO_TEST_DAEMON") if snapshot: return Path(snapshot).parent subprocess.run([str(ROOT / "apps/albedo/priv/bin/albedo-build")], check=True) return BUILD
def ebins() -> list[str]: """Every application's `ebin`, for `erl -pa`.""" root = applications() found = sorted(str(path) for path in root.glob("*/ebin")) if not found: raise RuntimeError(f"no compiled applications under {root}") return found