haskell / haskell/cabal

`cabal run -O0` seems to use wrong executable

Open
#6,994 3 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/run type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

While working on https://github.com/dhall-lang/dhall-haskell, I've run into a weird issue where `cabal run -O0` seems to use an executable that doesn't incorporate the latest source changes. Without the `-O0` flag, `cabal run` behaves as expected.

Is this a known issue?

**System information**

```
$ cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with cabal-install 3.2.0.0 using the dhall-haskell project, comparing `cabal run -O0` with `cabal run` after source changes. Trace which executable each command selects and verify that both commands use the latest source changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.