Meta-bug: builtins.derivation
replacement design #217
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#217
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
builtins.derivation
has several intractable legacy problems:__noChroot
) don't say who they are for: are they for scheduling? are they for the builder daemon? are they secretly requests for some feature to be available to the builder? are they for cache upload attrs (e.g. "this is debuginfo, don't retain it as long").builtins.derivationStrict
has better semantics, but is not used in practiceThe current interface to it needs to be redesigned to specify better who everything is for, which then makes it much easier to figure out as well where it should go in the derivation format, etc, etc, etc.
It would not require significant (dangerous, at least) rearchitecture to get started on this issue, and would be preferable over adding anything to the list of special control attrs, which might be incompatible with upstream C++Nix.
Here is a pad (freely editable for everyone; consider writing who you are next to your comments) for working on a replacement API design: https://pad.lix.systems/lix-builtins-derivation
Related issues:
comments of note:
derivationStrict
is used, it's the backend forderivation
and has all the same problemsstructuredAttrs
are very slowly gaining traction, having nixpkgs folks push in that direction may be helpfulRight, but the semantics of
derivationStrict
are better (according to @puck at least, iwrc), and so its lack of direct use is sort of strange, and the fact thatbuiltins.derivation
as a wrapper exists is also kind of strange.derivation x
is basicallyx: let s = derivationStrict x; in x // { type = "derivation"; inherit (s) outPath drvPath; }
with some sugar coat. it has all the same problems asderivation
by virtue of being the problem withderivation
; there are some semantic bits in the strict variant that are pleasant but they're unrelated to the problem being discussed hereThese points largely agree with nix#9774. (Ignoring the bit about
meta
perhaps)I'd like to keep in touch about this, and perhaps collaborate?
Also I was very close to making Nixpkgs use
derivationStrict
directly in nixpkgs#217243 cleanAttrs, before deciding not to take that broader direction. I believe it should be fine for Nixpkgs to do that still. It'd improve performance slightly.