From d03137ef29800face8d58357d224751c312bfdf3 Mon Sep 17 00:00:00 2001
From: Zoe Zuser <zoe@mzero.dev>
Date: Sun, 19 May 2024 05:18:44 -0400
Subject: [PATCH] Add comment clarifying disabling check for scripts

closes #8963
---
 Cabal/src/Distribution/PackageDescription/Check/Target.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Cabal/src/Distribution/PackageDescription/Check/Target.hs b/Cabal/src/Distribution/PackageDescription/Check/Target.hs
index fdafa89b6e..cc86961779 100644
--- a/Cabal/src/Distribution/PackageDescription/Check/Target.hs
+++ b/Cabal/src/Distribution/PackageDescription/Check/Target.hs
@@ -825,9 +825,10 @@ checkGHCOptions title t opts = do
       checkFlags
         ["-prof"]
         (PackageBuildWarning $ OptProf title)
-      -- Does not apply to scripts.
-      -- Why do we need this? See #8963.
       pid <- asksCM (pnPackageId . ccNames)
+      -- Scripts add the -o flag in the fake-package.cabal in order to have the
+      -- executable name match the script name even when there are characters
+      -- in the script name which are illegal to have as a target name.
       unless (pid == fakePackageId) $
         checkFlags
           ["-o"]
-- 
GitLab