From eafc041a1944229e5e56d81bcd8cb4ee2397a842 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 13 Aug 2023 10:44:04 +0100 Subject: [PATCH] grub2: workaround parallel build failure by building .po files sequentially Without the change `grub2` build occasionally fails as: https://hydra.nixos.org/log/h04imslmgy9l33z6xxsaf9v4svqsc3n2-grub-2.12-rc1.drv $ msgmerge --update --lang=de de.po grub.pot $ msgmerge --update --lang=de de.po grub.pot ... de.po:745: end-of-file within string de.po:745: missing 'msgstr' section Here `msgmerge --update` attempts to update `de.po` from two parallel `make` calls when translation updates are happening. The change works around `de.po` stomping bu regenerating translations sequentially. Co-authored-by: Samuel Dionne-Riel --- pkgs/tools/misc/grub/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix index 27702a6ba4a..5fc189a4de1 100644 --- a/pkgs/tools/misc/grub/default.nix +++ b/pkgs/tools/misc/grub/default.nix @@ -149,6 +149,13 @@ stdenv.mkDerivation rec { substituteInPlace ./configure --replace '/usr/share/fonts/unifont' '${unifont}/share/fonts' ''; + postConfigure = '' + # make sure .po files are up to date to workaround + # parallel `msgmerge --update` on autogenerated .po files: + # https://github.com/NixOS/nixpkgs/pull/248747#issuecomment-1676301670 + make dist + ''; + configureFlags = [ "--enable-grub-mount" # dep of os-prober ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [