Skip to content

"Alternate FOD" for fixed output derivation that fails, mirror-like behavior #10986

@roberth

Description

@roberth

Is your feature request related to a problem? Please describe.

Sometimes a fixed output derivation doesn't work. For example, a site may have gone offline.
However, the same content may be available in a different location, such as a mirror, web archive, or a peer to peer content addressable store such as IPFS.
Currently, only traditional mirrors lists can be used in anticipation of such failures.

Describe the solutions you'd like

"Inductive":

  • Add a special field such as __alternateDerivation
  • Only allow it when the output(s) are fixed
  • Do not treat it as a dependency
  • If the build fails, try the __alternateDerivation instead. It must produce an output with the same name and hash.

"Algebraic":

  • Add a new derivation system value, such as builtin:alternatives
  • Disallow the builder attribute.
  • Require fixed outputs
  • Instead only allow an alternatives list, referencing derivations that implement the fixed output derivation

Comparison

It feels more natural to have metadata to be specified in the latter "algebraic" design, although nothing stops us from doing it with the inductive syntax.
Uses of metadata:

  • scheduling can deprioritize bad sources (e.g. domains that are down, protocols that don't work)
  • users can configure to disallow certain protocols, etc

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    derivation designIssues to consider for new versions of the derivation format (major or incremental)featureFeature request or proposalfetchingNetworking with the outside (non-Nix) world, input lockingscheduling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions