HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Modulehorizon-config-shell-0.12.1GHC2024

Horizon.Config.Lock

The generator's change-detection cache — horizon.lock. NOT a lock language and NOT the resolved source hashes (those live in the generated pkgs/*.nix): it records, per package, a stable hash of everything that decides that package's derivation, so a regeneration only re-fetches the packages for which any of it changed (lockDiff). Disposable tooling state — deleting it just forces a full regen.

The hash is sha256 of the Show encoding of a Pin (all its parts derive Show; it is total and deterministic for these ADTs), and the file is plain JSON (Map name hash). Changing what a Pin holds is a one-time cache bust — the first run after it regenerates every pkgs/*.nix, which is expected and harmless.

  • 3 types
  • 6 values
datadata Pin
#

Everything that decides one package's pkgs/*.nix: the pin itself, the set's compiler, the Rendering (the platform its conditionals are resolved for and the Hackage index state its revision is read at), the set-wide modifiers, the generator that renders them, and, for a local package, its .cabal (which file, and its content): a Hackage, git or tarball pin names its source exactly, a local one only by its directory, whose .cabal can change under the same pin. A change to any of these is a different derivation, so it must invalidate the entry; the generator is among them so a release that renders differently regenerates the sets it is run on.

Instances2Eq, Show
  • Eq PinDefined in horizon-config-shell-0.12.1 · Horizon.Config.Lock
  • Show PinDefined in horizon-config-shell-0.12.1 · Horizon.Config.Lock
valuelockPath :: FilePath
#

Where the change-detection cache lives, relative to the config.

Read horizon.lock (JSON: name → hash); an absent file is an empty cache (everything regenerates).

valuewriteLockFile :: LockFile -> IO ()
#

Write horizon.lock as JSON (name → hash), keys as plain text, ending with a newline.