!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

300 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.108 Servers

Load older messages


SenderMessageTime
10 Dec 2024
@puck:puck.moepuck
In reply to @piegames:flausch.social
I still don't understand why the Niv error happens, or where the override happens
uhhh, so, this is in TVL; default.nix sets a scopedArgs, which readTree uses to scopedImport the files; the sources.nix is then imported thru that
11:51:36
@puck:puck.moepuck* uhhh, so, this is in TVL; default.nix sets a scopedArgs, which readTree uses to scopedImport the files; the sources.nix is then imported with scopedImport and those scopedArgs11:51:47
@puck:puck.moepuck* uhhh, so, this is in the TVL repo; default.nix sets a scopedArgs, which readTree uses to scopedImport the files; the sources.nix is then imported with scopedImport and those scopedArgs11:51:51
@puck:puck.moepuckit's a bit of a roundabout non-standard way to go at this :p11:52:09
@raitobezarius:matrix.orgraitobezariusyeah, i wonder if we should do something about the people who are going to copy the tvl monorepo kit11:52:47
@puck:puck.moepuck interestingly, the code that calls __findFile is never evaluated 11:53:12
@piegames:flausch.socialpiegamesYeah I think that is the issue here. The tvix solution only breaks when actually evaluated, while the deprecation check eagerly happens at variable binding time (even for dead code)11:54:31
@raitobezarius:matrix.orgraitobezariusCan I leave it to you pie to make an answer to the issue with your ideas on how to solve this?11:55:38
@piegames:flausch.socialpiegamesI'll answer later11:57:29
@piegames:flausch.socialpiegames But my take is: On the one hand, it only breaks TVIX for a weird use case and there is an escape hatch to disable the error. On the other hand, I mostly care about __sub and __findFile was more a bonus for completeness anyways, so could easily also revert that bit 12:00:25
@piegames:flausch.socialpiegamesI'll ask pennae in person tomorrow12:00:49
@piegames:flausch.socialpiegames * I'll ask pennae in person tomorrow pennae says "break tvix" 12:53:11
@piegames:flausch.socialpiegamesThough I see why Flokli's bug report is confused about Niv, the error message really points to the wrong place12:53:36
@piegames:flausch.socialpiegamesFixing this might be tricky and I don't want to sink too much energy into slightly improving the experience of a feature deprecation, but I will at least try to see if I can improve it a bit12:54:12
@puck:puck.moepuck i think it might be worth checking the "will this shadow something" in importScoped and lets? 12:56:34
@piegames:flausch.socialpiegames puck: So I made the check on use site instead of declaration site to still allow setting variables with that name which could shadow things as long as they don't 13:13:49
@piegames:flausch.socialpiegames Though there are only two sites where this can even happen, let bindings and arguments passed to scopedImport. (Attrsets are out despite the existence of with, because it will never have precedence) 13:14:49
@puck:puck.moepuck
In reply to @piegames:flausch.social
Though there are only two sites where this can even happen, let bindings and arguments passed to scopedImport. (Attrsets are out despite the existence of with, because it will never have precedence)
actually false :D but in a really nasty way
13:15:18
@piegames:flausch.socialpiegamesoh no 🙈13:15:25
@puck:puck.moepuck rec { __findFile = _: _: 5; a = <meow>; } 13:15:32
@piegames:flausch.socialpiegames Oh noes 13:15:54
@piegames:flausch.socialpiegamessee, good thing I didn't try the other approach because I would have certainly failed that case13:16:09
@puck:puck.moepuck
In reply to @piegames:flausch.social
puck: So I made the check on use site instead of declaration site to still allow setting variables with that name which could shadow things as long as they don't
it would've been plausible to warn, i guess
13:16:40
@puck:puck.moepuckbut yeah, complexity13:17:11
@puck:puck.moepuckthe only thought i had is "if an ExprVar would bind to a shadowed var, warn + replace it with an error value"13:17:43
@puck:puck.moepuck* the only thought i had is "if an ExprVar would bind to a shadowed var, print a warning + replace it with an error value"13:17:50
@piegames:flausch.socialpiegamesthat's an interesting approach13:18:14
@piegames:flausch.socialpiegamesit would add some laziness, which in this case would not break the Tvix code13:18:25
@puck:puck.moepuckand then later ban shadowing altogether13:18:27
@piegames:flausch.socialpiegamesThough I think breaking Tvix here is okay because the exact change allows them to do exactly what they want to do in the first place but better13:19:24

Show newer messages


Back to Room ListRoom Version: 10