It does mean every module in `base` and every module in `ghc-internal`. We already seem to have `NoImplicitPrelude` in each of them despite a `NoImplicitPrelude` in base.cabal.There must be a better way than editing several hundred modules to add a one-line pragma. All I want to do is to get cabal to pass the flag to every module.I thought there was a ghc-options directive in cabal? Maybe I can sayghc-options: -XNoImplicitKnownKeyNamesand cabal will just pass it along?But I don't see *any* ghc-options in base.cabal. How does cabal decide what options to pass to GHC when compiling base (e.g -O2)?SimonOn Sun, 15 Mar 2026 at 20:15, Brandon Allbery <allbery.b@gmail.com> wrote:If you're adding it to a cabal file then you need to modify Cabal, because it wants to mark packages as unbuildable on ghcs that don't support declared extensions. Placing it in source files avoids this, but you would have to modify all files that need to know about it (hopefully that doesn't mean all of `base`).On Sun, Mar 15, 2026 at 4:08 PM Simon Peyton Jones <simon.peytonjones@gmail.com> wrote:Thanks. But where is this Cabal-syntax directory? How do I "bump the cabal version"?I'm only trying to build GHC! I wasn't intending to modify cabal.SimonOn Sun, 15 Mar 2026 at 17:26, Brandon Allbery <allbery.b@gmail.com> wrote:It goes in `Cabal-syntax/src/Language/Haskell/Extensions.hs`, in `data KnownExtension`. The parse table is built from the constructor names, and `No` prefixes are handled automatically. Note that you'll need to also bump the `cabal-version` (file format version) and add an entry to the file format documentation (`doc/file-format-changelog.rst`).On Sun, Mar 15, 2026 at 1:18 PM Simon Peyton Jones via ghc-devs <ghc-devs@haskell.org> wrote:_______________________________________________FriendsAs part of the reinstallable base project I'm adding an extension "ImplicitKnownKeyNames" to GHC. But if I put "NoImplicitKnownKeyNames" in base.cabal.in I get the errorWarning: [unknown-extension] Unknown extensions: NoImplicitKnownKeyNameswhen building the base library. I think this comes from cabal.How can I tell cabal about the new extension?
ThanksSimon
ghc-devs mailing list -- ghc-devs@haskell.org
To unsubscribe send an email to ghc-devs-leave@haskell.org
--brandon s allbery kf8nh--brandon s allbery kf8nh