!djTaTBQyWEPRQxrPTb:nixos.org

Nixpkgs Architecture Team

227 Members
https://github.com/nixpkgs-architecture, weekly public meetings on Wednesday 15:00-16:00 UTC at https://meet.jit.si/nixpkgs-architecture53 Servers

Load older messages


SenderMessageTime
20 Jul 2022
@atharvaamritkar:matrix.orgwiredhikari joined the room.06:58:29
@infinisil:matrix.orginfinisil Just discussed with Robert Hensing (roberth) in #dev:nixos.org some things relating to .overrideAttrs 08:37:21
@roberthensing:matrix.orgRobert Hensing (roberth)
In reply to @infinisil:matrix.org
Just discussed with Robert Hensing (roberth) in #dev:nixos.org some things relating to .overrideAttrs
Discussion started at https://matrix.to/#/!kjdutkOsheZdjqYmqp:nixos.org/$c_CLLdpbxqzeOS3o1CM4uPc029OBnK2hXrKnp-oQVGM?via=nixos.org&via=matrix.org&via=nixos.dev
08:37:38
@infinisil:matrix.orginfinisil For one, something like https://github.com/NixOS/nix/pull/4154 (changed to something like builtins.lazyAttrUpdate) could allow all these .overrideAttrs, .extend, .overrideScope, etc. to not require evaluating the old value at all 08:38:17
@infinisil:matrix.orginfinisil But also with a different standard builder, .overrideAttrs at least wouldn't be a problem anymore. Robert Hensing (roberth) showed how that could look like here: https://github.com/NixOS/rfcs/pull/92#discussion_r671741003 08:39:18
@infinisil:matrix.orginfinisil (the problem mainly being that .overrideAttrs has some performance overhead because of how all the attributes of the derivation need to be known beforehand) 08:40:26
@infinisil:matrix.orginfinisil If derivations don't contain all their arguments as output attributes anymore, we could have a static set of output attributes, which then means less evaluation needed to get to .overrideAttrs 08:42:12
@infinisil:matrix.orginfinisilI hope I summarized this well08:42:17
@roberthensing:matrix.orgRobert Hensing (roberth)My concern with lazy attribute names is that its performance benefit may be insignificant after implementing such a change in Nixpkgs, while incurring the cost of complicating the Nix evaluator forever08:45:08
@FRidh:matrix.orgFRidh joined the room.08:45:59
@keiichi:matrix.orgteto joined the room.08:46:35
@infinisil:matrix.orginfinisil I have seen a lot of motivations for lazy attribute names by now. There's many use cases with a dynamic set of attributes that's expensive to evaluate, but where you have some function that can make changes to that set exposed conveniently with a .<something> 08:46:49
@roberthensing:matrix.orgRobert Hensing (roberth) mkDerivation spilling the derivation guts out is a problem that we should solve regardless, and whether that's through a mkDerivation-like function or mkPackage, we'll evaluate derivation attribute names more quickly 08:46:57
@infinisil:matrix.orginfinisilI only see two solutions right now: Making the attributes static, or to use something like lazy attribute names. The former does come with a convenience disadvantage, the latter with complicating the Nix implementation (though I don't think it will be considerable)08:48:22
@roberthensing:matrix.orgRobert Hensing (roberth)I'm not against it. Just saying that we should be really careful, as its costs are hard to assess, and its benefit might not be as big in the future08:48:33
@roberthensing:matrix.orgRobert Hensing (roberth) I don't think there's a convenience disadvantage when we improve mkDerivation. mkPackage is currently overkill, as we don't have RFC 92 yet (derivations producing derivations), and mkPackage is a little inconvenient compared to mkDerivation 08:50:24
@roberthensing:matrix.orgRobert Hensing (roberth) Though it would be interesting to "rebase" a mkDerivation replacement on mkPackage instead of custom fixpoint stuff 08:51:21
@infinisil:matrix.orginfinisil

Short summary of how lazy attribute names should be implemented in Nix:

  • Create an attribute set abstraction, so that there can be multiple "backends" of values providing attributes. This will be some tree-wide changes, but there's also other Nix ideas that could use this abstraction (functions as attribute sets is the one I know of)
  • Add a new value type, a lazy attribute update, consisting of two values (left and right)
  • Add a builtins.lazyAttrsUpdate builtin that creates such a value
08:53:26
@infinisil:matrix.orginfinisilThe first point is the most time-consuming one, but I know how to go about it. After that it's smooth sailing08:54:12
@infinisil:matrix.orginfinisilWhether this is in scope for this team, I'm not sure, but I see a lot of value we could get from this for nixpkgs :)08:55:33
@j-k:matrix.orgj-k as discussed in the meeting, if this was discourse this would be quite a bit easier to follow
cc: infinisil
08:58:36
@infinisil:matrix.orginfinisil j-k: Not disagreeing, but I think Matrix has a place for quick discussions 09:02:02
@infinisil:matrix.orginfinisilThough it's hard to know when to use Matrix vs Discourse. Should discussions from Matrix be summarized in Discourse like a meeting log? Might make sense if we consider Matrix as just textual meetings09:04:54
@infinisil:matrix.orginfinisilIs it okay to reach out to somebody in Matrix when you want to quickly chat about a Discourse post? I'd think so, but then it's easy to not follow up on Discourse09:05:36
@qyliss:fairydust.spaceAlyssa Rosscan't you link to relevant Matrix logs on Discourse?09:06:38
@infinisil:matrix.orginfinisilGoing from audio/video meetings, over Matrix to Discourse, you lose efficiency, but you gain persistence 🤔09:06:46
@infinisil:matrix.orginfinisil Alyssa Ross: Oh that sounds pretty good 09:07:07
@infinisil:matrix.orginfinisilWould be cool if there was a Matrix GitHub integration, where GitHub could show a Matrix conversation inline09:07:59
@infinisil:matrix.orginfinisilOr s/GitHub/Discourse09:09:46
@adis:blad.isadisbladis joined the room.09:27:51

Show newer messages


Back to Room ListRoom Version: 9