cabal-install reconfigures each time PATH changes

Open
#12,481 2 comments 4 reactions 1 assignee View on GitHub

Maintainers usually reply within 3 days

@sheaf is already working on this.

Since Oct 23, 2026.

Assessment

This issue has not been assessed yet.

Description

attention: pr-welcome blocked: needs reproducer cabal-install: cmd/(re)configure regression in 3.16 type: bug

Since 55aba1413b1b24f4eefa573300a8787f4804f734 (#10817 fixing #2015), cabal-install re-configures anytime PATH changes. That's a horrible user experience, in my opinion.

I think that commit was the wrong way to fix #2015. In that ticket, people were (rightfully) complaining that cabal repl inherited a stale PATH. This is because cabal baked in the value of PATH into the ghc ConfiguredProgram at the time of configuring ghc. I think that's nuts, and the fix was somehow to always reconfigure???

Even PR #10817 agrees that this is not ideal: "An alternative approach would be to stop baking the PATH variable into the environment of programs, but this would require more substantial changes to how Cabal manages environment variables." and I agree.

I argue we should change Cabal to store PATH symbolically (as an un-expanded variable) in ConfiguredProgram, and expand that variable in runProgramInvocation at program invocation time. This allows all of the existing override logic to work as before, but it does not require baking in PATH into ConfiguredProgram and thus completely sidesteps the issue. Then we no longer need to reconfigure if PATH changes.

Dominant language
Haskell
Stars
1.8k
Forks
766
Avg merge
5d 21h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/cabal

All issues in haskell/cabal

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.