Refactoring proposal : yet another move towards cabal
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- haskell
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu bằng cách so sánh src/Stack/Types/DumpPackage.hs và src/Stack/Types/GhcPkgId.hs với các kiểu Cabal được tham chiếu là InstalledPackageInfo, ComponentId và UnqualComponentName. Xem xét bốn thay đổi biểu diễn được đề xuất và các hệ quả của chúng đối với Backpack. Công việc được xem là hoàn tất khi đã thống nhất được hướng đi cho RFC và đã refactor một cách phối hợp các kiểu bị trùng lặp, việc parsing và các cách biểu diễn component-name.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
So, while working on backpack related processing, I realized that there are many things that stack duplicate in very slightly different ways from cabal, with no obvious benefit and pretty obvious downsides (such as conversion costs). I've come to a point where I either have to duplicate yet another huge chunk of backpack related logic into Stack because the types differ, or I can try to refactor current duplicates from Stack which make no sense. This would benefit Stack by reducing the amount of conversion and parsing logic done on stack's side (but some conversation will still be needed at places but I'd expect far less than the current state of things). This should also reduce the amount of code in stack at the cost of slightly hampered flexibility and maintenance burden for the imported logic.
This issue is a request for comment for the following refactorings (That I would do if I'm allowed):
- The entire DumpPackage type and parsing logic is a duplicate of the InstalledPackageInfo in cabal. The parsing function in cabal is expecting strict ByteString whereas the stack one operates on a stream of Text, but I'd expect the transition to be relatively smooth.
- The GhcPkgId is the mix of many different types in Cabal (but mostly, as of now in stack, it's the mirror of the ComponentId). This is a problem for Backpack because Backpack has a notion of OpenModule (that is component which lacks implementation of its signatures) and this notion is hard to represent correctly with current GhcPkgId type.
- StackUnqualComponentName should be a newtype over UnqualComponentName from cabal, there are little reasons for not having this and the current Text based version is less efficient than the cabal one.
- The NamedComponent from Stack should also use the StackUnqualComponentName as the underlying representation for better interop. A Text translating function can be implemented to limit the amount of refactoring needed.
That's it, for now, I believe this is a significant enough refactoring. It would really ease the process for Backpack support.
PS: Not that while Backpack requires component based builds and they incur a significant slowdown compared to package based builds (as explained in #6356), it shouldn't be a problem for now because we'd only enable component based build for backpack packages.
RFC @mpilgrem
- 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ự
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
alunduil/network-arbitrary#293 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
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