`stack haddock` groups modules incorrectly

Abierto
#6,864 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
haskell

Línea de trabajo

Reproduce el problema con los archivos stack.yaml y package.yaml proporcionados y, a continuación, inspecciona la invocación detallada de stack haddock y el all/index.html generado. Compara las entradas de package-db y la agrupación de módulos; se considera terminado cuando las dependencias aparecen bajo sus grupos de paquetes correctos, incluidos base, transformers y mtl.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Overview

When running stack haddock in a project, the generated documentation groups documentation modules in an unpredictable way.

Steps to reproduce

Create a trivial project with a few dependencies, like so:

# stack.yaml
snapshot:
  url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/34.yaml
packages:
  - .

# package.yaml
dependencies:
  - base
  - storable-record

library:
  source-dirs: lib

Then run stack haddock. Then open the documentation at file:///<project>/.stack-work/install/<platform>/<hash>/<ghc>/doc/all/index.html.

In it, modules are not grouped in a way that makes sense. For instance:

  • all base modules are grouped under QuickCheck-2.15.0.1;
  • all transformers modules are grouped under semigroups-0.20.1;
  • all mtl modules are at the top level, not within a package group.

A call to $ stack haddock --verbose reveals that documentation is created with the following haddock call:

/$HOME/.ghcup/ghc/9.10.3/bin/haddock-ghc-9.10.3 \
  --optghc=-package-db=/$HOME/.stack/snapshots/x86_64-linux/8a23ab0f4c447aa1863c20e527e4f2aeeec2f0c3c2ab9fbe859c65d4c711ecc7/9.10.3/pkgdb \
  --optghc=-package-db=/$HOME/$PROJECT/.stack-work/install/x86_64-linux/8a23ab0f4c447aa1863c20e527e4f2aeeec2f0c3c2ab9fbe859c65d4c711ecc7/9.10.3/pkgdb \
  --gen-contents \
  --gen-index \
  -i ../ghc-boot-th-9.10.3-9679,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/ghc-boot-th-9.10.3-9679/ghc-boot-th.haddock \
  -i ../mtl-2.3.1-bcd6,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/mtl-2.3.1-bcd6/mtl.haddock \
  -i ../array-0.5.8.0-4471,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/array-0.5.8.0-4471/array.haddock \
  -i ../ghc-internal-9.1003.0-a65c,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/ghc-internal-9.1003.0-a65c/ghc-internal.haddock \
  -i ../storable-record-0.0.7,/$HOME/.stack/snapshots/x86_64-linux/03a149f03ae9045878c23602050e9feb226fcf703f9493ca6662ad2a61705976/9.10.3/doc/storable-record-0.0.7/storable-record.haddock \
  -i ../utility-ht-0.0.17.2,/$HOME/.stack/snapshots/x86_64-linux/03a149f03ae9045878c23602050e9feb226fcf703f9493ca6662ad2a61705976/9.10.3/doc/utility-ht-0.0.17.2/utility-ht.haddock \
  -i ../containers-0.7-bf99,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/containers-0.7-bf99/containers.haddock \
  -i ../splitmix-0.1.3.2,/$HOME/.stack/snapshots/x86_64-linux/03a149f03ae9045878c23602050e9feb226fcf703f9493ca6662ad2a61705976/9.10.3/doc/splitmix-0.1.3.2/splitmix.haddock \
  -i ../pretty-1.1.3.6-7ead,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/pretty-1.1.3.6-7ead/pretty.haddock \
  -i ../haddock-issue-0.0.0,/$HOME/$PROJECT/.stack-work/install/x86_64-linux/8a23ab0f4c447aa1863c20e527e4f2aeeec2f0c3c2ab9fbe859c65d4c711ecc7/9.10.3/doc/haddock-issue-0.0.0/haddock-issue.haddock \
  -i ../deepseq-1.5.0.0-268d,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/deepseq-1.5.0.0-268d/deepseq.haddock \
  -i ../template-haskell-2.22.0.0-5e01,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/template-haskell-2.22.0.0-5e01/template-haskell.haddock \
  -i ../random-1.2.1.3,/$HOME/.stack/snapshots/x86_64-linux/03a149f03ae9045878c23602050e9feb226fcf703f9493ca6662ad2a61705976/9.10.3/doc/random-1.2.1.3/random.haddock \
  -i ../ghc-bignum-1.3-9ca9,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/ghc-bignum-1.3-9ca9/ghc-bignum.haddock \
  -i ../QuickCheck-2.15.0.1,/$HOME/.stack/snapshots/x86_64-linux/03a149f03ae9045878c23602050e9feb226fcf703f9493ca6662ad2a61705976/9.10.3/doc/QuickCheck-2.15.0.1/QuickCheck.haddock \
  -i ../base-4.20.2.0-127e,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/base-4.20.2.0-127e/base.haddock \
  -i ../bytestring-0.12.2.0-825f,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/bytestring-0.12.2.0-825f/bytestring.haddock \
  -i ../semigroups-0.20.1,/$HOME/.stack/snapshots/x86_64-linux/03a149f03ae9045878c23602050e9feb226fcf703f9493ca6662ad2a61705976/9.10.3/doc/semigroups-0.20.1/semigroups.haddock \
  -i ../transformers-0.6.1.1-4229,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/transformers-0.6.1.1-4229/transformers.haddock \
  -i ../ghc-prim-0.12.0-d0f9,/$HOME/.ghcup/ghc/9.10.3/lib/ghc-9.10.3/lib/../../../share/doc/ghc-9.10.3/html/libraries/ghc-prim-0.12.0-d0f9/ghc-prim.haddock

I have tried running the same command without the package-db arguments, and it removes all grouping, which suggests that the issue stems from an incorrect grouping in the pkgdb files?

Stack version
$ stack --version
Version 3.9.3, Git revision c7eb8487a82d5c3e0b88d56f8b8a98be23223eb5 x86_64 hpack-0.39.1
Lenguaje dominante
Haskell
Estrellas
4.1k
Forks
857
Merge medio
17 h 32 min
PR fusionados (30 d)
5

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de commercialhaskell/stack

Todos los issues de commercialhaskell/stack

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.