Question: Behaviour of `cabal install` vs `cabal build`? (Placement of build artefacts)
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- haskell
- Domain
- build-system, cli
Research direction
Start by reproducing the reported commands in a Cabal checkout: cabal install cabal-install followed by cabal build. Trace where each command places build artefacts and why dependencies rebuild, then document the distinction and expected locations so the reported behavior is clearly explained.
Written by the indexing model from the issue text.
Description
I used to be under the assumption that cabal install basically boils down to cabal build and copying over executables.
Indeed when I run cabal install cabal-install in a cabal checkout it seems to build the checkout rather than the version published on hackage:
Starting cabal-install-3.19.0.0 (exe:cabal)
Building cabal-install-3.19.0.0 (exe:cabal)
Installing cabal-install-3.19.0.0 (exe:cabal)
Completed cabal-install-3.19.0.0 (exe:cabal)
However the binaries don't seem to be placed in dist-newstyle but some other place. As there is no cabal.exe in the checkout folder after cabal install cabal-install.
And if I run cabal build afterwards I rebuilds not just cabal but also some of the dependencies, ultimately producing a cabal.exe under dist-newstyle as expected.
I suspect this is somehow related to the behaviour of cabal configure which states:
The options of all of these flags apply only to local packages in a project; this behavior is different than that of cabal install, which applies flags to every package that would be built.
But I never explicitly invoked cabal configure so maybe transitively this is a reason, but still quite surprising.
Maybe this was always the case and I just never noticed. But it seems like surprising behaviour to me.
- Dominant language
- Haskell
- Stars
- 1.8k
- Forks
- 766
- Avg merge
- 5d 21h
- Merged PRs (30d)
- 27
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from haskell/cabal
-
needs triage type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
haskell/cabal#12568 · 1 comment ·
Maintainers usually reply within 3 days
-
needs triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
haskell/cabal#12525 · 3 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Required version of `cabal-install` to build CabalPossibly taken @philderbeast claimed this 24 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
haskell/cabal#12477 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
-
Document which are our LTS releasesPossibly taken @KeuqS claimed this 41 days ago. Opendocumentation type: discussion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
haskell/cabal#12373 · 2 comments ·
Maintainers usually reply within 3 days
Similar issues
-
bug desktop
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
simplex-chat/simplex-chat#8291 ·
Maintainers usually reply within 1 day
-
[BUG]: C# programs with top-level statements fail to compilePossibly taken @AsyncNigam claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
compiler-explorer/compiler-explorer#9625 · 1 comment ·
Maintainers usually reply within 1 day
-
reflex-0.10Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
commercialhaskell/stackage#8180 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenZeppelin/canton-contracts#140 ·
Maintainers usually reply within 1 day
-
takeInterval yields nothing, dropInterval drops nothingPossibly taken @GuillaumedeVolpiano claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
composewell/streamly#3271 ·