jonringer has quit [Remote host closed the connection]
cole-h has joined #nixos-dev
orivej has quit [Ping timeout: 276 seconds]
jonringer has joined #nixos-dev
<bpye>
I see we have a way to generate a squashFs in nixpkgs/nixos - do we have a way to generate a 'pre-activated' squashfs? Ie. I'm happy to have the nix store included in the image however it would useful to have all the symlinks generated already, so we could avoid loading the nix store on boot... Thinking of embedded applications here
jonringer has quit [Ping timeout: 264 seconds]
Gaelan_ is now known as Gaelan
cole-h has quit [Ping timeout: 264 seconds]
janneke has quit [Quit: janneke quits Mes'sing]
janneke has joined #nixos-dev
justanotheruser has quit [Ping timeout: 272 seconds]
<supersandro20002>
Can someone do something against the troll?
supersandro20002 is now known as supersandro2000
bk1603[m] has quit [Quit: Idle for 30+ days]
<etu>
I'm fairly certain that UnaDuda and Joaquinito2051 is the same person
<sterni>
siraben: don't do it _in_ nix, but have a wrapper calling nix with certain inputs, builtins.tryEval is relatively limited and doesn't save you from all eval errors which means you'll eventually run into a wall with nixpkgs
<sterni>
siraben: have a look at what ofborg and hydra-eval are doing that is the way™ to go pretty much
<siraben>
Why not do it in Nix itself? We have a repl!
<sterni>
siraben: as said as soon as there is an evaluation error that is not caused by throw, or assert your evaluation will halt
<siraben>
I see.
__monty__ has joined #nixos-dev
<sterni>
siraben: although you can test interactively as the repl keeps going evaluating an attrset if an eval error occurs iirc
<lukegb>
sterni: that just sounds like it needs more expect(1)
<lukegb>
although I guess at that point you're just writing tcl
<sterni>
oh no oh no
<sterni>
just use a small perl script :p
<sterni>
the best solution is of course to override nix with a patch that makes builtins.tryEval catch all exceptions — problem solved
<sterni>
you can probably also use nix-env -qaP to do it in pure nix like ofborg does
<regnat[m]1>
sterni: the best solution is of course to override nix with a patch that makes builtins.tryEval catch all exceptions <- It doesn't seem fundamentally absurd to add a flag to Nix to do that
<gchristensen>
ofborg requires no exceptions during evaluation already
evils has quit [Ping timeout: 265 seconds]
<sterni>
gchristensen: nix-env also stops evaluation when a primop type error or a parse error is generated then?
<sterni>
probably tryEval is actually enough for nixpkgs as long as you respect recurseIntoAttrs
<gchristensen>
I think the only thing nx-env doesn't stop on is a builtins.throw, which is how unfree license checks are made
<sterni>
gchristensen: it also skips asserts, so same behavior as tryEval then
<gchristensen>
gotcha
<gchristensen>
I'm going to trust you on this one :P
<sterni>
well nix-env -qaP ocaml-ng.ocamlPackages_4_02 works, so it has to as that set happens to have quite a few asserts
<gchristensen>
maybe nix-env doesn't ignore throws then, and just ignores assertsL
<gchristensen>
?
<sterni>
recurseIntoAttrs is a double edged sword I found a few attributes that can be evaluated, but ofborg and hydra where oblivious to them which wouldn't even parse
<sterni>
i. e. magnetophonDSP.* pretty much (#114290)
<gchristensen>
yeah, attribute sets like that should probably be marked as recurseIntoAttrs :)
<sterni>
gchristensen: indeed
<sterni>
gchristensen: it also ignores throws and even hides the throw error message which is why it's more desrieable to use builtins.throw instead of assert lib.assertMsg …
<sterni>
unfortunately because sometimes an assert is nice to write than an if … then throw "…" else, but asserts don't have nice error messages
<gchristensen>
as you can see my brain has been not close to this part of the problem in a minut enow
supersandro2000 has quit [Disconnected by services]
supersandro20000 has joined #nixos-dev
orivej has joined #nixos-dev
<rmcgibbo[m]>
does anyone have such a patch for nix to make tryEval catch more stuff, like type errors?
<rmcgibbo[m]>
maybe it's fairly obvious.
<rmcgibbo[m]>
siraben: we have some code in rust based on the rnix parser that parses mkDerivation calls and can look for certain syntactic stuff -- it's in nixpkgs-hammering -- i bet it would be easy to adapt for your maintainer searches.
<sterni>
although I don't honestly think it's the best way of doing this
tokudan has quit [Quit: Dunno.]
<rmcgibbo[m]>
sterni: I was actually thinking about a different use case. I wanted to see what techniques I could use to do lookups from filename -> nixpkgs attr name fairly quickly without too much RASM, because I was thinking about the github actions + nixpkgs-hammering stuff.
tokudan has joined #nixos-dev
<sterni>
how would you do this with tryEval o_O
<rmcgibbo[m]>
Well, I wanted to start with something like `builtins.toJSON (pkgs.lib.mapAttrs (name: value: value.meta.position or null) pkgs.python3Packages)`, but you very quickly run into evaluation errors.
<rmcgibbo[m]>
It seems like a new builtins.trySuperDuperEval primop that caught more errors might be sufficient?
<samueldr>
I *think* the /bin/sh in the sandbox is causing issues with using the wrong bash in e.g. writeShellScriptBin used during a build (among possible other places)
<samueldr>
because I was using the wrong shell, by using writeShellScriptBin instead of buildPackages.writeShellScriptBin, and things continued on
<samueldr>
I only noticed because of a combination where a cross-compiled shell was being built and failing to do so
<samueldr>
note: I'm not using any binfmt nonsense that automatically makes binaries from another arch usable