!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

903 Members
For people hacking on the Nix package manager itself189 Servers

Load older messages


SenderMessageTime
26 Jul 2021
@babbaj:nerdsin.spacebabbaj joined the room.00:13:56
@pamplemouss_:matrix.orgpamplemousse Is there any library linked statically in nix? 22:49:35
27 Jul 2021
@balsoft:balsoft.rubalsoftNot in the default distribution, but there is static-nix09:10:03
@qyliss:fairydust.spaceAlyssa RossRedacted or Malformed Event09:16:49
@pamplemouss_:matrix.orgpamplemousse

What's the consensus on languages to be used for scripts?

So far, I have a couple of bash scripts to easily build / run the fuzzers I have so far.
But as I am making diverse harnesses (one exercising only the parsing, other parsing and evaluation, and later maybe other components - daemon...), with different sanitizers, those scripts are growing, and I want them to take options.

Now, I feel like using python with https://docs.python.org/3/library/argparse.html is a really neat way of providing a nice interface for my script (and also more maintainable than bash).

17:32:59
@theophane:hufschmitt.netRegnat
In reply to @pamplemouss_:matrix.org

What's the consensus on languages to be used for scripts?

So far, I have a couple of bash scripts to easily build / run the fuzzers I have so far.
But as I am making diverse harnesses (one exercising only the parsing, other parsing and evaluation, and later maybe other components - daemon...), with different sanitizers, those scripts are growing, and I want them to take options.

Now, I feel like using python with https://docs.python.org/3/library/argparse.html is a really neat way of providing a nice interface for my script (and also more maintainable than bash).

As long as it’s not required for building Nix itself, I think python is totally fine
18:17:26
@andi:kack.itandi-Does Nix assume that paths are valid utf-8 or could they be utf-16 or whatever weird jap character set there might be?18:20:41
@tomberek:matrix.orgtomberek andi-: these checks (https://github.com/NixOS/nix/blob/master/src/libstore/path.cc#L5-L29) seem to indicate a limited character set 18:29:24
@andi:kack.itandi-but that only applies to names of derivations not files within a folder, right18:30:29
@andi:kack.itandi- * but that only applies to names of derivations not files within a folder, right?18:30:31
@tomberek:matrix.orgtomberekcorrect, i'd presume file names inside a store-path are not so restricted.... time to test it!18:31:12
@tomberek:matrix.orgtomberek
[tom@tsurf:~/temp]$ ls /nix/store/mv1iw4cg27fnavhshiwk642s0dwr047a-unicode/
☺
18:32:42
@andi:kack.itandi-
nix-repl> builtins.readDir ./.
{ "👍" = "regular"; }
18:33:08
@sternenseemann:systemli.orgsterni (he/him) andi-: at least syntactically paths are quite restricted, i. e. only ascii alpha numeric characters, no spaces etc. but you can always get around that by concatenating a string 18:33:40
@sternenseemann:systemli.orgsterni (he/him) andi-: in that sense you can have arbitrary encoding since nix doesn't care about string encoding as long as they don't contain any NUL bytes 18:34:28
@sternenseemann:systemli.orgsterni (he/him)but valid store paths are an issue of course18:34:38
@andi:kack.itandi-I am concerned about handling of names in e.g. NAR files but since those names always start with a byte size u64 I guess it could go well most of the time? Perhaps utf-16 could be a challenge if there is a 0 byte inbetween chars..18:34:40
@andi:kack.itandi- The string functions (e.g. builtins.split) work on bytes instead of characters so I guess that is one of the limitations. 18:41:19
@sternenseemann:systemli.orgsterni (he/him)not sure what split has to do with paths?19:18:37
@sternenseemann:systemli.orgsterni (he/him)on unix paths are just byte sequences so there shouldn't be an issue wrt that19:19:12
@sternenseemann:systemli.orgsterni (he/him)I guess at least as your encoding doesn't allow for anything non ASCII to be mistaken as ASCII19:19:27
@sternenseemann:systemli.orgsterni (he/him) * I guess at least as your encoding doesn't allow for any (part of a) non ASCII char to be mistaken as ASCII19:19:42
@andi:kack.itandi-
In reply to @sternenseemann:systemli.org
not sure what split has to do with paths?
imagine a combination of builtins.readDir and postprocessing the paths
19:22:10
@andi:kack.itandi-Yeah, I think thinking of paths and strings in nix in general (?) as byte sequences is probably the best.19:23:15
@sternenseemann:systemli.orgsterni (he/him) Can an unix path contain a literal '/'? If not, builtins.split should at least always work to separate the path components correctly 19:29:43
28 Jul 2021
@stick:matrix.orgstick changed their display name from prusnak to stick.15:09:45
29 Jul 2021
@tomberek:matrix.orgtomberekcan a libstore implementation access or query the local host's store? My intention is query the db for the closest-version available package corresponding to a download request.02:55:48
@niksnut:matrix.orgniksnutA store implementation can do anything in principle. Nix used to have a substituter that computed a shortest sequence of binary deltas to apply to an existing store path, to avoid a full download.06:59:02
@tomberek:matrix.orgtomberek niksnut: i've been playing with a zsync as an extension of the http-binary-cache. What happened with that previous implementation? Not worth it? maintenance cost? bad idea? 07:00:50
@tomberek:matrix.orgtomberek * niksnut: i've been playing with a zsync-based extension of the http-binary-cache. What happened with that previous implementation? Not worth it? maintenance cost? bad idea? 07:01:03

Show newer messages


Back to Room ListRoom Version: 6