Adding `write-ghc-environment-files: always` to `cabal.project.local` does not trigger rebuild

Open
#12,408 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
build-system

Research direction

Start by reproducing the report with write-ghc-environment-files: always in cabal.project.local, then compare it with cabal build --write-ghc-environment-files=always. Read the code that handles this setting and determines whether a build is up to date. Done means the project-file setting causes the expected environment file to be created or updated, including when the build otherwise reports Up to date.

Written by the indexing model from the issue text.

Description

Cabal: cmd/build type: bug

I think an expected invariant is that if write-ghc-environment-files: always is in the build configuration then after invoking cabal build such an environment files exists in an up-to-date state.

I experience that adding write-ghc-environment-files: always to cabal.project.local does not trigger a rebuild; cabal build just answers Up to date, and no environment file is created.

In contrast, cabal build --write-ghc-environment-files=always (also answering Up to date) does write such a file.

This is on the latest released version:

❯ cabal -V
cabal-install version 3.18.1.0
compiled using version 3.18.1.0 of the Cabal library 
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.