From d0b48113859bd22c254ca89ff44510c472b8408b Mon Sep 17 00:00:00 2001 From: Matthew Pickering <matthewtpickering@gmail.com> Date: Fri, 18 Aug 2023 10:28:56 +0100 Subject: [PATCH] hadrian: Add error when trying to build binary-dist target on windows The binary dist produced by `binary-dist` target doesn't work on windows because of the wrapper script the makefile installs. In order to not surprise any packagers we just give an error if someone tries to build the old binary-dist target rather than the reloc-binary-dist target. --- hadrian/src/Rules/BinaryDist.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index 8cb7e9063cb9..1229c5f3aa85 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -290,7 +290,10 @@ bindistRules = do IO.removeFile unversioned_wrapper_path <|> return () IO.createFileLink versioned_wrapper unversioned_wrapper_path - let buildBinDist = buildBinDistX "binary-dist-dir" "bindist" + let buildBinDist compressor = do + win_target <- isWinTarget + when win_target (error "normal binary-dist does not work for windows target, use `reloc-binary-dist-*` target instead.") + buildBinDistX "binary-dist-dir" "bindist" compressor buildBinDistReloc = buildBinDistX "reloc-binary-dist-dir" "reloc-bindist" buildBinDistX :: String -> FilePath -> Compressor -> Action () -- GitLab