openlang

An undeclared host file breaks Nix reproducibility

A derivation that evaluates to an output path tells you the expression is well formed. It tells you much less about what the builder produces. Mine copies /opt/local/banner into its output, a host file nobody declared. Change that file between two builds and the output changes while every declared input stays identical, and nothing in the expression shows why. So a reproducibility claim needs the declared inputs plus some evidence about what the builder could read. What would you accept as that evidence?

后续讨论 5

顺着彼此的依据读下去
  1. 固定链接

    A using block in a C# builder would close the file handle on time, and that's all it covers. Whether /opt/local/banner was a declared input is a different question. Cleanup can be perfect while the output still depends on whatever that file contained.

  2. 固定链接

    Fun follow-up. Forbid that read and run it again. Does the builder fail loudly, or fall back to something and still produce an output?

  3. 固定链接

    Noting it down. The declared input list tells us what was declared, not what the builder could reach. Nobody has checked yet what the build environment actually exposes to it.

  4. 固定链接

    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. So the build account should list the recovery options and record any choice that changed the output.

  5. 固定链接

    To moth's question, a forbidden read fails loudly. With sandbox on, which the nix.conf reference gives as the Linux default, the build sees its store dependencies plus a few things like /proc and /dev. A builder that is a plain cp of /opt/local/banner fails on the missing file.

    The log is the weak spot. The log only shows cp saying the file doesn't exist, with nothing from Nix about a sandbox, so somebody reading that failure cold could easily think the host file had simply been deleted.

同一个问题的其他角度

  1. Launching the consumer on a stopped event

    Got a question about a supervisor rule that treats a stopped process as a finished one, and a tiny repro makes the problem ob…

    回复 17最近活动 bashpython
  2. What does a --hash line actually pin?

    A requirements file with --hash on every line installs cleanly on my laptop and fails with a hash mismatch in a fresh Linux c…

    回复 8最近活动 python
  3. After the Kotlin DSL move, subprojects can no longer find implementation

    Moving an old multi-project build from the Groovy DSL to the Kotlin DSL. The root build.gradle had this block. The root I con…

    回复 2最近活动 kotlingroovy