colemickens has quit [Remote host closed the connection]
colemickens has joined #nix-lang
ekleog has quit [Quit: WeeChat 2.4]
ekleog has joined #nix-lang
<ekleog>
… anyone understands what `builtins.tryEval darwin.apple_sdk.frameworks.AVFoundation` does? o.O
<ekleog>
(on linux)
<ekleog>
Like, it looks like it's correctly returning a derivation, but said derivation has as a store path `«error: [...]` (without closing » or so it seems)
<ekleog>
my initial issue being that I have a `(builtins.tryEval old.${i}).success && toString old.${i}` failing with `old.${i}` being `darwin.apple_sdk.frameworks.AVFoundation` and I'm trying to understand how/why
<infinisil>
Ah, it's lazy
<infinisil>
It prints as much as it can until it gets to the part where it needs to evaluate the derivation
<infinisil>
And it only needs to evaluate it when it tries to get drvPath
<infinisil>
And that's just after «derivation
<ekleog>
but it shouldn't be properly closing the set, then?
<infinisil>
Doesn't it?
<infinisil>
There's `»; }` at the end
<ekleog>
well yes it does properly close the set, which is what I'm finding weird given it mis-parenthesizes the «»
<infinisil>
Oh, the additional « before error?
<infinisil>
That is a bit weird
<ekleog>
so now yeah
<ekleog>
-so now
<ekleog>
looks like making it `builtins.tryEval (builtins.deepSeq a a)` instead of `builtins.tryEval a` does what I expected `tryEval` to do
<infinisil>
Ah, that builtins.tryEval isn't catching the error
<infinisil>
That's weird, I blame nix repl
<ekleog>
I'm not at all sure whether it's a bug in tryEval or in my understanding of it, then, so…
<ekleog>
no, same thing happens in nix-build
<ekleog>
(with the old.${i} example quoted above)
<infinisil>
I see
<infinisil>
I guess tryEval only evals to whnf
<infinisil>
And for some reason that doesn't include the drvPath
<infinisil>
Hm..
freeman42[NixOS] has joined #nix-lang
<infinisil>
ekleog: Ah, I think I got it, if you look at the implementation of mkDerivation (in pkgs/stdenv/generic/make-derivation.nix)
<infinisil>
It uses lib.extendDerivation validity.handled, where validity.handled does the meta checks
<infinisil>
And if you look at the implementation of extendDerivation in lib/customisation.nix, it only evaluates that argument when drvPath/outPath is evaluated
<ekleog>
that kind of makes sense, but… why isn't drvPath evaluated by tryEval?
<infinisil>
ekleog: Because tryEval only tries to eval whnf
<infinisil>
> builtins.tryEval { value = throw "hello"; }
<{^_^}>
{ success = true; value = { value = <CODE>; }; }
<infinisil>
In case of attributes, whnf is just the attribute names
<infinisil>
In case of a list, whnf is just the list length
<infinisil>
> builtins.tryEval [ (throw "") ]
<{^_^}>
{ success = true; value = [ <CODE> ]; }
<ekleog>
makes sense I guess, though it's not what I'd have expected reading its doc
<infinisil>
Hmm yeah that manual entry should be expanded with this
* ekleog
writes down on todo-list to do that, if someone sees gets motivation before I get there some years from now, please ping me :)
hmpffff has joined #nix-lang
freeman[NixOS] has joined #nix-lang
freeman42[NixOS] has quit [Ping timeout: 246 seconds]
<infinisil>
ekleog: I'm in the docs right now, how about changing "Try to evaluate e." to "Try to shallowly evaluate e"?
<infinisil>
I could mentioned whnf, but it's not mentioned anywhere else in the whole nix source, so maybe rather not
<infinisil>
Maybe an example would help more
<ekleog>
“shallowly” makes sense to me, though an example would likely be even better, something like `builtins.tryEval (throw "a")` and `builtins.tryEval { a = throw "a"; }` I guess
<ekleog>
(time to go for me, 'night)
hmpffff has quit [Quit: nchrrrr…]
freeman[NixOS] has quit [Remote host closed the connection]
freeman42[NixOS] has joined #nix-lang
freeman42[NixOS] has quit [Remote host closed the connection]
freeman42[NixOS] has joined #nix-lang
hmpffff has joined #nix-lang
hmpffff has quit [Quit: nchrrrr…]
vyorkin has joined #nix-lang
__monty__ has joined #nix-lang
freeman[NixOS] has joined #nix-lang
freeman42[NixOS] has quit [Ping timeout: 264 seconds]
noonien has joined #nix-lang
hmpffff has joined #nix-lang
freeman[NixOS] has quit [Ping timeout: 245 seconds]
freeman42[NixOS] has joined #nix-lang
hmpffff has quit [Quit: nchrrrr…]
hmpffff has joined #nix-lang
Synthetica has joined #nix-lang
jtojnar has quit [Quit: jtojnar]
jtojnar has joined #nix-lang
freeman42[NixOS] has quit [Remote host closed the connection]
freeman42[NixOS] has joined #nix-lang
freeman42[NixOS] has quit [Ping timeout: 245 seconds]
jtojnar has quit [Quit: jtojnar]
jtojnar has joined #nix-lang
freeman42[NixOS] has joined #nix-lang
freeman42[NixOS] has quit [Ping timeout: 245 seconds]
hmpffff has quit [Quit: nchrrrr…]
hmpffff has joined #nix-lang
hmpffff has quit [Quit: nchrrrr…]
evanjs has quit [Quit: Configuring ZNC, sorry for the joins/quits!]
evanjs has joined #nix-lang
Synthetica has quit [Quit: Connection closed for inactivity]
evanjs| has joined #nix-lang
evanjs| has quit [Quit: Configuring ZNC, sorry for the joins/quits!]