From 146d1804149b5b5eae9832f6cfea53ac6c06a71f 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 e4219bb4e75..2734110bde1 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)