From 4db1c8b19935976b1e055b40c500edfe3f2db7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Tue, 2 Feb 2021 08:33:24 +0100 Subject: [PATCH] nvidia-settings: fix parallel build race condition Fix a race condition that occurs in parallel builds of nvidia-settings, frequently ending in the following error: /bin/bash: _out/Linux_x86_64/antialias.png.h: No such file or directory make[1]: *** [Makefile:320: _out/Linux_x86_64/antialias.png.h] Error 1 Upstream issue and fix from: https://github.com/NVIDIA/nvidia-settings/issues/59 --- .../nvidia-x11/nvidia-setttings-parallel-build.patch | 12 ++++++++++++ pkgs/os-specific/linux/nvidia-x11/settings.nix | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/os-specific/linux/nvidia-x11/nvidia-setttings-parallel-build.patch diff --git a/pkgs/os-specific/linux/nvidia-x11/nvidia-setttings-parallel-build.patch b/pkgs/os-specific/linux/nvidia-x11/nvidia-setttings-parallel-build.patch new file mode 100644 index 000000000000..ed3fe7b6d6df --- /dev/null +++ b/pkgs/os-specific/linux/nvidia-x11/nvidia-setttings-parallel-build.patch @@ -0,0 +1,12 @@ +diff --git a/src/Makefile b/src/Makefile +index acbb1b8..fe97103 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -242,6 +242,7 @@ endif + + define BINARY_DATA_HEADER_RULE + $$(OUTPUTDIR)/$(notdir $(1)).h: ++ $(at_if_quiet)$(MKDIR) $$(OUTPUTDIR) + $(at_if_quiet){ \ + $$(PRINTF) "extern const char _binary_$(subst .,_,$(notdir $(1)))_start[];\n"; \ + $$(PRINTF) "extern const char _binary_$(subst .,_,$(notdir $(1)))_end[];\n"; \ diff --git a/pkgs/os-specific/linux/nvidia-x11/settings.nix b/pkgs/os-specific/linux/nvidia-x11/settings.nix index d5bbf40e2b8a..f75e3aff1734 100644 --- a/pkgs/os-specific/linux/nvidia-x11/settings.nix +++ b/pkgs/os-specific/linux/nvidia-x11/settings.nix @@ -45,6 +45,12 @@ stdenv.mkDerivation { version = nvidia_x11.settingsVersion; inherit src; + patches = [ + # Fix a race condition in parallel builds. + # https://github.com/NVIDIA/nvidia-settings/issues/59#issuecomment-770302032 + ./nvidia-setttings-parallel-build.patch + ]; + nativeBuildInputs = [ pkg-config m4 ]; buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ]