Skip to content

fix(Cabal, cabal-install): default debug-info level to NoDebugInfo - #12200

Open
zlonast wants to merge 1 commit into
haskell:masterfrom
zlonast:zlonast/wrong-debuginfo-default
Open

fix(Cabal, cabal-install): default debug-info level to NoDebugInfo#12200
zlonast wants to merge 1 commit into
haskell:masterfrom
zlonast:zlonast/wrong-debuginfo-default

Conversation

@zlonast

@zlonast zlonast commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

In some cases we will display the wrong debug level flag.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@jappeace

Copy link
Copy Markdown
Collaborator

Why change the default debug info?

The current default says it's "Normal", which I guess is different from "No" debug info.

@zlonast

zlonast commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@jappeace Currently, this is only available for Haskell files generated via cabal-hooks. (that why i change flagToDebugInfoLevel) and there is another case when the saved package does not have this field in its config (this is simply an impossible situation at the moment, we always define a default field and write it)

Others use it:

cabal setup

defaultConfigFlags :: ProgramDb -> ConfigFlags
defaultConfigFlags progDb =
  emptyConfigFlags
    { ...
    , configDebugInfo = Flag NoDebugInfo
      ...
    }

and

cabal build and cabal install

elaborateInstallPlan
  :: HasCallStack
  => Verbosity
  -> Platform
  -> Compiler
  -> ProgramDb
  -- ^ __Configured__ compiler program database (ghc, ghc-pkg, haddock, ld, etc)
  -> Maybe PkgConfigDb
  -> DistDirLayout
  -> StoreDirLayout
  -> SolverInstallPlan
  -> [PackageSpecifier (SourcePackage (PackageLocation loc))]
  -> Map PackageId PackageSourceHash
  -> InstallDirs.InstallDirTemplates
  -> ProjectConfigShared
  -> PackageConfig
  -> PackageConfig
  -> Map PackageName PackageConfig
  -> LogProgress (ElaboratedInstallPlan, ElaboratedSharedConfig)
  ...
                  , withDebugInfo = perPkgOptionFlag NoDebugInfo pkgid packageConfigDebugInfo
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants