Skip to content

cabal doesn't reconfigure ghc-pkg when binary on PATH changes #11417

@fendor

Description

@fendor

Describe the bug

Perhaps related to #11373

cabal-3.16.1.0 doesn't reconfigure ghc-pkg when I switch the ghc version on PATH.

To Reproduce
Steps to reproduce the behaviour:

> cabal-3.16.1.0 get text-2.1.3
> cd text-2.1.3
> ghcup install ghc --set 9.10.3
> cabal-3.16.1.0 path
> ghcup install ghc --set 9.12.2
> cabal-3.16.1.0 path
Error: [Cabal-4000]
Version mismatch between ghc and ghc-pkg: C:\ghcup\bin\ghc.exe is version 9.10.3 C:\ghcup\bin\ghc-pkg.exe is version 9.12.2

Expected behavior

Should correctly reconfigure and show the output of cabal path regardless. Works fine on cabal-3.14.2.0 on windows.

System information

  • Windows (uncovered by HLS CI)
    • I would guess this is reproducible on linux as well
  • cabal-3.16.1.0
  • ghc versions 9.12.2 and 9.10.3 but probably irrelevant

Workaround

Remove dist-newstyle directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions