Logo FS-Skia-UI

ADR 0002 — Build front-end form (D2)

Context

build.fsx is run via the FSX script runner (dotnet fake), which pulls FSharp Compiler Services (FCS) to compile the script on every invocation — the per-invocation compile tax the programme exists to remove. The question: what form should the build front-end take so target bodies can live in a compiled governance library?

Decision

The build front-end is a dedicated, compiled F# Exe (build/Build.fsproj) that takes a PackageReference on Fake.Core.Target (and the minimal companion Fake.Core.* packages its API needs), defines targets in Program.fs via the modular Target.create / runOrDefaultWithArguments API, and is invoked with dotnet run --project build/Build.fsproj -- <target>. Target bodies delegate to the referenced compiled library (FS.Skia.UI.Build.Spike.run) — no logic is inlined in the front-end. No FSharp.Compiler.Service is taken as a dependency (FR-012).

Alternatives considered

Consequences / rationale

Stages shaped

Verification in feature 039 (spike)

D2 confirmed. Both projects compile clean under net10.0/TreatWarningsAsErrors (0 warnings, 0 errors); SpikeHello runs via dotnet run and prints the value returned by FS.Skia.UI.Build.Spike.run (proving the body ran from the library, not inlined); and dotnet list build/Build.fsproj package --include-transitive shows no FSharp.Compiler.* (FR-012). The committed build/spike-verify.sh reproduces the result (SPIKE-VERIFY PASS: D2 confirmed). Full evidence and commands are in docs/reports/_baselines/2026-05-31-spike-d2-outcome.md.

Type something to start searching.