From 2a6e81ca058ea3fff7e25189764b29bef343dba4 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Tue, 12 Nov 2024 16:51:40 +0000
Subject: [PATCH] hadrian: fix bindist makefile for wasm32-wasi target

This patch fixes one incoherent place between bindist makefile and
hadrian logic: I forgot to include wasi/wasm32 in
OsSupportsGHCi/ArchSupportsGHCi as well. And this results in incorrect
settings file generated after installing the bindist, and "Use
interpreter"/"Have interpreter" fields incorrectly have "NO" values
where they should be "YES" like --info output of in-tree version.

(cherry picked from commit 75a2eae4cab9ba94f7ba331f64a65fe3519f26dd)
(cherry picked from commit 735f3f9acd6c4346132157a9bd87448ed332a5f3)
---
 hadrian/bindist/config.mk.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hadrian/bindist/config.mk.in b/hadrian/bindist/config.mk.in
index 76b9c725180..cf43a26ad1c 100644
--- a/hadrian/bindist/config.mk.in
+++ b/hadrian/bindist/config.mk.in
@@ -158,8 +158,8 @@ endif
 
 # Whether to include GHCi in the compiler.  Depends on whether the RTS linker
 # has support for this OS/ARCH combination.
-OsSupportsGHCi=$(strip $(patsubst $(TargetOS_CPP), YES, $(findstring $(TargetOS_CPP), mingw32 linux solaris2 freebsd dragonfly netbsd openbsd darwin kfreebsdgnu)))
-ArchSupportsGHCi=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc powerpc64 powerpc64le sparc sparc64 arm aarch64)))
+OsSupportsGHCi=$(strip $(patsubst $(TargetOS_CPP), YES, $(findstring $(TargetOS_CPP), mingw32 linux solaris2 freebsd dragonfly netbsd openbsd darwin kfreebsdgnu wasi)))
+ArchSupportsGHCi=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 powerpc powerpc64 powerpc64le sparc sparc64 arm aarch64 wasm32)))
 
 ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
 GhcWithInterpreter=YES
-- 
GitLab