From 15ebfa7be78d3390364b550ccbf1c55a09f4cfa4 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sat, 22 Apr 2023 15:56:31 -0400 Subject: [PATCH] vim: Harden build against ex and other tools being missing Those tools are often used as build-time dependency. Some deficiencies in the upstream makefiles makes it possible that they will not be installed, even though the `make install` call was successful. This *could* make the `vim` build fail where it wouldn't have failed previously, but it will now fail in a correct manner instead of being incorrectly successful. The previous patch (actually using -j1 in install phase) should make this change redundant, but let's not pretend new bugs are never going to happen! --- pkgs/applications/editors/vim/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index 0bb2b0b8c0ce..c5b9a607f20d 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -50,6 +50,15 @@ stdenv.mkDerivation { ln -s $out/bin/vim $out/bin/vi mkdir -p $out/share/vim cp "${vimrc}" $out/share/vim/vimrc + + # Prevent bugs in the upstream makefile from silently failing and missing outputs. + # Some of those are build-time requirements for other packages. + for tool in ex xxd vi view vimdiff; do + if [ ! -e "$out/bin/$tool" ]; then + echo "ERROR: install phase did not install '$tool'." + exit 1 + fi + done ''; __impureHostDeps = [ "/dev/ptmx" ];