back

by gurjeet·3y ago·view on hn ↗
To see how much havoc such a core change causes for Nix package builders, please see my troubleshooting report on building Postgres in Nix [1].

BTW, my conclusion was that Postgres, as distributed by the Nixpkgs, is untested because they very likely never bothered to run `make check`. And hence I would not recommend anyone to rely on it for production use.

[1]: https://www.postgresql.org/message-id/flat/CABwTF4VBTKLORbKM...

1 comments
> To see how much havoc such a core change causes for Nix package builders, please see my troubleshooting report on building Postgres in Nix

I consider this to be an excellent example of things working as expected. The point of Nix is not to make things easy, it's to expose all of the mistakes we've made (like depending on unspecified files, or attempting to network connections, etc.)

In this case, Nix(pkgs) has found and patched a bug in GNU Make: that it relies on undefined behaviour, namely the existence and behaviour of a /bin/sh executable. That's important, since the behaviour of /bin/sh differs between distros, e.g. some use Dash, some use Bash in POSIX-compatibility mode, macOS uses a version of Bash that's over a decade out of date, etc. Since GNU Make is used to build very low-level components, like GCC, that bug was causing pretty much everything in Nixpkgs to be under-specified/undefined. I'm very glad they fixed it!

It sounds like the Postgres test suite is also under-specified, since it attempts to inherit this undefined behaviour from GNU Make. Thankfully it sounds like Nix is doing its job, by rejecting this incomplete package definition. Even better, the problem is exposed when running the test suite; great job Postgres devs, that's exactly what test suites are for!