Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
roberth opened this issue Jun 28, 2024 · 0 comments
Open
Labels
derivation design Issues to consider for new versions of the derivation format (major or incremental) feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking scheduling

Comments

@roberth
Copy link
Member

roberth commented Jun 28, 2024

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.

@roberth roberth added feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking scheduling derivation design Issues to consider for new versions of the derivation format (major or incremental) labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
derivation design Issues to consider for new versions of the derivation format (major or incremental) feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking scheduling
Projects
None yet
Development

No branches or pull requests

1 participant