!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1174 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org190 Servers

Load older messages


SenderMessageTime
22 Dec 2025
@reckenrode:matrix.orgRandy EckenrodeOr malloc it based on the size of the incoming set.17:49:12
@reckenrode:matrix.orgRandy EckenrodeGlib supports using cleanup functions to make that less messy.17:49:27
@reckenrode:matrix.orgRandy Eckenrode Though if it’s a mask for all fds, you don’t really know the needed size. 17:50:00
@reckenrode:matrix.orgRandy Eckenrodehttps://man.freebsd.org/cgi/man.cgi?select17:52:21
@reckenrode:matrix.orgRandy Eckenrode Apple mentioned FreeBSD being unlimited. I agree we should probably increase the amount of memory it’s using (either by defining FD_SETSIZE or some other way). 17:53:19
@reckenrode:matrix.orgRandy Eckenrode

Looks like (unsurprisingly) FreeBSD has a similar implementation.

https://github.com/freebsd/freebsd-src/blob/f51e9d0e0988df58c94db586ab5c8b5fd091c004/sys/sys/select.h#L65

17:55:17
@reckenrode:matrix.orgRandy EckenrodeI guess FreeBSD doesn’t enforce the limit if you define it to something non-default.17:55:46
@ihar.hrachyshka:matrix.orgIhar Hrachyshkaso darwin just broke the api to pass posix17:56:22
@ihar.hrachyshka:matrix.orgIhar Hrachyshkawell, broke -> adjusted to standard17:56:33
@hexa:lossy.networkhexa Randy Eckenrode, emily any reason I should not update the darwin buildfarm to tahoe? 21:45:40
@-chi:matrix.org-chi left the room.21:48:15
@reckenrode:matrix.orgRandy EckenrodeNot that I can think of. It hasn’t broken Nix or Nixpkgs like updates have in the past.21:48:50
@qyliss:fairydust.spaceAlyssa Ross poll usability flip-flopping every macOS release is a sort of famous example of macOS POSIX-noncompliance: https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/ 21:49:59
@qyliss:fairydust.spaceAlyssa Ross * poll usability flip-flopping between macOS releases is a sort of famous example of macOS POSIX-noncompliance: https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/ 21:50:19
@qyliss:fairydust.spaceAlyssa Rossit might well presently work, but the track record is not confidence-inspiring21:50:48
@qyliss:fairydust.spaceAlyssa Rossand since you couldn't tell at build time whether the built program would end up being run on a macOS with broken poll, hardcoding not to use it on macOS was the only sensible solution21:52:12
@qyliss:fairydust.spaceAlyssa Ross(assuming the complexity of detecting it at runtime isn't worth it)21:52:55
@qyliss:fairydust.spaceAlyssa Ross * 21:53:07
@ihar.hrachyshka:matrix.orgIhar Hrachyshkait won21:55:45
@ihar.hrachyshka:matrix.orgIhar Hrachyshka* it won't help us anyway since it doesn't support device files21:55:58
@reckenrode:matrix.orgRandy Eckenrode The later poll change appears to have been a bug. 22:03:10
@reckenrode:matrix.orgRandy EckenrodeNot sure how they passed with the bug though. 🤷🏻‍♂️22:03:44
@winter:catgirl.cloudWinterthe opposite of nobody fwiw ;)22:58:35
@ihar.hrachyshka:matrix.orgIhar Hrachyshkachecked which fds are opened by qemu. basically, for every process inside the vm, each .so (or .dll for dotnet apps) is in the list for all services. since I'm using the VMs to test changes to my biefy VMs running lots of services (like jellyfin or *arr stack), the list gets exhausted. It's probably a function of these VMs using nix store overlay and not directly copying packages into the VM image. (otherwise I'd expect qemu opening just the image file).23:54:21
@ihar.hrachyshka:matrix.orgIhar Hrachyshkaone probably wouldn't even need to run a lot of services at the same time - just start and stop different processes serially and you should be able to hit the limit eventually. because with each nix store open (even if momentary), a new fd number is allocated sequentially. eventually it will reach 1024. AFAIU the limit is on the fd number, not on the length of the array.23:57:29
23 Dec 2025
@ihar.hrachyshka:matrix.orgIhar Hrachyshkathis seems to work (setting both macros): https://github.com/booxter/nixpkgs/commit/43a6fcf215ec455b41379d6d68e2a93aff626f26 will now check if setting just -D_DARWIN_UNLIMITED_SELECT is enough.00:31:06
@ihar.hrachyshka:matrix.orgIhar Hrachyshka (the GPollFD poll_fds[1024 * 2]; /* this is probably overkill */ comment in qemu seems to assume that they don't expect anyone to map the whole distro into VM :D) 00:31:38
@ihar.hrachyshka:matrix.orgIhar Hrachyshka * (the GPollFD poll_fds[1024 * 2]; /* this is probably overkill */ comment in qemu seems to suggest that they don't expect anyone to map the whole distro into VM :D) 00:33:31
@ihar.hrachyshka:matrix.orgIhar Hrachyshka * checked which fds are opened by qemu. basically, for every process inside the vm, each .so (or .dll for dotnet apps) is in the list for all services. since I'm using the VMs to test changes to my beafy VMs running lots of services (like jellyfin or *arr stack), the list gets exhausted. It's probably a function of these VMs using nix store overlay and not directly copying packages into the VM image. (otherwise I'd expect qemu opening just the image file). 00:33:59
@ihar.hrachyshka:matrix.orgIhar Hrachyshka

one probably wouldn't even need to run a lot of services at the same time - just start and stop different processes serially

Actually this is not true since fds are reused. one has to hold on to the fd (e.g. with a process running inside the VM).

00:56:00

Show newer messages


Back to Room ListRoom Version: 6