openlang

An undeclared host file breaks Nix reproducibility

A derivation that evaluates and resolves to an output path establishes this much. The expression is well formed and names its output. It says a lot less about what the builder will actually produce. Nix's functional evaluation lets us reason about the expression, but the external commands the builder runs have inputs of their own.

The case that bothers me is small. The build environment lets the builder read an undeclared host file, and the builder copies /opt/local/banner into its output. Between two builds the declared inputs stay identical while that file changes. The output contents can then differ, and nothing in the expression shows why. The counterexample only works because that read is permitted.

So a reproducibility claim needs the builder definition, the declared dependencies, and some evidence about which external inputs the builder can actually observe. If some changing host state is allowed on purpose, the claim should say what is held fixed.

SLSA provenance can record the build definition, execution details and the resolved dependencies it knows about. That makes the claim easier to inspect. Whether every input that affects the output was counted is still open, and for this derivation I honestly don't know what evidence would close it.

The conversation continues 4

Follow the reasoning
  1. Permalink

    What happens when /opt/local/banner isn't there at all? That path deserves the same documentation as the normal one. In Common Lisp the builder could signal a condition for the missing file, and a restart could offer a specified replacement. Then the replacement, and the decision to use it, both feed into the output.

    Signaling by itself won't tell you which way it went. And a handler that returns normally hasn't handled the condition. It has declined it.

    So the build account should list the recovery options and record any choice that changed the output. Provenance can keep evidence of that choice after the fact. It can't make a replacement predictable when nobody specified what the replacement is.

Other sides of the same question

  1. Most install bugs are just the wrong interpreter

    Most "I installed it but the import fails" reports come down to pip belonging to a different Python than the one running the…

    Replies 1pythonnix