!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1935 Members
Nix programming language362 Servers

Load older messages


SenderMessageTime
22 May 2021
@qyliss:fairydust.spaceAlyssa Rossi'm not sure she's going to make the move to matrix18:07:55
@7c6f434c:nitro.chat7c6f434cWell, if there is not an IRC bridge in sight in a week…18:08:46
@toonn:matrix.orgtoonn Tell them we'll keep them company over on Libera.Chat : ) 18:11:02
@melg8:matrix.orgMelg8

Can somebody help, i've created a monster... now want it to be alive.
How to test:
nix-instantiate --eval --strict -E 'toString (import ./build_inputs_1.nix { pkg = (import <nixpkgs> {}).hello; })'
Create file build_inputs_1.nix with:

{ pkg, lib ? import <nixpkgs/lib> }:
let
  drv_direct_dependencies =
    drv_path:
    let
      drv_file = builtins.readFile drv_path;
      storeDirRe = lib.replaceStrings [ "." ] [ "\\." ] builtins.storeDir;
      storeBaseRe = "[0-9a-df-np-sv-z]{32}-[+_?=a-zA-Z0-9-][+_?=.a-zA-Z0-9-]*";
      re = "(${storeDirRe}/${storeBaseRe}\\.drv)";
      inputs = lib.concatLists (lib.filter lib.isList (builtins.split re drv_file));
    in
    inputs;

  drv_all_dependencies = { drv_path, visited }:
    let
      direct_dependencies = drv_direct_dependencies drv_path;
      minimal_path = { paths = [ drv_path ]; visited = visited ++ [ drv_path ]; };
      just_visited = { paths = [ ]; visited = visited ++ [ drv_path ];};
      concat_outs = (out1: out2: { paths = out1.paths ++ out2.paths; visited = out1.visited ++ out2.visited; });
      visit_all_childs = (out: dependency:
      if (builtins.elem dependency out.visited) then out
      else concat_outs out (drv_all_dependencies { drv_path = dependency; visited = out.visited; }));
      result =
        if (builtins.length direct_dependencies) == 0 then minimal_path
        else concat_outs (builtins.foldl' visit_all_childs just_visited direct_dependencies) minimal_path;
    in
    result;
in
(drv_all_dependencies { drv_path = pkg.drvPath; visited = [ ]; }).paths

Problem:
GC Warning: Repeated allocation of very large block (appr. size 2525917184):

but it works on small example (only 4 derivations in chain).

What i try to achieve: given drv_path function must reaturn a list, containing all derivations which need to be build in order to build derivation from drv_path. list should be ordered, so first on list is most needed derivation, last on list - derivation from given path.

18:16:10
@melg8:matrix.orgMelg8 i can add my initial attempt - without visited part, but it falis in other way - just too long to execute. 18:18:49
@sternenseemann:systemli.orgsterni (he/him)
In reply to @qyliss:fairydust.space
hmm, this channel isn't going to be the same without puck
indeed :(
18:19:11
@melg8:matrix.orgMelg8thanks! i figured out it by myself - just too much stuff were in "visited" - so i've added lib.unique - and now it works! anyway, if anyone have suggestions, i would like to hear them)18:31:11
@skochen:matrix.orgStéphan set a profile picture.20:23:18
@ivank:matrix.orgivan joined the room.21:27:59
@ivank:matrix.orgivan changed their display name from ivank to ivan.21:30:08
23 May 2021
@codygman:matrix.orgcodygman joined the room.03:12:17
@treed:cybre.spacetreed joined the room.04:47:52
@em:queersin.spaceEmelie joined the room.07:40:29
@mudrii:matrix.orgmudrii joined the room.08:36:13
@v:anomalous.euV joined the room.11:18:28
@v:anomalous.euV changed their display name from v to V.11:19:59
@fortuneteller2k:matrix.orgfortuneteller2k changed their display name from fortuneteller2k to rtl.12:44:44
@fortuneteller2k:matrix.orgfortuneteller2k changed their display name from rtl to f2k.12:45:07
@fortuneteller2k:matrix.orgfortuneteller2k changed their display name from f2k to fortuneteller2k.12:47:58
@sternenseemann:systemli.orgsterni (he/him) changed their display name from sterni to sterni (he/him).13:24:23
@legendofmiracles:matrix.orglegendofmiraclescan either this channel or nix offtopic have another picture? It's hard to distinguish them13:24:39
@qyliss:fairydust.spaceAlyssa Rosslegendofmiracles: might want to make that request in the matrix suggestions room to make sure it's seen :)13:25:10
@legendofmiracles:matrix.orglegendofmiraclesoh right, that exists now13:25:21
@pinage404:matrix.orgpinage404 joined the room.14:20:09
@cicucci:matrix.orgcicucci joined the room.15:36:26
@cicucci:matrix.orgcicucci set a profile picture.15:41:38
@ijustwannalurk:matrix.orgijustwannalurk joined the room.20:38:09
@ijustwannalurk:matrix.orgijustwannalurk set a profile picture.22:46:50
24 May 2021
@rajivr:matrix.orgrajivr joined the room.03:34:02
@hexa:lossy.networkhexa joined the room.04:59:23

Show newer messages


Back to Room ListRoom Version: 6