haskell / haskell/cabal

cabal install run immediately after cabal build unnecessarily rebuilds the project

Open
#6,919 21 comments 9 reactions 0 assignees View on GitHub
cabal-install: cmd/install re: v1-install re: v1-vs-v2 type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

I have just run cabal build. No source files have changed. I run cabal install (with some options), and it rebuilds the entire project from scratch.

**To Reproduce**

cabal unpack propellor-5.9.1
cd propellor-5.9.1
cabal build
cabal install --install-method=symlink --installdir=. exe:propellor --overwrite-policy=always

I notice that, if I `cabal build exe:propellor`, the `cabal install` does not re-build.
The default `cabal build` of both executables and the library differing from what's it's being asked to install seem to be what causes the re-build. I think it should be possible to build everything and then only install part of what was build, without a rebuild.

**System information**

cabal-install version 3.0.0.0
compiled using version 3.0.1.0 of the Cabal library

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior with the listed cabal unpack, build, and install commands, comparing default cabal build with cabal build exe:propellor. Investigate how cabal install selects previously built executables and libraries. Done means installing exe:propellor after a full build does not rebuild unchanged project components.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.