`stack haddock` generates incorrect relative links
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- haskell
- 領域
- build-system, cli, documentation
調査の方向性
まず、簡単なプロジェクトで stack haddock --verbose を使って問題を再現し、次に生成された all ドキュメント用の Haddock の -i 引数を組み立てているコードを追跡します。再エクスポートされた base モジュールのリンクが、サフィックス付きのパスではなく既存のパッケージディレクトリを指していることを確認して、修正を検証します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Haskell
- スター
- 4.1k
- フォーク
- 857
- 平均マージ
- 17時間 32分
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
commercialhaskell/stack のほかの issue
-
Build Stack against Cabal >= 3.18対応中かも @mpilgrem が 14 日前に担当しました。 オープン
commercialhaskell/stack#6976 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
commercialhaskell/stack#6954 ·
-
Support type-checking without compiling再び着手できるかも @mpilgrem が 135 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンcomponent: build type: enhancement
commercialhaskell/stack#6951 · リアクション 3 件 · 担当者 1 名 ·
-
Support semaphore-compat 2.0.0再び着手できるかも @mpilgrem が 158 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンcomponent: build in progress type: enhancement
commercialhaskell/stack#6934 · コメント 3 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
commercialhaskell/stack#6864 · コメント 1 件 ·
commercialhaskell/stack の issue をすべて見る
似ている issue
-
area:client bug priority-low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
simplex-chat/simplex-chat#8372 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
compiler-explorer/compiler-explorer#9710 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
http-semantics-0.5.0オープンfailure: bounds
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
commercialhaskell/stackage#8187 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信