NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.49k stars 1.44k forks source link

Abstract over `getrusage` #10542

Open Ericson2314 opened 2 months ago

Ericson2314 commented 2 months ago

EvalState::printStatistics uses getrusage, which is not portable to Windows. https://github.com/postgres/postgres/blob/master/src/port/win32getrusage.c is a compat shim however from venerable PostgreSQL that I think is appropriately licensed for us.

We should create a new interface in libutil for what EvalState::printStatistics needs. (It doesn't need to have the same type signature as getrusage if that helps) and then implement Windows and Unix implementations.

_Originally posted by @Ericson2314 in https://github.com/NixOS/nix/pull/8901#discussion_r1553879568_

nixos-discourse commented 2 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-on-windows/1113/109