Meta-bug: builtins.derivation
replacement design #217
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#217
Loading…
Add table
Add a link
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 hereallowNewPrivileges
setting #265These 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.sandbox
setting is a horrifying field of landmines of implementation complexity #936My view is that it is better to first fix the underlying issues at the store layer, and then as a "victory lap" make the better derivations primop in the language.
https://github.com/NixOS/nix/pull/10760 This is the final PR in my long saga to factor out all the env var hacks, and structured attrs
__json
hacks, and make theDerivation
data type ready for a better builtin (and better on-disk format). I strongly encourage Lix to cherry-pick the relevant commits.If we do that (or you all otherwise get your internal data structures ready), I think a next step could be thinking about the successor for
buildDerivation
in a new protocol, e.g. as used by Hydra. A new protocol (that is designed with extensibility/versioning in mind) is a good opportunity to try things out and make things better with something that isn't exposed, but isn't as visible low/churn as Nix code / Nixpkgs.