Introduce build profiles
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- haskell
- Domain
- build-system
Research direction
Start by tracing the cabal-install build command and the Cabal library's handling of distDir and optimization state. Compare the proposed --profile=dev flow with the linked Cargo build profiles and review the profiling and interpreter-specific concerns in #6873 and #3565. Done would require an agreed profile design, profile selection, artifact separation, bundled options, and the legacy-mode warning.
Written by the indexing model from the issue text.
Description
Currently, the Cabal library keeps track of whether a package is built with or without optimisations, which avoids optimised and unoptimised builds overwriting eachother's build artifacts. This allows for a reasonable development workflow that interleaves quick unoptimised builds while iterating with occasional slower optimised builds.
However, this is very fragile, as it doesn't cover things like profiling (see #6873) or interpreter-specific options (#3565).
I suggest introducing build profiles, like Cargo build profiles. One would invoke cabal-install with a command like
> cabal build --profile=dev
One core principle of this feature is that it would be a concept that only cabal-install knows about. Based on the selected profile, cabal-install would pass the appropriate flags to the Cabal library (e.g. setting the distDir) to avoid builds trampling over eachother. This would have many advantages:
- There would be a single source of truth for where the artifacts live, decided by
cabal-install. Cabal just puts things where it is told. This makes it easier for tools such asstack, as they wouldn't need to know internal details about whereCabalplaces build artifacts. - The idea plainly makes sense as a per-project concept, not a per-package concept.
Like the Cargo feature, it would allow bundling options, e.g. a development profile could include additional +debug flags to various libraries to enable assertions etc.
Introducing build profiles would also provide a way to change the defaults. Users that do not use build profiles are in "legacy mode" and get a warning about it.
- 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 ·