`stack haddock` generates incorrect relative links
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- haskell
- Área
- build-system, cli, documentation
Línea de trabajo
Empieza reproduciendo el problema con el proyecto trivial y stack haddock --verbose; después, sigue el código que ensambla los argumentos -i de Haddock para la documentación all generada. Verifica la corrección confirmando que los enlaces a los módulos base reexportados apuntan al directorio de paquete existente en lugar de a la ruta con sufijo.
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 uses incorrect relative links for re-exported packages in the index file. This seems to be caused by the wrong argument being given to the -i option when invoking Haddock.
Steps to reproduce
Create a trivial project, like so:
# stack.yaml
snapshot:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/34.yaml
packages:
- .
# package.yaml
dependencies:
- base
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, all links to modules in base are incorrect. For instance, the link for Data.Eq points to doc/base-4.20.2.0-127e/Data-Eq.html. The base-4.20.2.0-127e folder does not exist, but base-4.20.2.0 does.
Running stack haddock --verbose reveals that the all documentation was generated with the following call to haddock (i have replaced parts of the path with $HOME and $PROJECT to try to make it a tiny bit less verbose, but it's still a lot, sorry):
$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-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 ../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 ../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 ../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 ../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
The key element is that the argument to -i is incorrect. Note, for instance, that for base, the argument is as follows: -i ../base-4.20.2.0-127e,path/to/base.haddock. Re-running the command, but will the argument to -i changed to not include the prefix fixes all relative links in the generated documentation.
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
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de commercialhaskell/stack
-
Build Stack against Cabal >= 3.18Posiblemente ocupada @mpilgrem la tomó hace 14 días. Abierto
commercialhaskell/stack#6976 · 1 asignado ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
commercialhaskell/stack#6954 ·
-
Support type-checking without compilingQuizá libre de nuevo @mpilgrem la tomó hace 135 días y no hay ningún pull request abierto. Abiertocomponent: build type: enhancement
commercialhaskell/stack#6951 · 3 reacciones · 1 asignado ·
-
Support semaphore-compat 2.0.0Quizá libre de nuevo @mpilgrem la tomó hace 158 días y no hay ningún pull request abierto. Abiertocomponent: build in progress type: enhancement
commercialhaskell/stack#6934 · 3 comentarios · 1 asignado ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
commercialhaskell/stack#6864 · 1 comentario ·
Todos los issues de commercialhaskell/stack
Issues similares
-
area:client bug priority-low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
simplex-chat/simplex-chat#8372 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
compiler-explorer/compiler-explorer#9710 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
agda/agda#8965 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
http-semantics-0.5.0Abiertofailure: bounds
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
commercialhaskell/stackage#8187 · 1 reacción ·
Los mantenedores suelen responder en 1 día