`--haddock-executables` index does not distinguish `Main` modules

Aperta
#6,514 2 commenti 1 reazione 1 assegnatario Vedi su GitHub

@mpilgrem ci sta già lavorando.

Dal 9/3/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

resolution: upstream issue type: bug

Version 2.16.0, Git revision 1817292f22987cc764a72146cf707f028c575bf5 (10654 commits) PRE-RELEASE x86_64 has --haddock-executables (built on top of Cabal (the library)'s haddock --executables), but there are problems with the index.

Consider a two-package project (packageA, packageB) each with two executable components (eg packageA-exe1, packageA-exe2). The index generated for project packages has four links to Main but all of them are to the Main of packageB-exe1.

Using haddock --show-interface reveals that all four *.haddock files commence:

{"link_env":{"$main$Main$main":"Main", ...

That can be contrasted with the two *.haddock files for the main library:

{"link_env":{"$packageA-0.1.0.0-ErEp6QMCDA5L7wclG18d4W$Lib$someFunc":"Lib"}, ...

and

{"link_env":{"$packageB-0.1.0.0-LJmkqLQIxknEQ7YIpA65Ah$Lib$someFunc":"Lib"}, ...

--cabal-verbosity 3 reveals that, with the main library, Cabal (the library) invokes Haddock with options that include:

packageA> --optghc=-this-unit-id
packageA> --optghc=packageA-0.1.0.0-ErEp6QMCDA5L7wclG18d4W

packageB> --optghc=-this-unit-id
packageB> --optghc=packageB-0.1.0.0-LJmkqLQIxknEQ7YIpA65Ah

There is no equivalent for when Cabal invokes Haddock for the executable components.

Lingua principale
Haskell
Stelle
4.1k
Fork
857
Merge medio
17h 32m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 commercialhaskell/stack

Tutte le issue di commercialhaskell/stack

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.