!kjdutkOsheZdjqYmqp:nixos.org

Empty Room

1912 Members
400 Servers

Load older messages


SenderMessageTime
14 Jan 2025
@niklaskorz:korz.devNiklas Korz* rec packages are hard to overrideAttrs, so I wonder what problem the finalAttrs pattern has?10:55:41
@niklaskorz:korz.devNiklas Korzthe way things have been moving recently I see stdenv.mkDerivation + hooks + finalAttrs to become the norm, so if that would be problematic down the line I think now would be the time to raise awareness of why this would be a bad idea10:57:11
@l1npengtul:matrix.orgl1npengtulI've been using let...in for all my new derivations, is that bad?11:00:12
@niklaskorz:korz.devNiklas Korzno, let in is fine!11:03:30
@niklaskorz:korz.devNiklas Korz it's just a wide-scoped with ... that can cause issues 11:03:53
@l1npengtul:matrix.orgl1npengtuloh thats nice to hear 11:04:31
@toonn:matrix.orgtoonn `let in` is also an alternative to rec/finalAttrs, with yet different trade-offs. 11:05:34
@toonn:matrix.orgtoonn I don't remember where the write up of the problems with each of the three alternatives is. 11:07:06
@sigmasquadron:matrix.org@sigmasquadron:matrix.org
In reply to @niklaskorz:korz.dev
rec packages are hard to overrideAttrs, so I wonder what problem the finalAttrs pattern has?
finalAttrs's only drawback is that it's only available on the default stdenv for now.
11:11:29
@niklaskorz:korz.devNiklas Korz
In reply to @sigmasquadron:matrix.org
finalAttrs's only drawback is that it's only available on the default stdenv for now.
which is why I also mentioned there seems to be more push towards hooks instead of custom build functions
11:15:17
@niklaskorz:korz.devNiklas Korzobviously I will not recommend someone to exchange a custom builder with rec for hook + finalAttrs in a review, but I see no reason not to use finalAttrs when a PR already uses stdenv.mkDerivation11:16:11
@niklaskorz:korz.devNiklas Korz* obviously I will not recommend someone to exchange a custom builder with rec for hook + finalAttrs in a review, but I see no reason not to use finalAttrs when a PR already uses stdenv.mkDerivation rec11:16:16
@grimmauld:grimmauld.deGrimmauld
In reply to @sigmasquadron:matrix.org
finalAttrs's only drawback is that it's only available on the default stdenv for now.
Isn't it also available for stdenvNoCC ?
11:17:45
@niklaskorz:korz.devNiklas Korzyeah, but not in buildRustPackage e.g. (although there is an open PR)11:18:16
@toonn:matrix.orgtoonn If no one has complained about not being able to override a package then rec shouldn't be replaced at all. Keep it for a treewide or something. 11:18:26
@toonn:matrix.orgtoonn New expressions being the exception. 11:18:38
@sigmasquadron:matrix.org@sigmasquadron:matrix.org
In reply to @grimmauld:grimmauld.de
Isn't it also available for stdenvNoCC ?
By "non-default stdenv", I implied the builders in build-support
11:18:43
@niklaskorz:korz.devNiklas Korz
In reply to @toonn:matrix.org
If no one has complained about not being able to override a package then rec shouldn't be replaced at all. Keep it for a treewide or something.
fair enough, on that I can agree
11:18:52
@toonn:matrix.orgtoonn Nixpkgs would benefit a lot from ratcheting lints. 11:18:55
@grimmauld:grimmauld.deGrimmauld
In reply to @toonn:matrix.org
Nixpkgs would benefit a lot from ratcheting lints.
Blocking additions of with lib;, rec and similar? Might make sense, but I feel the ratchet database keeping track of occurrence count would end up a merge conflict hell
11:27:52
@lily:lily.flowers@lily:lily.flowers
In reply to @grimmauld:grimmauld.de
Blocking additions of with lib;, rec and similar? Might make sense, but I feel the ratchet database keeping track of occurrence count would end up a merge conflict hell
(nixpkgs already implements several ratchet lints, so i'm not sure what you're saying the problem with ratcheting is here?)
11:29:54
@grimmauld:grimmauld.deGrimmauld
In reply to @lily:lily.flowers
(nixpkgs already implements several ratchet lints, so i'm not sure what you're saying the problem with ratcheting is here?)
Huh. Didn't know that. How is the count being tracked and updated?
11:33:15
@lily:lily.flowers@lily:lily.flowers
In reply to @grimmauld:grimmauld.de
Huh. Didn't know that. How is the count being tracked and updated?
what count?
11:33:41
@grimmauld:grimmauld.deGrimmauld
In reply to @lily:lily.flowers
what count?
Don't you need to store a count of how many "disallowed" patterns were in the code before a change to determine whether an addition is adding one of those disallowed patterns?
11:35:42
@k900:0upti.meK900No, you just run the lint twice11:36:10
@niklaskorz:korz.devNiklas Korzsometimes it's the simple solutions that work best😄11:36:40
@lily:lily.flowers@lily:lily.flowers
In reply to @grimmauld:grimmauld.de
Don't you need to store a count of how many "disallowed" patterns were in the code before a change to determine whether an addition is adding one of those disallowed patterns?
it's ratched per-file and yeah just run before to determine whether it's already ratcheted and if an after lint run needs to be enforced
11:37:45
@grimmauld:grimmauld.deGrimmauld
In reply to @k900:0upti.me
No, you just run the lint twice
Ah fair. Yeah that works. Damn it, no need to be smart I guess XD
11:37:44
@lily:lily.flowers@lily:lily.flowers* it's ratched per-file and yeah just run before to determine whether it's already ratcheted which determines if an after lint run needs to be enforced11:38:06
@lily:lily.flowers@lily:lily.flowers* it's ratched per-file and yeah just run before-change to determine whether it's already ratcheted which determines if an after-change lint run needs to be enforced11:38:22

Show newer messages


Back to Room ListRoom Version: 6