Skip to content

Build capability interface #10579

Open
Open
@roberth

Description

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

Scheduling a derivation involves a comparison between a derivation's scheduling attributes (such as system and requiredFeatures), and the related properties of a "builder" (such as system, extra-platforms, supportedFeatures, mandatoryFeatures).

In #9899 I have done some exploratory coding to work out these concepts a little better.

Problems:

  • "builder" is overloaded. It occurs in the derivation builder attribute, as well as "remote builder", which have very different meanings, yet interact too closely.
  • the remote builder configuration is denormalized, which users don't expect, resulting in inaccurate remote builder configs
    • specifically, remote builders and build capabilities are in a one to many relationship
    • by denormalizing the config (repeating the remote builder connection part), connection reuse becomes less efficient
  • we don't have a good interface to stub out builds in unit tests
    • this leads to more configuration than desired (Run unit tests with clean config #10562)
    • unit test performance is slightly worse, for having to perform an actual build (an easily bearable cost, considering our current over-reliance on functional tests)
  • we don't have an interface to separate the store component from the builder component, whether that's an internal or IPC interface
    • local and remote builds feel like chaotic reimplementations of each other because we lack the clarity of such an interface
    • nix-daemon has to manage builds instead of just a store and a build capability trust relation

Describe the solution you'd like

  1. Define unambiguous terminology
    • I've renamed "builder" to "build capability" but maybe someone has a better term?
    • We should probably further distinguish between "build capability" and the concrete service or implementation that fulfills that capability, because these are again in a many to many relation.
  2. Define interface in C++.
  3. Define an IPC interface between nix-daemon and build process or build daemon (or whatever we want to call it).

Describe alternatives you've considered

Additional context

Efforts/ideas to add more "systems" which may or may not be the native system.

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalremote buildThe SSH store, ssh:, ssh-ng:, ... (split from protocol label 2024-07)schedulingsettingsSettings, global flags, nix.confsignificantNovel ideas, large API changes, notable refactorings, issues with RFC potential, etc.storeIssues and pull requests concerning the Nix store

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions