!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1520 Members
Nix programming language267 Servers

Load older messages


SenderMessageTime
1 Oct 2024
@infinisil:matrix.orginfinisilBot time??20:56:57
@infinisil:matrix.orginfinisil -_o: Beep Boop? 20:57:14
2 Oct 2024
@vo1dz3r0:matrix.orgSir Void joined the room.03:41:04
@michal-atlas:matrix.org@michal-atlas:matrix.org left the room.12:00:41
@mattsturg:matrix.orgMatt Sturgeon

Cross-posting https://matrix.to/#/!wfudwzqQUiJYJnqfSY:nixos.org/$VKmzIvXR8HqZgjBta5cdud9hjyKoXNAvilyvwZbd5nE?via=nixos.org&via=matrix.org&via=nixos.dev (message from the NixOS Module System room) because I'm very confused and I don't seem to be getting enough eyeballs in that room 🙂

TL;DR: overriding an option-type using ty // { merge = someOtherFn; } seems to be inconsistently broken and I can't figure out what's going on...

12:07:32
@fizihcyst:matrix.org@fizihcyst:matrix.org left the room.13:16:07
@tazjin:matrix.orgtazjin Matt Sturgeon: I think "inconsistently broken" needs to be expanded on a bit if you want people to be able to help ;) 13:20:49
@mattsturg:matrix.orgMatt Sturgeon
In reply to @tazjin:matrix.org
Matt Sturgeon: I think "inconsistently broken" needs to be expanded on a bit if you want people to be able to help ;)
I've gone into a lot more detail in #modules:nixos.org. I didn't want to spam this room full of copy-pasting what's already posted over there 🙂
13:32:40
@mattsturg:matrix.orgMatt Sturgeon

I'll try and summarize here:

This PR is moving some logic from the various option's apply functions into the type's merge function.

This is done using the type // { merge = /* ... */; } pattern.

Everything works fine when using the produced type in a repl, but in practice the overridden merge function is not used (the original type's merge function is instead).

This can be observed in CI failures complaining that "the option lua is accessed but not defined". When the merge function is correctly overridden, lua will not be accessed.

I tried to make an MRE, however it is unable to reproduce the issue.

In particular, nixvimConfiguration._module.specialArgs.lib.nixvim.keymaps.deprecatedMapOptionSubmodule works fine, but nixvimConfiguration.options.keymaps.type.nestedTypes.elemType does not. Bizzarely, these two should be the same type; the latter comes from:

keymaps = lib.mkOption {
  type = lib.types.listOf lib.nixvim.keymaps.deprecatedMapOptionSubmodule;
  # ...
}
16:13:39
@mattsturg:matrix.orgMatt Sturgeon *

I'll try and summarize here:

This PR is moving some logic from the various option's apply functions into the type's merge function.

This is done using the type // { merge = /* ... */; } pattern.

Everything works fine when using the produced type in a repl, but in practice the overridden merge function is not used (the original type's merge function is instead).

This can be observed in CI failures complaining that "the option lua is accessed but not defined". When the merge function is correctly overridden, lua will not be accessed.

I tried to make an MRE, however it is unable to reproduce the issue. Hence why I'm still talking about the PR where I actually see the issue. I also had this issue a wile back in an unrelated PR.

In particular, nixvimConfiguration._module.specialArgs.lib.nixvim.keymaps.deprecatedMapOptionSubmodule works fine, but nixvimConfiguration.options.keymaps.type.nestedTypes.elemType does not. Bizzarely, these two should be the same type; the latter comes from:

keymaps = lib.mkOption {
  type = lib.types.listOf lib.nixvim.keymaps.deprecatedMapOptionSubmodule;
  # ...
}
16:17:36
@mattsturg:matrix.orgMatt Sturgeon *

I'll try and summarize here:

This PR is moving some logic from the various option's apply functions into the type's merge function.

This is done using the type // { merge = /* ... */; } pattern.

Everything works fine when using the produced type in a repl, but in practice the overridden merge function is not used (the original type's merge function is instead).

This can be observed in CI failures complaining that "the option lua is accessed but not defined". When the merge function is correctly overridden, lua will not be accessed.

I tried to make an MRE, however it is unable to reproduce the issue. Hence why I'm still talking about the PR where I actually see the issue. I also had this issue a wile back in an unrelated PR.

In particular, nixvimConfiguration._module.specialArgs.lib.nixvim.keymaps.deprecatedMapOptionSubmodule works fine, but nixvimConfiguration.options.keymaps.type.nestedTypes.elemType does not. Bizzarely, these two should be the same type; the latter comes from:

keymaps = lib.mkOption {
  type = lib.types.listOf lib.nixvim.keymaps.deprecatedMapOptionSubmodule;
  # ...
}

As seen in my MRE, just using evalModules or listOf is not enough to reproduce the issue. Something else weird is going on.

16:25:25
@avgvstvs96:matrix.orgavgvstvs96 joined the room.16:26:40
@drpyser:matrix.org@drpyser:matrix.org left the room.18:06:00
3 Oct 2024
@midirhee12:tchncs.demidirhee12 joined the room.02:04:20
@renato-trevisan:matrix.orgRenato Trevisan joined the room.09:16:44
@zm94zgv2:private.coffeeZm94ZGV2 changed their profile picture.09:57:10
4 Oct 2024
@yusdacra:tchncs.de@yusdacra:tchncs.de left the room.04:11:58
@yusdacra:nixos.dev@yusdacra:nixos.dev left the room.04:28:02
@dschrempf:matrix.org@dschrempf:matrix.org left the room.07:56:00
@test-user:c.imperishable.namerendakuenthusiast⚡️ left the room.10:20:06
@test-user:c.imperishable.namerendakuenthusiast⚡️ joined the room.10:22:17
@bashfulrobot.:matrix.orgbashfulrobot changed their profile picture.16:24:12
@o-santi:matrix.orgLeonardo Santiago I'm trying to optimize the evaluation time of one of my derivations, by using --trace-function-calls and inferno-flamegraph, and I see that almost 40% of the evaluation time (4s~, measured using time nix eval .#drv) is spent on <nix/derivation-internal.nix>. I couldn't find any mentions to it other than 1 line of code in src/libexpr/primops.cc, and I don't understand what's happening in that portion. Anyone care to explain? 19:54:06
@o-santi:matrix.orgLeonardo Santiagoout.svg
Download out.svg
19:54:24
@o-santi:matrix.orgLeonardo SantiagoAlso uploading the svg if anyone want to take a look19:54:30
@o-santi:matrix.orgLeonardo Santiago The derivation itself is a rust crate built using oxalica's nocargo, more specifically my branch of it that has newer features, and I was thinking that it was slow because my code was poorly written, but it seems that is not the case, so I'm puzzled. 19:59:25
5 Oct 2024
@hwrb:matrix.org@hwrb:matrix.org left the room.14:03:05
@zgcarvalho:matrix.orgzgcarvalho joined the room.14:36:15
@7actose:matrix.org7actose set a profile picture.19:22:54
6 Oct 2024
@accelbread:matrix.org@accelbread:matrix.org left the room.01:25:56

Show newer messages


Back to Room ListRoom Version: 6