`stack haddock` generates incorrect relative links
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- haskell
- Lĩnh vực
- build-system, cli, documentation
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề với dự án đơn giản và stack haddock --verbose, sau đó lần theo mã xây dựng các đối số -i của Haddock cho tài liệu all được tạo. Xác minh bản sửa bằng cách xác nhận rằng các liên kết đến những mô-đun base được re-export trỏ đến thư mục gói hiện có thay vì đường dẫn có hậu tố.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Haskell
- Star
- 4.1k
- Fork
- 857
- Merge trung bình
- 17 giờ 32 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của commercialhaskell/stack
-
Build Stack against Cabal >= 3.18Có thể đã có người làm @mpilgrem đã nhận 14 ngày trước. Đang mở
commercialhaskell/stack#6976 · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
commercialhaskell/stack#6954 ·
-
Support type-checking without compilingCó thể làm lại được @mpilgrem đã nhận 135 ngày trước và không có pull request nào đang mở. Đang mởcomponent: build type: enhancement
commercialhaskell/stack#6951 · 3 reaction · 1 người được giao ·
-
Support semaphore-compat 2.0.0Có thể làm lại được @mpilgrem đã nhận 158 ngày trước và không có pull request nào đang mở. Đang mởcomponent: build in progress type: enhancement
commercialhaskell/stack#6934 · 3 bình luận · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
commercialhaskell/stack#6864 · 1 bình luận ·
Tất cả issue của commercialhaskell/stack
Issue tương tự
-
area:client bug priority-low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
simplex-chat/simplex-chat#8372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
compiler-explorer/compiler-explorer#9710 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
agda/agda#8965 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
http-semantics-0.5.0Đang mởfailure: bounds
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commercialhaskell/stackage#8187 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày