[Git][ghc/ghc][wip/T23577] hadrian: Only pass -Wno-nonportable-include-path on Darwin

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Sat Jul 1 13:30:42 UTC 2023



Ben Gamari pushed to branch wip/T23577 at Glasgow Haskell Compiler / GHC


Commits:
0a27f0ec by Ben Gamari at 2023-07-01T09:29:25-04:00
hadrian: Only pass -Wno-nonportable-include-path on Darwin

This flag, which was introduced due to #17798, is only understood by
Clang and consequently throws warnings on platforms using gcc. Sadly,
there is no good way to treat such warnings as non-fatal with `-Werror`
so for now we simply make this flag specific to platforms known to use
Clang and case-insensitive filesystems (Darwin and Windows).

See #23577.

- - - - -


1 changed file:

- hadrian/src/Settings/Warnings.hs


Changes:

=====================================
hadrian/src/Settings/Warnings.hs
=====================================
@@ -2,6 +2,7 @@ module Settings.Warnings (defaultGhcWarningsArgs, ghcWarningsArgs) where
 
 import Expression
 import Oracles.Flag
+import Oracles.Setting (isOsxTarget, isWinTarget)
 import Packages
 
 -- See @mk/warnings.mk@ for warning-related arguments in the Make build system.
@@ -12,7 +13,11 @@ defaultGhcWarningsArgs = mconcat
     [ notStage0 ? arg "-Wnoncanonical-monad-instances"
     , notM (flag CcLlvmBackend) ? arg "-optc-Wno-error=inline"
     , flag CcLlvmBackend ? arg "-optc-Wno-unknown-pragmas"
-    , arg "-optP-Wno-nonportable-include-path" -- #17798
+      -- Cabal can seemingly produce filepaths with incorrect case on filesystems
+      -- with case-insensitive names. Ignore such issues for now as they seem benign.
+      -- See #17798.
+    , isOsxTarget ? arg "-optP-Wno-nonportable-include-path"
+    , isWinTarget ? arg "-optP-Wno-nonportable-include-path"
     ]
 
 -- | Package-specific warnings-related arguments, mostly suppressing various warnings.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0a27f0ec18e703986dc121e19c684cf9fda159d3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0a27f0ec18e703986dc121e19c684cf9fda159d3
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230701/0bc6b1ab/attachment-0001.html>


More information about the ghc-commits mailing list