documentation: True runs Haddock for inferred multi-repl targets
I maintainer di solito rispondono entro 3 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- haskell
- Ambito
- build-system, cli, testing
Direzione di ricerca
Inizia da add_repl_target e confronta la sua elaborazione con setRootTargets, che gestisce già i target REPL espliciti. Riproduci il malfunzionamento abilitando documentation: True in cabal-testsuite/PackageTests/MultiRepl/EnabledClosure/cabal.project ed eseguendo il test multi-repl esistente oppure cabal repl --enable-multi-repl pkg-c pkg-a. Il lavoro è completato quando il pkg-b inferito viene caricato senza eseguire Haddock e il test di regressione passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When documentation: True is enabled, cabal repl --enable-multi-repl can run Haddock for a component that was added to the multi-repl session by dependency-closure calculation. That component is configured as BuildInplaceOnly InMemory, so one of its promised in-memory dependencies is not present in the installed package index used by Haddock. Haddock then fails with Cabal-4569.
This is similar to #10166, which was closed by #10248. That pull request fixed the package version passed through --promised-dependency. The reproduction below still fails with the fix from #10248 present, including on the current master, because the inferred multi-repl target retains elabBuildHaddocks = True.
haddock-internal is not required to reproduce the problem.
To reproduce
Starting from Cabal master at a21f3544700afb25529db8b825ad25a05e7a145c, add documentation: True to the existing multi-repl closure test project:
diff --git a/cabal-testsuite/PackageTests/MultiRepl/EnabledClosure/cabal.project b/cabal-testsuite/PackageTests/MultiRepl/EnabledClosure/cabal.project
@@
packages: pkg-a/*.cabal
packages: pkg-b/*.cabal
packages: pkg-c/*.cabal
+documentation: True
Then run the existing test, or run the equivalent multi-repl command against pkg-a and pkg-c:
cabal repl --enable-multi-repl pkg-c pkg-a
pkg-b is added to the session to satisfy the multi-repl closure property. The command then attempts to build its documentation and fails:
Running Haddock on library for pkg-b-0...
Error: [Cabal-4569]
internal error when calculating transitive package dependencies.
Debug info: []
As a control, the same multi-repl command succeeds when documentation is disabled.
Expected behavior
Every component configured as BuildInplaceOnly InMemory for a multi-repl session should have elabBuildHaddocks = False. The command should load pkg-a, inferred pkg-b, and pkg-c into GHCi without running Haddock for any of those interactive components.
The explicit REPL-target path already clears elabBuildHaddocks in setRootTargets. The dependency-closure path in add_repl_target sets elabReplTarget and elabBuildStyle, but does not clear elabBuildHaddocks.
A one-field change fixes the reproduction:
{ elabReplTarget = maybeToList (ComponentTarget <$> elabComponentName ecp <*> pure WholeComponent)
, elabBuildHaddocks = False
, elabBuildStyle = BuildInplaceOnly InMemory
}
I also tested a regression change that enables documentation: True in PackageTests/MultiRepl/EnabledClosure and asserts that Haddock is not run for inferred pkg-b. The test fails with Cabal-4569 before the one-field change and passes after it.
Why this matters for HLS
Haskell Language Server uses Cabal multi-repl when the editor enables both whole-project checking and multiple-component session loading. A project that wants all three of the following currently cannot use them together when its component graph triggers the closure path:
documentation: True
haskell.checkProject: true
haskell.sessionLoading: multipleComponents
Disabling documentation avoids the Cabal failure but also prevents the normal project build from generating Haddock documentation.
System information
- macOS 26.6.1 on Apple Silicon
- GHC 9.12.2
- Reproduced with cabal-install 3.16.1.0 and Cabal 3.16.1.0
- Reproduced with Cabal and cabal-install 3.19.0.0 development versions from
masterata21f3544700afb25529db8b825ad25a05e7a145c
- Lingua principale
- Haskell
- Stelle
- 1.8k
- Fork
- 763
- Merge medio
- 5g 16h
- PR unite (30g)
- 29
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell/cabal
-
needs triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
haskell/cabal#12568 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
needs triage type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
haskell/cabal#12525 · 3 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Required version of `cabal-install` to build CabalForse già presa @philderbeast l’ha presa 17 giorni fa. Apertadocumentation type: discussion
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
haskell/cabal#12477 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
Document which are our LTS releasesForse già presa @KeuqS l’ha presa 34 giorni fa. Apertadocumentation type: discussion
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
haskell/cabal#12373 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
haskell/cabal#12154 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di haskell/cabal
Issue simili
-
Allow QuickCheck 2.17Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Huerte/algo-solutions-python#260 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
IntersectMBO/cardano-ledger#6276 ·
I maintainer di solito rispondono entro 1 giorno