Skip to content

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Aug 21, 2025

Motivation

Do this to avoid checking "system features" from the store config directly, because we rather not have DerivationBuilder depend on Store.

Context

Depends on #13846


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@edolstra
Copy link
Member

Do this to avoid checking "system features" from the store config directly.

What exactly is the problem with that?

@Ericson2314
Copy link
Member Author

Ericson2314 commented Aug 21, 2025

What exactly is the problem with that?

I am trying to make DerivationBuilder not depend on Store. With this change, and one other smaller one, that is succesfully accomplished except for registerOutputs (and recursive Nix).

I want this for separation of concerns, but also FFI

@edolstra
Copy link
Member

Maybe it's easier to just pass systemFeatures in DerivationBuilderParams? That's more generic and doesn't require putting platform-specific parsing in derivation-building-goal.cc.

@Ericson2314
Copy link
Member Author

I would settle for that, but IMO "set of strings with some strings having special meanings" is more an artifact of the A-Term derivation format and nix.confg format than how we actually want things to work. I rather have DerivationBuilder take precisely the booleans (or other typed options) it cares about.

I'm fine ditching the ifdefs though, if you would want that.

@Ericson2314 Ericson2314 force-pushed the derivation-builder-kvm branch from a1d7cb4 to 9cd1b46 Compare August 27, 2025 15:44
@edolstra
Copy link
Member

edolstra commented Aug 27, 2025

but IMO "set of strings with some strings having special meanings" is more an artifact of the A-Term derivation format

That's not the case. It's a list of strings denoting required platform features, and those are inherently platform-specific. Hard-coding those features into DerivationBuilderParams seems inflexible and a wrong abstraction that simply doesn't match how derivations work. For instance, ExternalDerivationBuilder and remote builds need to be able to forward arbitrary features to the actual builder. (E.g. ExternalDerivationBuilder on macOS still needs to be able to see the KVM feature, if it's doing a Linux build on macOS.)

We want to get rid of platform-specific code in derivation-builder.{cc,hh}, and this is going in the opposite direction. Note that there are other platform features like uid-range that we don't want to handle in the platform-independent files.

Copy link

dpulls bot commented Aug 27, 2025

🎉 All dependencies have been resolved !

@Ericson2314
Copy link
Member Author

OK, fair enough with ExternalDerivationBuilder.

Do this to avoid checking "system features" from the store config
directly, because we rather not have `DerivationBuilder` depend on
`Store`.
@Ericson2314 Ericson2314 force-pushed the derivation-builder-kvm branch from 9cd1b46 to f4a0161 Compare August 27, 2025 16:38
@Ericson2314 Ericson2314 changed the title Create DerivationBuilderParams::exposeKVM bool Create StringSet DerivationBuilderParams::systemFeatures Aug 27, 2025
@Ericson2314
Copy link
Member Author

OK, updated!

@Ericson2314 Ericson2314 merged commit 193ad73 into NixOS:master Aug 27, 2025
16 checks passed
@Ericson2314 Ericson2314 deleted the derivation-builder-kvm branch August 27, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants