!lTqhfnNvIkcEackxxk:matrix.org

Nix Bindings

82 Members
Nix C API https://github.com/NixOS/nix/blob/master/doc/manual/src/c-api.md, language-specific bindings, and their use cases (currently broken link: https://nixos.org/manual/nix/unstable/c-api)24 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
8 Apr 2025
@o-santi:matrix.orgLeonardo Santiago Guess what? Setting ulimit -s unlimited made it work. 16:29:35
@o-santi:matrix.orgLeonardo SantiagoIt was an uncaught stack overflow.16:29:45
@o-santi:matrix.orgLeonardo SantiagoDidn't even occur to me until now.16:29:57
10 Apr 2025
@o-santi:matrix.orgLeonardo Santiago @roberth how does nix circunvent this issue in their main binary? I see I can try leveraging ld's -z stack_size=X but it only seems to work if you set it in the entry point elf binary, which I can't do as it's python! I didn't want to bleed this problem elsewhere, like force people to set ulimit -s unlimited, but I don't see many other ways around it, and surely nix has had to deal with this; though it is the elf entry point. Any tips or hints? 13:21:26
@o-santi:matrix.orgLeonardo SantiagoThere's the possiblity of spawning a new thread with an increased stack size, but that adds the context switching overhead to every nix evaluation, which is something I'd like to avoid if possible.13:22:44
@o-santi:matrix.orgLeonardo Santiago * @roberth how does nix circunvent this issue in their main binary? I see I can try leveraging ld's -z stack_size=X but it only seems to work if you set it in the entry point elf binary, which I can't do as it's python and I'm merely offering a .so extension library. I didn't want to bleed this problem elsewhere, like force people to set ulimit -s unlimited, but I don't see many other ways around it, and surely nix has had to deal with this; though it is the elf entry point. Any tips or hints? 13:23:25
@o-santi:matrix.orgLeonardo Santiago There's also the possibility of using setrlimit to increase the process's own stack size, that seems to me like the most graceful solution 14:09:58
@o-santi:matrix.orgLeonardo Santiago And indeed, that seems the solution that nix's binary uses, src/nix/main.cc calls nix::setStackSize(64MB) which internally calls setrlimit with that value. Awesome to know, most likely I'll try going down this route. 14:12:10
15 Apr 2025
@o-santi:matrix.orgLeonardo SantiagoI notice I may be bringing all the stupid problems and ideas to the chat, but would it be possible to static link against the nix C libraries?15:55:05
@o-santi:matrix.orgLeonardo Santiago* I notice I may be the onebringing all the stupid problems and ideas to the chat, but would it be possible to static link against the nix C libraries?15:56:12
@o-santi:matrix.orgLeonardo Santiago* I notice I may be the one bringing all the stupid problems and ideas to the chat, but would it be possible to static link against the nix C libraries?15:56:14

Show newer messages


Back to Room ListRoom Version: 10