···99 gettext,
100101 # NUMA
102- numaSupport ?
103- lib.versionAtLeast version "18"
104- && lib.meta.availableOn stdenv.hostPlatform numactl
105- # NUMA can fail in 18beta2 on some hardware with:
106- # ERROR: invalid NUMA node id outside of allowed range [0, 0]: 1
107- # https://github.com/NixOS/nixpkgs/pull/411958#issuecomment-3031680123
108- # https://www.postgresql.org/message-id/flat/E1u1tr8-003BbN-2E%40gemulon.postgresql.org
109- && version != "18beta2",
110 numactl,
111112 # PAM
···432 substituteInPlace "src/Makefile.global.in" --subst-var out
433 substituteInPlace "src/common/config_info.c" --subst-var dev
434 cat ${./pg_config.env.mk} >> src/common/Makefile
00000000000435 ''
436 # This check was introduced upstream to prevent calls to "exit" inside libpq.
437 # However, this doesn't work reliably with static linking, see this and following:
···99 gettext,
100101 # NUMA
102+ numaSupport ? lib.versionAtLeast version "18" && lib.meta.availableOn stdenv.hostPlatform numactl,
0000000103 numactl,
104105 # PAM
···425 substituteInPlace "src/Makefile.global.in" --subst-var out
426 substituteInPlace "src/common/config_info.c" --subst-var dev
427 cat ${./pg_config.env.mk} >> src/common/Makefile
428+429+ # This test always fails on hardware with >1 NUMA node: the sysfs
430+ # dirs providing information about the topology are hidden in the sandbox,
431+ # so postgres assumes there's only a single node `0`. However,
432+ # the test checks on which NUMA nodes the allocated pages are which is >1
433+ # on such hardware. This in turn triggers a safeguard in the view
434+ # which breaks the test.
435+ # Manual tests confirm that the testcase behaves properly outside of the
436+ # Nix sandbox.
437+ substituteInPlace src/test/regress/parallel_schedule \
438+ --replace-fail numa ""
439 ''
440 # This check was introduced upstream to prevent calls to "exit" inside libpq.
441 # However, this doesn't work reliably with static linking, see this and following: