nix icon indicating copy to clipboard operation
nix copied to clipboard

WIP: Dynamic derivations

Open Ericson2314 opened this issue 4 years ago • 2 comments

See the tests in https://github.com/obsidiansystems/nix/blob/dynamic-drvs/tests/dyn-drv/ for what is being implemented.

Needs:

  • [ ] Make cooler tests
  • [ ] RFC draft
  • [ ] Unstable feature gate to prevent accidental use
  • [ ] Fix Perl bindings

~~Depends on #4594~~ Depends on #3959 Depends on #4543 Depends on #5364

Ericson2314 avatar Mar 10 '21 15:03 Ericson2314

How come you cancelled CI?

L-as avatar Oct 02 '21 19:10 L-as

I didn't. If some jobs fail others are cancelled. There is one new bug relating to the eval store (I need to get crafty about which drvs are to be found where). Existing bugs were in the JSON output changing for nix build because the derivation keys might not be strings, and perhaps something else also boring.

Ericson2314 avatar Oct 02 '21 21:10 Ericson2314

I have rebased this. It is no failing tests, but i don't think that will be too bad to fix.

Ericson2314 avatar Jan 24 '23 14:01 Ericson2314

:tada: All dependencies have been resolved !

dpulls[bot] avatar May 10 '23 14:05 dpulls[bot]

:tada: All dependencies have been resolved !

dpulls[bot] avatar May 15 '23 13:05 dpulls[bot]

:tada: All dependencies have been resolved !

dpulls[bot] avatar May 18 '23 12:05 dpulls[bot]

:tada: All dependencies have been resolved !

dpulls[bot] avatar Aug 11 '23 13:08 dpulls[bot]

:tada: All dependencies have been resolved !

dpulls[bot] avatar Aug 14 '23 14:08 dpulls[bot]

:tada: All dependencies have been resolved !

dpulls[bot] avatar Aug 25 '23 15:08 dpulls[bot]

The last commit is finally ready for review!

Ericson2314 avatar Aug 25 '23 22:08 Ericson2314

:tada: All dependencies have been resolved !

dpulls[bot] avatar Sep 06 '23 13:09 dpulls[bot]

:tada: All dependencies have been resolved !

dpulls[bot] avatar Sep 07 '23 15:09 dpulls[bot]

That's an MVP for ya!

You'll want to use this with recursive-nix for trying this out with non-trivial builds (writing not a singular drv), but be aware that the interface may change. We want to offer a safer, more limited recursive nix functionality by default, so that a graph of drvs can be constructed, sources can be generated, etc, but that's not been built yet and may or may not use the existing daemon protocol. Again this is experimental. ymmv.

:rocket:

roberth avatar Sep 07 '23 15:09 roberth

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfc-92-status-update/27441/6

nixos-discourse avatar Sep 07 '23 17:09 nixos-discourse

Is there any documentation how to use dynamic derivations?

domenkozar avatar Sep 11 '23 17:09 domenkozar

Not enough, that is definitely next on the agenda.

Some parts like the outputOf builtin are documented, but other parts are not (like "text" content addressing derivation outputs) because the original concept was already undocumented! And there is definitely no tutorial yet on putting all the pieces together.

For now, I would look at the tests and imitate what they do. Hopefully that is not too cumbersome.

Ericson2314 avatar Sep 11 '23 18:09 Ericson2314

It seems that dynamic derivations require content addressable store?

domenkozar avatar Sep 12 '23 08:09 domenkozar

Yes. Because derivations themselves are always content addressed, any derivation that produces derivations must be derivation which opts to content-address its outputs.

Ericson2314 avatar Sep 12 '23 08:09 Ericson2314