From 2560ea9852e7b7824670f432dd94082ddf759f20 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Thu, 1 Jun 2023 17:27:13 +0200 Subject: [PATCH] Do not check for OptO in scripts See #8963 for reason and clarification requests. --- .../Distribution/PackageDescription/Check/Target.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Cabal/src/Distribution/PackageDescription/Check/Target.hs b/Cabal/src/Distribution/PackageDescription/Check/Target.hs index 67865fa0020..9884a1ce724 100644 --- a/Cabal/src/Distribution/PackageDescription/Check/Target.hs +++ b/Cabal/src/Distribution/PackageDescription/Check/Target.hs @@ -796,9 +796,13 @@ checkGHCOptions title t opts = do checkFlags ["-prof"] (PackageBuildWarning $ OptProf title) - checkFlags - ["-o"] - (PackageBuildWarning $ OptO title) + -- Does not apply to scripts. + -- Why do we need this? See #8963. + pid <- asksCM (pnPackageId . ccNames) + unless (pid == fakePackageId) $ + checkFlags + ["-o"] + (PackageBuildWarning $ OptO title) checkFlags ["-hide-package"] (PackageBuildWarning $ OptHide title)