Introduce build profiles

Aperta
#12,120 0 commenti 14 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
haskell
Ambito
build-system

Direzione di ricerca

Inizia tracciando il comando di build di cabal-install e la gestione di distDir e dello stato di ottimizzazione da parte della libreria Cabal. Confronta il flusso proposto con --profile=dev con i profili di build di Cargo collegati e rivedi le problematiche relative al profiling e specifiche dell’interprete in #6873 e #3565. Il lavoro sarà completo quando saranno definiti un design dei profili concordato, la selezione del profilo, la separazione degli artefatti, le opzioni raggruppate e l’avviso per il legacy-mode.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

attention: pr-welcome cabal-install: cmd/build recompilation type: enhancement

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 as stack, as they wouldn't need to know internal details about where Cabal places 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.

Lingua principale
Haskell
Stelle
1.8k
Fork
766
Merge medio
5g 21h
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di haskell/cabal

Tutte le issue di haskell/cabal

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.